Monday 11 November 2013

Navigate from one page to another with value..(WINDOW APPLICATION)

Navigate from one page to another with value:-

 private void btnImage_Click(object sender, EventArgs e)
        {
            try
            {
                string adval = DiseaseLV.SelectedItems[0].SubItems[0].Text;
                Images Im = new Images();
                Im.flag = 1;
                int I;
                I = Convert.ToInt32(DiseaseLV.SelectedItems[0].SubItems[0].Text);
                Im.val = Convert.ToInt32(adval);
                Im.Show();
            }
            catch (Exception ex)
            {
             
                MessageBox.Show("Select The Index:" + Environment.NewLine + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

        }

--------------------------------------------------
CODE FOR REPORT BY ID FROM LISTVIEW:-

private void btnCurrentReport_Click(object sender, EventArgs e)
        {
            try
               {
                string constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\\PIS(ACU).mdb;";
                Con = new OleDbConnection(@constr);

                SelectedDetailsId = Convert.ToInt32(DiseaseLV.SelectedItems[0].SubItems[7].Text);

                var form = new CurrentReport();
                form.Show();
               }
            catch (Exception ex)
               {
                MessageBox.Show(" Please Select The Index:" + Environment.NewLine + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
               }

               }

--------------------
public partial class DiseaseRecord : Form
    {
        public static int SelectedDetailsId;
    }
-------------------------------------------------------------
CODE FOR

No comments:

Post a Comment