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; } } }
protected void btnSearch_Click(object sender, EventArgs e) { string inst = Session["InstituteId"].ToString(); string member = txtmidSearch.Text.ToString(); string membername = txtmnameSearch.Text.ToString(); string role = Session["Role"].ToString(); string UserId = Session["UserId"].ToString(); IncentiveBusiness obj = new IncentiveBusiness(); ArrayList InstitutionList = new ArrayList(); InstitutionList = obj.selectHrAdditionalInstitute(UserId); if (InstitutionList.Count != 0) { } if (role == "7") { if (InstitutionList.Count == 0) { DataSet ds = obj.SelectMembersInstitutewise(inst, member, membername); if (txtmidSearch.Text.Trim() == "") { Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } else { Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } } else { DataSet ds = obj.SelectMembersAdditionalInstitutewise(UserId, member, membername); if (txtmidSearch.Text.Trim() == "") { Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } else { Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } } } if (role == "17") { DataSet ds1 = obj.SelectFacultyInstitutewise(inst, member, membername); if (txtmidSearch.Text.Trim() == "") { Panel1.Visible = true; popGridSearch.DataSource = ds1; popGridSearch.DataBind(); popGridSearch.Visible = true; } else { Panel1.Visible = true; popGridSearch.DataSource = ds1; popGridSearch.DataBind(); popGridSearch.Visible = true; } } if (role == "18") { User u = new User(); Business b = new Business(); u = b.findmembername(member); if (u.MUNonMU != "M") { DataSet ds2 = obj.SelectStudentInstitutewise(inst, member, membername); if (txtmidSearch.Text.Trim() == "") { Panel1.Visible = true; popGridSearch.DataSource = ds2; popGridSearch.DataBind(); popGridSearch.Visible = true; } else { Panel1.Visible = true; popGridSearch.DataSource = ds2; popGridSearch.DataBind(); popGridSearch.Visible = true; } } } ModalPopupExtender2.Show(); }