protected void Page_Init(object sender, EventArgs e) { var _mp = new DlMainpagepopulator(); //get salaries CheckBoxList6.DataSource = _mp.GetSalary(); CheckBoxList6.DataTextField = "sTerm"; CheckBoxList6.DataValueField = "Termid"; CheckBoxList6.DataBind(); //get locations CheckBoxList2.DataSource = _mp.GetLocations(); CheckBoxList2.DataTextField = "sTerm"; CheckBoxList2.DataValueField = "Termid"; CheckBoxList2.DataBind(); //get industry CheckBoxList1.DataSource = _mp.GetIndustries(); CheckBoxList1.DataTextField = "sTerm"; CheckBoxList1.DataValueField = "Termid"; CheckBoxList1.DataBind(); if (Request.QueryString["q"] != null & Request.QueryString["q"] != "all") { TextBox2.Text = Request.QueryString["q"]; } }
protected void Year_TextChanged(object sender, EventArgs e) { using (SqlConnection sq = new SqlConnection(ConfigurationManager.ConnectionStrings["DBC"].ConnectionString)) { sq.Open(); string q = "select username from auth where status='Unverified' and utype='Student' and dept ='" + (Session["user"].ToString()).Substring(0, 2) + "'"; string q1 = "select Std_id,name as [Name],dob as [DOB],fname as [Father Name],mname as [mother's Name] ,aadhar,address,mob as [Mobile],mail,interper as[12th %],passedclg as [Passed School],passedyer as [Year of passing] from " + (Session["user"].ToString()).Substring(0, 2) + Year.SelectedValue + " where status='Unverified'"; DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(q, sq); da.Fill(dt); if (dt.Rows.Count > 0) { CheckBoxList2.DataSource = dt; CheckBoxList2.DataTextField = "username"; CheckBoxList2.DataBind(); dt.Clear(); SqlDataAdapter d1 = new SqlDataAdapter(q1, sq); dt = new DataTable(); d1.Fill(dt); if (dt.Rows.Count > 0) { GridView1.DataSource = dt; GridView1.DataBind(); da.Dispose(); dt.Clear(); } } sq.Close(); } }
private void cargarGrid2() { CheckBoxList2.DataSource = CInstEduc.ctrlNivelEducativo.TraerTodos(); CheckBoxList2.DataTextField = "Descripcion"; CheckBoxList2.DataValueField = "Id"; CheckBoxList2.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if ((Session[MasterPage.User] as Users)?.Rigths != 2) { Response.Redirect("login.aspx"); } if (IsPostBack) { return; } using (var context = new MainEntities()) { CheckBoxList1.DataSourceID = ""; CheckBoxList2.DataSourceID = ""; var source1 = context.Актеры.ToList(); var source2 = context.Персонажи.ToList(); CheckBoxList1.DataSource = source1.Select(o => $"{o.Имя} {o.Фамилия}").ToList(); CheckBoxList2.DataSource = source2.Select(o => $"{o.Имя} {o.Фамилия}").ToList(); CheckBoxList1.DataBind(); CheckBoxList2.DataBind(); } }
private void CheckBoxListItems2() { rootCfg = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/petroneeds"); connection = rootCfg.ConnectionStrings.ConnectionStrings["petroneedsConnectionString2"].ConnectionString.ToString(); con = new SqlConnection(connection); con.ConnectionString = connection; con.Open(); dataset = new DataSet(); comm = new SqlCommand("SELECT MenuName, MenuID, ParentID FROM tbl_WebMenu", con); adapter = new SqlDataAdapter(comm); adapter.Fill(dataset); CheckBoxList2.DataSource = dataset; CheckBoxList2.DataTextField = "MenuName"; CheckBoxList2.DataValueField = "MenuID"; //CheckBoxList1.Items[].FindByValue(0) = "ParentID"; ////CheckBoxList1.SelectedIndex.CompareTo("ParentID"); CheckBoxList2.DataBind(); if (CheckBoxList2.DataValueField.Length == 1) { for (int i = 0; i < CheckBoxList2.Items.Count; i++) { CheckBoxList2.Items[i].Selected = true; } } }
protected void Page_Load(object sender, EventArgs e) { var makes = new List <string> { "Ação", "Animação", "Comédia", "Corridas", "Erótico", "Aventura", "Documentário", "Drama" , "Fantasia", "Ficção", "Guerra", "Musical", "Policial", "Religioso", "Romance", "Terror" }; var ator = new List <string> { "Al Pacino ", "Jack Nicholson", "Chiwetel Ejiofor", "Amanda Peet", "Woody Harrelson", "Morgan Freeman", "Brad Pitt", "Angelina Jolie", "Benedict Cumberbatch", "Salvador Dalí", "Al Dalí", "Miranda Cosgrove", "Rik Mayall", "Jimmy Fallon" }; var escritor = new List <string> { "Roland Emmerich", "Harald Kloser", "Chiwetel Ejiofor", "Amanda Peet", "Arthur C. Clarke ", " Peter Hyams", "Benedict Cumberbatch", "Salvador Dalí", }; var song = new List <string> { "The impact ", "Ashes in D.C", "Singin' in the Rain", "Skyfall", "Born to Be Wild" }; var directores = new List <string> { "Ingmar Bergman", "Benedict Cumberbatch", "Chiwetel Ejiofor", "Amanda Peet", "Salvador Dalí", "Federico Fellini", "Francis Ford Coppola", "Charles Chaplin", "Tim Burton", "Roman Polanski", "Roland Emmerich " }; makes.Sort(); ator.Sort(); escritor.Sort(); song.Sort(); directores.Sort(); CheckBoxList2.DataSource = escritor; CheckBoxList2.DataBind(); cblEmployees.DataSource = ator; cblEmployees.DataBind(); cblEmployees.DataSource = directores; DropDownList1.DataBind(); for (int i = 1889; i < 2016; i++) { DropDownList3.Items.Add(i.ToString()); } CheckBoxList3.DataSource = song; CheckBoxList3.DataBind(); DropDownList2.DataSource = makes; DropDownList2.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["UserId"] == null) { Response.Redirect("Welcome.aspx"); } Session.Timeout = 120; SectionPanel.Visible = false; DistrictPanel.CssClass = "col-lg-12"; SqlDataReader re = DataConnection.selectQuery("select * from member where memeberid = " + Convert.ToInt32(Session["RCV"]) + " and admin = 'A'"); if (re.HasRows) { SectionPanel.Visible = true; DistrictPanel.CssClass = "col-lg-6"; } int count = CheckBoxList2.Items.Count; SqlDataReader reader = DataConnection.selectQuery("select location,memeberid from member where Department='section'"); if (reader.HasRows) { //List<String> lst = new List<string>(); while (reader.Read()) { ListItem item = new ListItem(); item.Text = reader.GetString(0); item.Value = reader.GetInt32(1).ToString(); item.Selected = false; CheckBoxList2.Items.Add(item); } } reader.Close(); DataConnection.closeConnection(); //count = CheckBoxList3.Items.Count; reader = DataConnection.selectQuery("select location,memeberid from member where Department='dist'"); if (reader.HasRows) { //List<String> lst = new List<string>(); while (reader.Read()) { ListItem item = new ListItem(); item.Text = reader.GetString(0); item.Value = reader.GetInt32(1).ToString(); item.Selected = false; CheckBoxList3.Items.Add(item); } } reader.Close(); DataConnection.closeConnection(); CheckBoxList2.DataBind(); CheckBoxList3.DataBind(); }
private void BindList() { DataSet ds = new DataSet(); string cmdstr = "select skill from skillstaught"; SqlDataAdapter adp = new SqlDataAdapter(cmdstr, con); adp.Fill(ds); CheckBoxList2.DataSource = ds; CheckBoxList2.DataTextField = "skill"; CheckBoxList2.DataValueField = "skill"; CheckBoxList2.DataBind(); }
public void filldrop_a() { DataSet ds = new DataSet(); SqlDataAdapter dp = new SqlDataAdapter("select * from tbl_person where (categoryname=@n)", conn); dp.SelectCommand.Parameters.AddWithValue("@n", "Advisor"); dp.Fill(ds); CheckBoxList2.DataSource = ds; CheckBoxList2.DataTextField = "Name"; CheckBoxList2.DataValueField = "supervisorId"; CheckBoxList2.DataBind(); }
public void HastaliklariCek() { baglanti.Open(); SqlCommand komut = new SqlCommand("select hastalik from HastalikTanim", baglanti); SqlDataAdapter adaptor = new SqlDataAdapter(komut); DataSet DS = new DataSet(); adaptor.Fill(DS); baglanti.Close(); CheckBoxList2.DataSource = DS.Tables[0]; CheckBoxList2.DataTextField = "hastalik"; CheckBoxList2.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!Context.User.IsInRole("ServiceLine Manager")) { Response.Redirect("Access.aspx"); } string ServiceName = Request.QueryString["ServLineName"]; ServLineName.Text = ServiceName; if (!IsPostBack) { string ServLineName = Request.QueryString["ServLineName"]; //OMCheckList.Text = ServLineName; string ServLineId = Request.QueryString["ID"]; int ServLineId1 = Convert.ToInt32(Request.QueryString["ID"]); ServiceLineRepository SLrepo = new ServiceLineRepository(); SLMServiceLine SlMRepo = new SLMServiceLine(); SlMRepo.getServLineOMDetails(ServLineId); SlMRepo.getAllOMDetails(); SlMRepo.getAllOMDetailsOfServiceLineManagers(ServLineId); SelectAllUsers selectAllUsers = new SelectAllUsers(); OMCheckList.DataSource = SlMRepo.ServLineOMTab; OMCheckList.DataTextField = "UserName"; OMCheckList.DataValueField = "Id"; OMCheckList.DataBind(); for (int i = 0; i < OMCheckList.Items.Count; i++) { OMCheckList.Items[i].Selected = true; string OmId = OMCheckList.Items[i].Value; SLrepo.EditServiceLineOMwhileload(ServLineId1, OmId); } //OMCheckList1.DataSource = SlMRepo.ServLineOMList; //OMCheckList1.DataTextField = "UserName"; //OMCheckList1.DataValueField = "Id"; //OMCheckList1.DataBind(); //CheckBoxList2.DataSource = SlMRepo.getAllOMDetailsOfServiceLineManagers(ServLineId); CheckBoxList2.DataSource = SlMRepo.ServLineOMList; CheckBoxList2.DataTextField = "UserName"; CheckBoxList2.DataValueField = "Id"; CheckBoxList2.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { //set default inputs TextBox2.Focus(); //Page.Form.DefaultButton = ImageButton2.UniqueID; CLMainpagepopulator cmpag = new CLMainpagepopulator(); if (!IsPostBack) { //constructor CLMainpagepopulator mp = new CLMainpagepopulator(); //get count of all jobs Label13.Text = mp.getcountjobs() + " Jobs Advertized from " + mp.getcountrecswadvert() + " Recruiters"; //populate left //get salaries CheckBoxList6.DataSource = mp.getSalary(); CheckBoxList6.DataTextField = "sTerm"; CheckBoxList6.DataValueField = "Termid"; CheckBoxList6.DataBind(); //get locations CheckBoxList2.DataSource = mp.getLocations(); CheckBoxList2.DataTextField = "sTerm"; CheckBoxList2.DataValueField = "Termid"; CheckBoxList2.DataBind(); //get industry CheckBoxList1.DataSource = mp.getIndustries(); CheckBoxList1.DataTextField = "sTerm"; CheckBoxList1.DataValueField = "Termid"; CheckBoxList1.DataBind(); //main job binding CLMainpagepopulator mpgp = new CLMainpagepopulator(); GridView1.DataSource = mpgp.getJobssingle(); GridView1.DataBind(); //featured Recruiters ClFeaturedrecruiters frec = new ClFeaturedrecruiters(); GridView2.DataSource = frec.GetFRecs(); GridView2.DataBind(); } }
private void BindCheckBoxList() { List <TestClass> myList = new List <TestClass>(); myList.Add(new TestClass("1", "数据绑定值 1")); myList.Add(new TestClass("2", "数据绑定值 2")); myList.Add(new TestClass("3", "数据绑定值 3")); myList.Add(new TestClass("4", "数据绑定值 4")); CheckBoxList2.DataTextField = "Name"; CheckBoxList2.DataValueField = "Id"; CheckBoxList2.DataSource = myList; CheckBoxList2.DataBind(); CheckBoxList2.SelectedValueArray = new string[] { "1", "3" }; }
private void LoadPlantName() { try { Datechanged(); String dbConnStr = ConfigurationManager.ConnectionStrings["AMPSConnectionString"].ConnectionString; SqlConnection conn = null; using (conn = new SqlConnection(dbConnStr)) { SqlCommand sqlCmd = new SqlCommand("dbo.[Get_PlantwiseSingleBilldateOverAllDataReport]"); conn.Open(); sqlCmd.Connection = conn; sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.Parameters.AddWithValue("@spccode", Company_code); sqlCmd.Parameters.AddWithValue("@spfrmdate", d1.ToString()); sqlCmd.Parameters.AddWithValue("@sptodate", d2.ToString()); SqlDataAdapter da = new SqlDataAdapter(sqlCmd); da.Fill(ds); if (ds != null) { CheckBoxList1.DataSource = ds; CheckBoxList1.DataTextField = "PlantName"; CheckBoxList1.DataValueField = "pcode"; CheckBoxList1.DataBind(); CheckBoxList2.DataSource = ds; CheckBoxList2.DataTextField = "Frmtodate2"; CheckBoxList2.DataValueField = "Frmtodate3"; CheckBoxList2.DataBind(); CheckBoxList3.DataSource = ds; CheckBoxList3.DataTextField = "Frmtodate1"; CheckBoxList3.DataValueField = "Frmtodate4"; CheckBoxList3.DataBind(); } else { } } } catch (Exception ex) { Lbl_Errormsg.Visible = true; Lbl_Errormsg.Text = ex.ToString(); } }
public void sizefilter() { MessageBox msg = new MessageBox(); DataTable ds = filter.fillfilterbytype("size"); if (ds.Rows.Count == 0) { } else { CheckBoxList2.DataSource = ds; CheckBoxList2.DataTextField = ds.Columns["filtervalue"].ToString(); CheckBoxList2.DataValueField = ds.Columns["id"].ToString(); CheckBoxList2.DataBind(); } }
protected void DropDownList2_Changed(object sender, EventArgs e) { //绑定还未下载的作业 if (DropDownList2.SelectedIndex != 0 && DropDownList1.SelectedIndex != 0) { classid = Convert.ToInt32(DropDownList1.SelectedValue); times = Convert.ToInt32(DropDownList2.SelectedValue); DataTable dt = BLL.Homework.BLLGetHomeworkToDownload(classid, times); CheckBoxList1.DataSource = dt; CheckBoxList1.DataTextField = dt.Columns[2].ColumnName; CheckBoxList1.DataValueField = dt.Columns[1].ColumnName; CheckBoxList1.DataBind(); } else if (DropDownList2.SelectedIndex == 1 && DropDownList1.SelectedIndex != 0) { classid = Convert.ToInt32(DropDownList1.SelectedValue); times = 0; DataTable dt = BLL.Homework.BLLGetHomeworkToDownload(classid, times); CheckBoxList1.DataSource = dt; CheckBoxList1.DataTextField = dt.Columns[2].ColumnName; CheckBoxList1.DataValueField = dt.Columns[1].ColumnName; CheckBoxList1.DataBind(); } //绑定已下载的作业 if (DropDownList2.SelectedIndex != 0 && DropDownList2.SelectedIndex != 1 && DropDownList1.SelectedIndex != 0) { classid = Convert.ToInt32(DropDownList1.SelectedValue); times = Convert.ToInt32(DropDownList2.SelectedValue); DataTable dt = BLL.Homework.BLLGetDownloadedHomework(classid, times); CheckBoxList2.DataSource = dt; CheckBoxList2.DataTextField = dt.Columns[2].ColumnName; CheckBoxList2.DataValueField = dt.Columns[1].ColumnName; CheckBoxList2.DataBind(); } else if (DropDownList2.SelectedIndex == 1 && DropDownList1.SelectedIndex != 0) { classid = Convert.ToInt32(DropDownList1.SelectedValue); times = 0; DataTable dt = BLL.Homework.BLLGetDownloadedHomework(classid, times); CheckBoxList2.DataSource = dt; CheckBoxList2.DataTextField = dt.Columns[2].ColumnName; CheckBoxList2.DataValueField = dt.Columns[1].ColumnName; CheckBoxList2.DataBind(); } }
private void InitCheckBoxList2() { List <TestClass> myList = new List <TestClass>(); myList.Add(new TestClass("value1", "可选项 1")); myList.Add(new TestClass("value2", "可选项 2")); myList.Add(new TestClass("value3", "可选项 3")); myList.Add(new TestClass("value4", "可选项 4")); myList.Add(new TestClass("value5", "可选项 5")); myList.Add(new TestClass("value6", "可选项 6")); CheckBoxList2.DataTextField = "Name"; CheckBoxList2.DataValueField = "Id"; CheckBoxList2.DataSource = myList; CheckBoxList2.DataBind(); CheckBoxList2.SelectedValueArray = new string[] { "value1", "value2", "value3" }; }
protected void Page_Load(object sender, EventArgs e) { if (User.Identity.Name.ToString() == "") { Response.Redirect("/Default.aspx"); } List <AspNetUser> listUsers = new List <AspNetUser>(); List <AspNetUser> listManagers = new List <AspNetUser>(); AspNetUser potochnuj = new AspNetUser(); StreamWriter wr = new StreamWriter(@"E:\logWebSite5.txt", true); wr.WriteLine("Page_Load()"); using (var db = new Entities5()) { listUsers = db.AspNetUsers.Where(m => m.ManagerRights != true).ToList(); listManagers = db.AspNetUsers.Where(m => m.ManagerRights == true).ToList(); foreach (AspNetUser m in listManagers) { wr.WriteLine("m.UserName = "******" User.Identity.Name.ToString())" + User.Identity.Name.ToString()); if (m.UserName == User.Identity.Name.ToString()) { potochnuj = m; } } } wr.Close(); listManagers.Remove(potochnuj); CheckBoxList1.DataSource = listUsers; CheckBoxList1.DataTextField = "UserName"; CheckBoxList1.DataValueField = "Id"; CheckBoxList2.DataSource = listManagers; CheckBoxList2.DataTextField = "UserName"; CheckBoxList2.DataValueField = "Id"; if (!IsPostBack) { CheckBoxList1.DataBind(); CheckBoxList2.DataBind(); } }
void advisorList() { con.Open(); DataSet ds = new DataSet(); SqlDataAdapter adp = new SqlDataAdapter("select * from advTable", con); adp.Fill(ds); CheckBoxList2.DataSource = ds; CheckBoxList2.DataTextField = "Name"; CheckBoxList2.DataValueField = "CNIC"; CheckBoxList2.DataBind(); con.Close(); }
private void LoadPlantName1() { try { DataSet ds = new DataSet(); String dbConnStr = ConfigurationManager.ConnectionStrings["AMPSConnectionString"].ConnectionString; SqlConnection conn = null; using (conn = new SqlConnection(dbConnStr)) { SqlCommand sqlCmd = new SqlCommand("dbo.[GetPaymentAllot_BalanceAmount]"); conn.Open(); sqlCmd.Connection = conn; sqlCmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(sqlCmd); da.Fill(ds); if (ds != null) { CheckBoxList1.DataSource = ds; CheckBoxList1.DataTextField = "Plant"; CheckBoxList1.DataValueField = "Plant";//ROUTE_ID CheckBoxList1.DataBind(); CheckBoxList2.DataSource = ds; CheckBoxList2.DataTextField = "BalanceAmount"; CheckBoxList2.DataValueField = "BalanceAmount";//ROUTE_ID CheckBoxList2.DataBind(); CheckBoxList3.DataSource = ds; CheckBoxList3.DataTextField = "Billdate"; CheckBoxList3.DataValueField = "Billdate";//ROUTE_ID CheckBoxList3.DataBind(); } } } catch (Exception ex) { } }
protected void Page_Init(object sender, EventArgs e) { var mp = new DlMainpagepopulator(); //get locations CheckBoxList2.DataSource = mp.GetLocations(); CheckBoxList2.DataTextField = "sTerm"; CheckBoxList2.DataValueField = "Termid"; CheckBoxList2.DataBind(); //get industry CheckBoxList1.DataSource = mp.GetIndustries(); CheckBoxList1.DataTextField = "sTerm"; CheckBoxList1.DataValueField = "Termid"; CheckBoxList1.DataBind(); //get salary CheckBoxList6.DataSource = mp.Getsalaries(); CheckBoxList6.DataTextField = "sTerm"; CheckBoxList6.DataValueField = "Termid"; CheckBoxList6.DataBind(); }
private void BindCheckBoxListMaster(int tidd) { try { ds = MBLL.GetSubMenuTitleCheckBoxMaster(tidd); if (tidd == 1) { CheckBoxList1.DataSource = ds; CheckBoxList1.DataTextField = "SubMenuName"; CheckBoxList1.DataValueField = "SubMenuValue"; CheckBoxList1.DataBind(); } else if (tidd == 2) { CheckBoxList2.DataSource = ds; CheckBoxList2.DataTextField = "SubMenuName"; CheckBoxList2.DataValueField = "SubMenuValue"; CheckBoxList2.DataBind(); } else if (tidd == 3) { CheckBoxList3.DataSource = ds; CheckBoxList3.DataTextField = "SubMenuName"; CheckBoxList3.DataValueField = "SubMenuValue"; CheckBoxList3.DataBind(); } else if (tidd == 4) { CheckBoxList4.DataSource = ds; CheckBoxList4.DataTextField = "SubMenuName"; CheckBoxList4.DataValueField = "SubMenuValue"; CheckBoxList4.DataBind(); } } catch (Exception ex) { ex.Message.ToString(); } }
private void loadBranch() { BusinessLogic bl = new BusinessLogic(sDataSource); DataSet ds = new DataSet(); string connection = ConfigurationManager.ConnectionStrings[Request.Cookies["Company"].Value].ToString(); lstBranch.Items.Clear(); brncode = Request.Cookies["Branch"].Value; if (brncode == "All") { ds = bl.ListBranch(); // lstBranch.Items.Add(new ListItem("All", "0")); CheckBoxList1.Visible = true; lblbranch.Text = "Select Branch(es)"; single.Visible = false; single1.Visible = false; // div1.Visible = false; } else { ds = bl.ListDefaultBranch(brncode); CheckBoxList1.Visible = false; // lblbranch.Text = "Select Branch"; multi.Visible = false; select.Visible = false; } lstBranch.DataSource = ds; lstBranch.DataTextField = "BranchName"; lstBranch.DataValueField = "Branchcode"; lstBranch.DataBind(); CheckBoxList2.DataSource = ds; CheckBoxList2.DataTextField = "BranchName"; CheckBoxList2.DataValueField = "Branchcode"; CheckBoxList2.DataBind(); }
private void BindBankPaymentData() { try { SqlCommand cmd = new SqlCommand(); DataTable custDT = DisplayselectedBankid(); DBManager SalesDB = new DBManager(); DateTime dt1 = new DateTime(); DateTime dt2 = new DateTime(); string d1 = dt1.ToString("MM/dd/yyyy"); string d2 = dt2.ToString("MM/dd/yyyy"); string month = ddlmonth.SelectedItem.Value; string year = ddlyear.SelectedItem.Value; string employetype = ddlemptype.SelectedItem.Value; string branch = ddlbranch.SelectedItem.Value; int count = custDT.Rows.Count; if (count > 36) { cmd = new SqlCommand("SELECT bankid, empid, branchid, designation, ifsccode, branchname, fullname, employee_num, netpay, bankaccountno, Expr1, emptype, gross, basic, salary, deptid, cellphone,extrapay FROM (SELECT TOP (100) PERCENT employebankdetails.bankid, employedetails.empid, monthlysalarystatement.branchid, monthlysalarystatement.designation, employebankdetails.ifsccode, branchmaster.branchname, employedetails.fullname, employedetails.employee_num, monthlysalarystatement.netpay, monthlysalarystatement.bankaccountno, monthlysalarystatement.ifsccode AS Expr1, monthlysalarystatement.emptype, monthlysalarystatement.gross, monthlysalarystatement.basic, monthlysalarystatement.salary, monthlysalarystatement.deptid, employedetails.cellphone, monthlysalarystatement.extrapay FROM bankmaster INNER JOIN employebankdetails ON bankmaster.sno = employebankdetails.bankid INNER JOIN monthlysalarystatement ON employebankdetails.accountno = monthlysalarystatement.bankaccountno INNER JOIN branchmaster ON monthlysalarystatement.branchid = branchmaster.branchid INNER JOIN employedetails ON monthlysalarystatement.empid = employedetails.empid WHERE (monthlysalarystatement.branchid = @branchid) AND (monthlysalarystatement.month = @month) AND (monthlysalarystatement.year = @year) AND (monthlysalarystatement.emptype=@emptype) AND (employedetails.status = 'NO') AND (monthlysalarystatement.bankaccountno <> '') GROUP BY bankmaster.sno, monthlysalarystatement.branchid, branchmaster.branchname, employedetails.fullname, employedetails.employee_num, monthlysalarystatement.netpay, employedetails.empid, employebankdetails.bankid, employebankdetails.ifsccode, monthlysalarystatement.bankaccountno, monthlysalarystatement.ifsccode, monthlysalarystatement.emptype, monthlysalarystatement.gross, monthlysalarystatement.basic, monthlysalarystatement.salary, monthlysalarystatement.deptid, monthlysalarystatement.designation, employedetails.cellphone, monthlysalarystatement.extrapay ORDER BY employedetails.empid) AS A WHERE (NOT EXISTS (SELECT B.sno, B.Companyid, B.branchid, B.empid, B.employecode, B.empname, B.designation, B.netpay, B.bankaccountno, B.ifsccode, B.emptype, B.bankid, B.deptid, B.refno FROM subbankformatmaster AS B INNER JOIN bankformatmaster ON B.refno = bankformatmaster.sno WHERE (A.empid = B.empid) AND (bankformatmaster.month = @month) AND (bankformatmaster.year = @year)))"); cmd.Parameters.Add("@branchid", branch); cmd.Parameters.Add("@month", month); cmd.Parameters.Add("@year", year); cmd.Parameters.Add("@emptype", employetype); DataTable Branchdata = SalesDB.SelectQuery(cmd).Tables[0]; // cmd = new SqlCommand("SELECT sno, empid, deptid, amount, remarks, doe, monthofpaid, employee_num, month, year, status, entry_by, modify_by FROM salessalaryadvance WHERE (month = @MNTH) AND (year = @YEAR)"); cmd.Parameters.Add("@MNTH", month); cmd.Parameters.Add("@YEAR", year); DataTable dtsaladvance = SalesDB.SelectQuery(cmd).Tables[0]; if (Branchdata.Rows.Count > 0) { DataTable Report = new DataTable(); Report.Columns.Add("bankid"); Report.Columns.Add("empid"); Report.Columns.Add("fullname"); Report.Columns.Add("netpay"); foreach (DataRow dr in custDT.Rows) { string bankid = dr["Bankid"].ToString(); foreach (DataRow dra in Branchdata.Select("bankid='" + bankid + "'")) { double netpay = 0; double.TryParse(dra["netpay"].ToString(), out netpay); double extrapay = 0; double.TryParse(dra["extrapay"].ToString(), out extrapay); double totamt = netpay + extrapay; string bnkid = dra["bankid"].ToString(); string empid = dra["empid"].ToString(); double saladvance = 0; foreach (DataRow drs in dtsaladvance.Select("empid='" + empid + "'")) { string saladv = drs["amount"].ToString(); double totsaladv = Convert.ToDouble(saladv); saladvance += totsaladv; } double totalamount = totamt - saladvance; string fullname = dra["fullname"].ToString(); DataRow newrow = Report.NewRow(); newrow["bankid"] = bnkid; newrow["empid"] = empid; newrow["fullname"] = fullname; newrow["netpay"] = totalamount.ToString(); Report.Rows.Add(newrow); } } CheckBoxList1.DataSource = Report; CheckBoxList1.DataTextField = "fullname"; CheckBoxList1.DataValueField = "empid"; CheckBoxList1.DataBind(); CheckBoxList2.DataSource = Report; CheckBoxList2.DataTextField = "netpay"; CheckBoxList2.DataValueField = "netpay"; CheckBoxList2.DataBind(); } else { CheckBoxList1.DataSource = Branchdata; CheckBoxList1.DataTextField = "fullname"; CheckBoxList1.DataValueField = "empid"; CheckBoxList1.DataBind(); CheckBoxList2.DataSource = Branchdata; CheckBoxList2.DataTextField = "netpay"; CheckBoxList2.DataValueField = "netpay"; CheckBoxList2.DataBind(); } } else { DataTable Report = new DataTable(); Report.Columns.Add("bankid"); Report.Columns.Add("empid"); Report.Columns.Add("fullname"); Report.Columns.Add("netpay"); if (custDT.Rows.Count > 0) { cmd = new SqlCommand("SELECT bankid, empid, branchid, designation, ifsccode, branchname, fullname, employee_num, netpay, bankaccountno, Expr1, emptype, gross, basic, salary, deptid, cellphone,extrapay FROM (SELECT TOP (100) PERCENT employebankdetails.bankid, employedetails.empid, monthlysalarystatement.branchid, monthlysalarystatement.designation, employebankdetails.ifsccode, branchmaster.branchname, employedetails.fullname, employedetails.employee_num, monthlysalarystatement.netpay, monthlysalarystatement.bankaccountno, monthlysalarystatement.ifsccode AS Expr1, monthlysalarystatement.emptype, monthlysalarystatement.gross, monthlysalarystatement.basic, monthlysalarystatement.salary, monthlysalarystatement.deptid, employedetails.cellphone, monthlysalarystatement.extrapay FROM bankmaster INNER JOIN employebankdetails ON bankmaster.sno = employebankdetails.bankid INNER JOIN monthlysalarystatement ON employebankdetails.accountno = monthlysalarystatement.bankaccountno INNER JOIN branchmaster ON monthlysalarystatement.branchid = branchmaster.branchid INNER JOIN employedetails ON monthlysalarystatement.empid = employedetails.empid WHERE (monthlysalarystatement.branchid = @branchid) AND (monthlysalarystatement.month = @month) AND (monthlysalarystatement.year = @year) AND (monthlysalarystatement.emptype=@emptype) AND (employedetails.status = 'NO') AND (monthlysalarystatement.bankaccountno <> '') GROUP BY bankmaster.sno, monthlysalarystatement.branchid, branchmaster.branchname, employedetails.fullname, employedetails.employee_num, monthlysalarystatement.netpay, employedetails.empid, employebankdetails.bankid, employebankdetails.ifsccode, monthlysalarystatement.bankaccountno, monthlysalarystatement.ifsccode, monthlysalarystatement.emptype, monthlysalarystatement.gross, monthlysalarystatement.basic, monthlysalarystatement.salary, monthlysalarystatement.deptid, monthlysalarystatement.designation, employedetails.cellphone, monthlysalarystatement.extrapay ORDER BY employedetails.empid) AS A WHERE (NOT EXISTS (SELECT B.sno, B.Companyid, B.branchid, B.empid, B.employecode, B.empname, B.designation, B.netpay, B.bankaccountno, B.ifsccode, B.emptype, B.bankid, B.deptid, B.refno FROM subbankformatmaster AS B INNER JOIN bankformatmaster ON B.refno = bankformatmaster.sno WHERE (A.empid = B.empid) AND (bankformatmaster.month = @month) AND (bankformatmaster.year = @year)))"); cmd.Parameters.Add("@branchid", branch); cmd.Parameters.Add("@month", month); cmd.Parameters.Add("@year", year); cmd.Parameters.Add("@emptype", employetype); DataTable saldata = SalesDB.SelectQuery(cmd).Tables[0]; if (saldata.Rows.Count > 0) { foreach (DataRow dr in custDT.Rows) { string bankid = dr["Bankid"].ToString(); foreach (DataRow dra in saldata.Select("bankid='" + bankid + "'")) { double netpay = 0; double.TryParse(dra["netpay"].ToString(), out netpay); double extrapay = 0; double.TryParse(dra["extrapay"].ToString(), out extrapay); double totamt = netpay + extrapay; string bnkid = dra["bankid"].ToString(); string empid = dra["empid"].ToString(); string fullname = dra["fullname"].ToString(); DataRow newrow = Report.NewRow(); newrow["bankid"] = bnkid; newrow["empid"] = empid; newrow["fullname"] = fullname; newrow["netpay"] = totamt.ToString(); Report.Rows.Add(newrow); } } CheckBoxList1.DataSource = Report; CheckBoxList1.DataTextField = "fullname"; CheckBoxList1.DataValueField = "empid"; CheckBoxList1.DataBind(); CheckBoxList2.DataSource = Report; CheckBoxList2.DataTextField = "netpay"; CheckBoxList2.DataValueField = "netpay"; CheckBoxList2.DataBind(); } else { CheckBoxList1.DataSource = Report; CheckBoxList1.DataTextField = "fullname"; CheckBoxList1.DataValueField = "empid"; CheckBoxList1.DataBind(); CheckBoxList2.DataSource = Report; CheckBoxList2.DataTextField = "netpay"; CheckBoxList2.DataValueField = "netpay"; CheckBoxList2.DataBind(); } } } //ds = LoadBankPaymentDatas(ccode, pcode, d1, d2, rid.ToString(), ddl_BankName.SelectedItem.Value.Trim()); //if (ds != null) //{ // CheckBoxList1.DataSource = ds; // CheckBoxList1.DataTextField = "Agent_Name"; // CheckBoxList1.DataValueField = "proAid"; // CheckBoxList1.DataBind(); // CheckBoxList2.DataSource = ds; // CheckBoxList2.DataTextField = "Netpay"; // CheckBoxList2.DataValueField = "Netpay"; // CheckBoxList2.DataBind(); //} //else //{ // //WebMsgBox.Show("Agents Not Available in this Selection..."); //} } catch (Exception ex) { } }
private void BindprocurementRemarksData() { try { DateTime dt1 = new DateTime(); dt1 = DateTime.ParseExact(txt_RemmarksDate.Text, "dd/MM/yyyy", null); if (rd_sesAm.Checked == true) { ses = "AM"; } else { ses = "PM"; } string d1 = dt1.ToString("MM/dd/yyyy"); ds = Bllproimp.LoadProocurementRemarksDatas(ccode, pcode, d1, ses, IncdecFlag); if (ds != null) { CheckBoxList_Sno.DataSource = ds; CheckBoxList_Sno.DataTextField = "serial_no"; CheckBoxList_Sno.DataValueField = "serial_no"; CheckBoxList_Sno.DataBind(); CheckBoxList1.DataSource = ds; CheckBoxList1.DataTextField = "SampleId"; CheckBoxList1.DataValueField = "SampleId"; CheckBoxList1.DataBind(); CheckBoxList2.DataSource = ds; CheckBoxList2.DataTextField = "agent_Id"; CheckBoxList2.DataValueField = "agent_Id"; CheckBoxList2.DataBind(); CheckBoxList3.DataSource = ds; CheckBoxList3.DataTextField = "milk_Kg"; CheckBoxList3.DataValueField = "milk_Kg"; CheckBoxList3.DataBind(); CheckBoxList4.DataSource = ds; CheckBoxList4.DataTextField = "fat"; CheckBoxList4.DataValueField = "fat"; CheckBoxList4.DataBind(); CheckBoxList5.DataSource = ds; CheckBoxList5.DataTextField = "snf"; CheckBoxList5.DataValueField = "snf"; CheckBoxList5.DataBind(); CheckBoxList6.DataSource = ds; CheckBoxList6.DataTextField = "magent_Id"; CheckBoxList6.DataValueField = "magent_Id"; CheckBoxList6.DataBind(); CheckBoxList7.DataSource = ds; CheckBoxList7.DataTextField = "mmilk_Kg"; CheckBoxList7.DataValueField = "mmilk_Kg"; CheckBoxList7.DataBind(); CheckBoxList8.DataSource = ds; CheckBoxList8.DataTextField = "mfat"; CheckBoxList8.DataValueField = "mfat"; CheckBoxList8.DataBind(); CheckBoxList9.DataSource = ds; CheckBoxList9.DataTextField = "msnf"; CheckBoxList9.DataValueField = "msnf"; CheckBoxList9.DataBind(); } //Adding color to differenciate the remarks modifications Start SetColorRemarksData(); //Adding color to differenciate the remarks modifications End } catch (Exception ex) { } CheckBoxListClear1(); }
/// <summary> /// 加载施工人员 /// </summary> /// <param name="iID"></param> private void LoadSGRY(int iID) { if (iID > 0) { /// 施工员和安装员组用户才加载 string strSQL = "SELECT S_USERINFO.ID,' '+CNAME+' '+ISNULL(SSDZ,'')+' ' NAME,(Select count(id) from W_GCGD_USERS where W_GCGD_USERS.USERS=S_USERINFO.ID and GCDID=" + iID + ") Selected from S_USERINFO,S_YH_QXZ where FLAG=0 and S_USERINFO.id=S_YH_QXZ.USERID and QXZID =3 order by cname"; if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { this.Div1.Visible = true; CheckBoxList1.DataTextField = "NAME"; CheckBoxList1.DataValueField = "ID"; CheckBoxList1.DataSource = OP_Mode.Dtv; CheckBoxList1.DataBind(); string arr1 = string.Empty;; for (int i = 0; i < OP_Mode.Dtv.Count; i++) { if (Convert.ToInt32(OP_Mode.Dtv[i]["Selected"]) > 0) { arr1 += OP_Mode.Dtv[i]["ID"] + ","; } } foreach (ListItem lst in this.CheckBoxList1.Items) { string[] arr = arr1.Trim().Split(','); for (int i = 0; i < arr.Length; i++) { if (arr[i].ToString().Equals(lst.Value)) { lst.Selected = true; } } } } else { this.Div1.Visible = false; } } else { MessageBox("", strSQL + " " + OP_Mode.strErrMsg); } /// 施工员和安装员组用户才加载 strSQL = "SELECT S_USERINFO.ID,' '+CNAME+' '+ISNULL(SSDZ,'')+' ' NAME,(Select count(id) from W_GCGD_USERS where W_GCGD_USERS.USERS=S_USERINFO.ID and GCDID=" + iID + ") Selected from S_USERINFO,S_YH_QXZ where FLAG=0 and S_USERINFO.id=S_YH_QXZ.USERID and QXZID =4 order by cname"; if (OP_Mode.SQLRUN(strSQL)) { if (OP_Mode.Dtv.Count > 0) { this.Div1.Visible = true; CheckBoxList2.DataTextField = "NAME"; CheckBoxList2.DataValueField = "ID"; CheckBoxList2.DataSource = OP_Mode.Dtv; CheckBoxList2.DataBind(); string arr1 = string.Empty;; for (int i = 0; i < OP_Mode.Dtv.Count; i++) { if (Convert.ToInt32(OP_Mode.Dtv[i]["Selected"]) > 0) { arr1 += OP_Mode.Dtv[i]["ID"] + ","; } } foreach (ListItem lst in this.CheckBoxList2.Items) { string[] arr = arr1.Trim().Split(','); for (int i = 0; i < arr.Length; i++) { if (arr[i].ToString().Equals(lst.Value)) { lst.Selected = true; } } } } else { this.Div1.Visible = false; } } else { MessageBox("", strSQL + " " + OP_Mode.strErrMsg); } } }
protected void Button1_Click(object sender, EventArgs e) { string message = ""; string memberno = ""; CheckBoxList2.DataBind(); CheckBoxList3.DataBind(); CheckBoxList4.DataBind(); CheckBoxList5.DataBind(); CheckBoxList6.DataBind(); if (Session["sgques"].ToString() == "SendData") { DataConnection.insertQuery("update message set sgsubmit='T' where QNO=N'" + Session["quesno"].ToString() + "' and Assemblys=N'" + Session["sadan"].ToString() + "' and Session=N'" + Session["session"].ToString() + "'"); DataConnection.insertQuery("insert into miscellenous (other_posist_name,posist_no,posist_date,answer_mem_name,ans_no,ans_date,remark,session,assemblys,quesno) values('" + TextBox8.Text + "','" + TextBox9.Text + "','" + Convert.ToDateTime(TextBox10.Text) + "','" + TextBox11.Text + "','" + TextBox12.Text + "','" + Convert.ToDateTime(TextBox13.Text) + "','" + TextBox14.Text + "','" + Session["session"].ToString() + "','" + Session["sadan"] + "'," + Convert.ToInt32(Session["quesno"].ToString()) + ")"); Response.Redirect("Dashboard.aspx"); } else { if (getCheckBoxCount(CheckBoxList2) > 0) { for (int i = 0; i < CheckBoxList2.Items.Count; i++) { if (CheckBoxList2.Items[i].Selected) { SqlDataReader r1 = DataConnection.selectQuery("select memeberid from member where member_name=N'" + CheckBoxList2.Items[i].Text.Trim() + "'"); if (r1.HasRows) { while (r1.Read()) { memberno = r1.GetInt32(0).ToString(); } } r1.Close(); DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')"); } } } if (getCheckBoxCount(CheckBoxList3) > 0) { for (int i = 0; i < CheckBoxList3.Items.Count; i++) { if (CheckBoxList3.Items[i].Selected) { SqlDataReader r = DataConnection.selectQuery("select memeberid from member where location=N'" + CheckBoxList3.Items[i].Text.Trim() + "'"); if (r.HasRows) { while (r.Read()) { memberno = r.GetInt32(0).ToString(); } } r.Close(); DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')"); } } } if (getCheckBoxCount(CheckBoxList4) > 0) { for (int i = 0; i < CheckBoxList4.Items.Count; i++) { if (CheckBoxList4.Items[i].Selected) { SqlDataReader re = DataConnection.selectQuery("select memeberid from member where location=N'" + CheckBoxList4.Items[i].Text.Trim() + "'"); if (re.HasRows) { while (re.Read()) { memberno = re.GetInt32(0).ToString(); } re.Close(); DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')"); } } } } if (getCheckBoxCount(CheckBoxList5) > 0) { for (int i = 0; i < CheckBoxList5.Items.Count; i++) { if (CheckBoxList5.Items[i].Selected) { SqlDataReader re2 = DataConnection.selectQuery("select memeberid from member where location=N'" + CheckBoxList5.Items[i].Text.Trim() + "'"); if (re2.HasRows) { while (re2.Read()) { memberno = re2.GetInt32(0).ToString(); } re2.Close(); DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')"); } } } } if (getCheckBoxCount(CheckBoxList6) > 0) { for (int i = 0; i < CheckBoxList6.Items.Count; i++) { if (CheckBoxList6.Items[i].Selected) { SqlDataReader re3 = DataConnection.selectQuery("select memeberid from member where location=N'" + CheckBoxList6.Items[i].Text.Trim() + "'"); if (re3.HasRows) { while (re3.Read()) { memberno = re3.GetInt32(0).ToString(); } re3.Close(); DataConnection.insertQuery("insert into message(QNO,RCV,Sender,Assemblys,Session) values(N'" + Session["quesno"].ToString() + "',N'" + memberno + "',N'" + Session["RCV"].ToString() + "',N'" + Session["assembly"].ToString() + "',N'" + Session["Session"].ToString() + "')"); } } } } if (getCheckBoxCount(CheckBoxList2) < 0) { message = "Select Atleast Section "; ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('" + message + "');", true); return; } } message = "Data has Stored Successfully"; ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert('" + message + "');", true); Response.Redirect("Dashboard.aspx"); }
protected void Page_Load(object sender, EventArgs e) { List <string> cities = new List <string>(); cities.Add("Gilgit"); cities.Add("Chitral"); cities.Add("Dasu"); cities.Add("Dir"); cities.Add("Malakand"); cities.Add("Noshera"); cities.Add("Mansehra"); cities.Add("Hassan Abdal"); cities.Add("Peshawar"); cities.Add("Attock"); cities.Add("Kohat"); cities.Add("Islamabad"); cities.Add("Murree"); cities.Add("Rawat"); cities.Add("Balkasar"); cities.Add("Chakwal"); cities.Add("Mianwali"); cities.Add("Bhera"); cities.Add("Sargoda"); cities.Add("Pindi Bhattian"); cities.Add("Jhang"); cities.Add("Faisalabad"); cities.Add("Lahore"); cities.Add("Dina"); cities.Add("Gujranwala"); cities.Add("Multan"); cities.Add("DG Khan"); cities.Add("Bahwalpur"); cities.Add("Sukkur"); cities.Add("Rajanpur"); cities.Add("Loralai"); cities.Add("Jacobabad"); cities.Add("Quetta"); cities.Add("Khuzdar"); cities.Add("Karachi"); cities.Add("Lasbela"); cities.Add("Gwadar"); cities.Add("Awaran"); cities.Add("Turbat"); if (!IsPostBack) { CheckBoxList1.DataSource = cities; CheckBoxList2.DataSource = cities; CheckBoxList3.DataSource = cities; CheckBoxList1.DataBind(); CheckBoxList2.DataBind(); CheckBoxList3.DataBind(); } GridView1.DataSource = ExcelToDS().Tables[0]; GridView1.DataBind(); loadData(); int[,] prep2 = new int[39, 39]; int[,] D1 = resetMatrix(mygraph.vedges); for (int i = 0; i < 39; i++) { for (int j = 0; j < 39; j++) { prep2[i, j] = D1[i, j]; } } // int[,] prevD = resetMatrix2(mygraph.vedges); int [,] Dp = Floyd(D1, 39); //========================================================================// Prims obj = new Prims(); List <totaledgs> newlist = obj.primMST(mygraph.vedges); ListBox7.DataSource = newlist; ListBox8.DataSource = newlist; ListBox9.DataSource = newlist; Label2.Text = newlist[1].Weight.ToString(); ListBox7.DataTextField = "src"; ListBox7.DataBind(); ListBox8.DataTextField = "dst"; ListBox8.DataBind(); ListBox9.DataTextField = "weight"; ListBox9.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { Label13.Text = "555555"; Label7.Text = (Session["enrl"]).ToString(); Label8.Text = (Session["stdname"]).ToString(); Label10.Text = (Session["class"]).ToString(); Label11.Text = (Session["sec"]).ToString(); Label9.Text = (Session["fathname"]).ToString(); OleDbConnection con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\\Schooldb.accdb;Persist Security Info=True"); OleDbCommand cmdd = new OleDbCommand(); cmdd.Connection = con; con.Open(); //String OleDbSelectQuery = "SELECT * FROM feedata WHERE enrollno = " + Convert.ToString(Label22.Text); String senrl = (Session["enrl"]).ToString(); String OleDbSelectQuery = "SELECT * FROM Fee_record WHERE enroll_no = '" + senrl + "' "; OleDbCommand cmd = new OleDbCommand(OleDbSelectQuery, con); // Label6.Text = Label22.Text; OleDbDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { if (dr["2019april"].ToString() == "1") { CheckBoxList1.Items[0].Selected = true; CheckBoxList1.Items[0].Enabled = false; CheckBoxList1.DataBind(); } if (dr["2019may"].ToString() == "1") { CheckBoxList1.Items[1].Selected = true; CheckBoxList1.Items[1].Enabled = false; CheckBoxList1.DataBind(); } if (dr["2019june"].ToString() == "1") { CheckBoxList1.Items[2].Selected = true; CheckBoxList1.Items[2].Enabled = false; CheckBoxList1.DataBind(); } if (dr["2019july"].ToString() == "1") { CheckBoxList1.Items[3].Selected = true; CheckBoxList1.Items[3].Enabled = false; CheckBoxList1.DataBind(); } if (dr["2019august"].ToString() == "1") { CheckBoxList1.Items[4].Selected = true; CheckBoxList1.Items[4].Enabled = false; CheckBoxList1.DataBind(); } if (dr["2019september"].ToString() == "1") { CheckBoxList1.Items[5].Selected = true; CheckBoxList1.Items[5].Enabled = false; CheckBoxList1.DataBind(); } if (dr["2019october"].ToString() == "1") { CheckBoxList1.Items[6].Selected = true; CheckBoxList1.Items[6].Enabled = false; CheckBoxList1.DataBind(); } if (dr["2019november"].ToString() == "1") { CheckBoxList1.Items[7].Selected = true; CheckBoxList1.Items[7].Enabled = false; CheckBoxList1.DataBind(); } if (dr["2019december"].ToString() == "1") { CheckBoxList1.Items[8].Selected = true; CheckBoxList1.Items[8].Enabled = false; CheckBoxList1.DataBind(); } if (dr["2020january"].ToString() == "1") { CheckBoxList1.Items[9].Selected = true; CheckBoxList1.Items[9].Enabled = false; CheckBoxList1.DataBind(); } if (dr["2020february"].ToString() == "1") { CheckBoxList1.Items[10].Selected = true; CheckBoxList1.Items[10].Enabled = false; CheckBoxList1.DataBind(); } if (dr["2020march"].ToString() == "1") { CheckBoxList1.Items[11].Selected = true; CheckBoxList1.Items[11].Enabled = false; CheckBoxList1.DataBind(); } if (dr["2019exam1"].ToString() == "1") { CheckBoxList2.Items[0].Selected = true; CheckBoxList2.Items[0].Enabled = false; CheckBoxList2.DataBind(); } if (dr["2019exam2"].ToString() == "1") { CheckBoxList2.Items[1].Selected = true; CheckBoxList2.Items[1].Enabled = false; CheckBoxList2.DataBind(); } if (dr["2019exam3"].ToString() == "1") { CheckBoxList2.Items[2].Selected = true; CheckBoxList2.Items[2].Enabled = false; CheckBoxList2.DataBind(); } } else { Label1.Text = "Not Connected"; } con.Close(); }