protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { Doctor_ChangeIPDMedicineStatusBL objDoctor_ChangeIPDMedicineStatusBL = new Doctor_ChangeIPDMedicineStatusBL(); if (ds.Tables[0].Rows[GridView1.SelectedIndex][10].ToString() == "Inactive") { objDoctor_ChangeIPDMedicineStatusBL.Doctor_ChangeIPDMedicineStatus(Convert.ToInt32(ds.Tables[0].Rows[GridView1.SelectedIndex][0].ToString()), 1); } else { objDoctor_ChangeIPDMedicineStatusBL.Doctor_ChangeIPDMedicineStatus(Convert.ToInt32(ds.Tables[0].Rows[GridView1.SelectedIndex][0].ToString()), 0); } Doctor_GetIPDAllMedicinesBL objDoctor_GetIPDAllMedicinesBL = new Doctor_GetIPDAllMedicinesBL(); ds = objDoctor_GetIPDAllMedicinesBL.Doctor_GetIPDAllMedicines(Convert.ToInt32(patientId), Convert.ToInt32(Session["doctorId"].ToString())); if (ds.Tables[0].Rows.Count != 0) { GridView1.DataSource = ds; GridView1.DataBind(); } else { GridView1.DataSource = null; GridView1.DataBind(); Label1.Visible = true; } }
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { Doctor_ChangeIPDMedicineStatusBL objDoctor_ChangeIPDMedicineStatusBL = new Doctor_ChangeIPDMedicineStatusBL(); objDoctor_ChangeIPDMedicineStatusBL.Doctor_ChangeIPDMedicineStatus(Convert.ToInt32(ds.Tables[0].Rows[GridView1.SelectedIndex][0].ToString()), 0); Doctor_GetIPDActiveMedicinesBL objDoctor_GetIPDActiveMedicinesBL = new Doctor_GetIPDActiveMedicinesBL(); ds = objDoctor_GetIPDActiveMedicinesBL.Doctor_GetIPDActiveMedicines(Convert.ToInt32(patientId), Convert.ToInt32(Session["doctorId"].ToString())); if(ds.Tables[0].Rows.Count != 0) { GridView1.DataSource = ds; GridView1.DataBind(); } else { GridView1.DataSource = null; GridView1.DataBind(); Label1.Visible = true; } }