protected void MemberIDChanged(object sender, EventArgs e) { txtCurrentBalance.Text = ""; txtUtilization.Text = ""; txtRemarks.Text = ""; txtOldBalance.Text = ""; btnSave.Enabled = true; string memberid = txtID.Text.Trim(); User u = new User(); Business b = new Business(); u = b.findmembername(memberid); txtMembername.Text = u.membername; IncentiveBusiness B = new IncentiveBusiness(); IncentivePoint obj = new IncentivePoint(); string inst = Session["InstituteId"].ToString(); string role = Session["Role"].ToString(); obj = B.SelectMemberCurBalanceInstitutewise(memberid, inst, role); if (obj.MemberId != null) { txtCurrentBalance.Text = obj.CurrentBalance.ToString(); txtOldBalance.Text = obj.OpeningBalance.ToString(); txtUtilizationDate.Text = DateTime.Now.ToShortDateString(); string member = txtmidSearch.Text.ToString(); string membername = txtmnameSearch.Text.ToString(); if (role == "7") { DataSet ds = B.SelectMembersInstitutewise(inst, memberid, u.membername); Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; Panel4.Visible = true; } else if (role == "17") { DataSet ds1 = B.SelectFacultyInstitutewise(inst, memberid, u.membername); Panel1.Visible = true; popGridSearch.DataSource = ds1; popGridSearch.DataBind(); popGridSearch.Visible = true; Panel4.Visible = true; } else { DataSet ds2 = B.SelectStudentInstitutewise(inst, memberid, u.membername); if (u.MUNonMU != "M") { Panel1.Visible = true; popGridSearch.DataSource = ds2; popGridSearch.DataBind(); popGridSearch.Visible = true; Panel4.Visible = true; } } GridView2.Visible = true; Label1.Visible = true; } DataTable dt = new DataTable(); dt = B.CountUtilizationPoints(memberid); if (dt.Rows.Count > 0) { GridView2.Columns[2].FooterText = "Total"; GridView2.Columns[3].FooterText = dt.Rows[0]["count1"].ToString(); GridView2.Columns[4].FooterText = dt.Rows[0]["count2"].ToString(); GridView2.DataSource = dt; GridView2.DataBind(); } else { GridView2.DataBind(); } }
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(); }
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 popSelected(Object sender, EventArgs e) { txtOldBalance.Text = ""; txtID.Text = ""; txtCurrentBalance.Text = ""; txtUtilization.Text = ""; txtRemarks.Text = ""; btnSave.Enabled = true; popGridSearch.Visible = true; GridViewRow row = popGridSearch.SelectedRow; string memberid = row.Cells[1].Text; txtID.Text = row.Cells[1].Text; txtMembername.Text = HttpUtility.HtmlDecode(row.Cells[2].Text); //string inst = row.Cells[3].Text; IncentiveBusiness B = new IncentiveBusiness(); IncentivePoint obj = new IncentivePoint(); obj = B.SelectMemberCurBalance(memberid); txtCurrentBalance.Text = obj.CurrentBalance.ToString(); txtOldBalance.Text = obj.OpeningBalance.ToString(); txtUtilizationDate.Text = DateTime.Now.ToShortDateString(); //string inst = Session["InstituteId"].ToString(); string UserId = Session["UserId"].ToString(); string member = row.Cells[1].Text; string membername = row.Cells[2].Text; string inst = row.Cells[3].Text; string role = Session["Role"].ToString(); if (role == "7") { DataSet ds = B.SelectMembersInstitutewise(inst, member, membername); Panel1.Visible = true; popGridSearch.DataSource = ds; popGridSearch.DataBind(); popGridSearch.Visible = true; } else if (role == "17") { DataSet ds1 = B.SelectFacultyInstitutewise(inst, member, membername); Panel1.Visible = true; popGridSearch.DataSource = ds1; popGridSearch.DataBind(); popGridSearch.Visible = true; } else { DataSet ds2 = B.SelectStudentInstitutewise(inst, member, membername); Panel1.Visible = true; popGridSearch.DataSource = ds2; popGridSearch.DataBind(); popGridSearch.Visible = true; } Panel4.Visible = true; GridView2.Visible = true; Label1.Visible = true; DataTable dt = new DataTable(); dt = B.CountUtilizationPoints(memberid); if (dt.Rows.Count > 0) { GridView2.Columns[2].FooterText = "Total"; GridView2.Columns[3].FooterText = dt.Rows[0]["count1"].ToString(); GridView2.Columns[4].FooterText = dt.Rows[0]["count2"].ToString(); GridView2.DataSource = dt; GridView2.DataBind(); } { GridView2.DataBind(); } }