private void setModalWindow(object sender, EventArgs e) { string inst = Session["InstituteId"].ToString(); string member = txtmidSearch.Text.ToString(); IncentiveBusiness obj = new IncentiveBusiness(); string membername = ""; string role = Session["Role"].ToString(); string UserId = Session["UserId"].ToString(); ArrayList InstitutionList = new ArrayList(); InstitutionList = obj.selectHrAdditionalInstitute(UserId); if (InstitutionList.Count != 0) { InstitutionList.Add(inst); } if (role == "7") { if (InstitutionList.Count == 0) { DataSet ds = null; if (member != "") { if (ds.Tables.Count > 0) { ds = obj.SelectMembersInstitutewise(inst, member, membername); Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } } else { ds = obj.SelectMembersInstitute(inst); Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } } else { DataSet ds = null; if (member != "") { if (ds.Tables.Count > 0) { ds = obj.SelectMembersAdditionalInstitutewise(UserId, member, membername); Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } } else { ds = obj.SelectMembersAdditionalInstitute(UserId); Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } } } else if (role == "17") { DataSet ds1 = null; if (member != "") { if (ds1.Tables.Count > 0) { ds1 = obj.SelectFacultyInstitutewise(inst, member, membername); Panel1.Visible = true; popGridSearch.DataSource = ds1; popGridSearch.DataBind(); popGridSearch.Visible = true; } } else { ds1 = obj.SelectFacultyInstitute(inst); Panel1.Visible = true; popGridSearch.DataSource = ds1; popGridSearch.DataBind(); popGridSearch.Visible = true; } } else { DataSet ds2 = null; if (member != "") { // ds2 = obj.SelectStudentInstitutewise(inst, member, membername); // Panel1.Visible = true; // popGridSearch.DataSource = ds2; // popGridSearch.DataBind(); // popGridSearch.Visible = true; //} if (ds2.Tables.Count > 0) { ds2 = obj.SelectStudentInstitutewise(inst, member, membername); Panel1.Visible = true; popGridSearch.DataSource = ds2; popGridSearch.DataBind(); popGridSearch.Visible = true; } } else { ds2 = obj.SelectStudentInstitute(inst); Panel1.Visible = true; popGridSearch.DataSource = ds2; popGridSearch.DataBind(); popGridSearch.Visible = true; } } }