protected void Page_Load(object sender, EventArgs e) { btnAdd.Attributes.Add("onclick", "clcontent();"); changeLinks(); getCompanyName(); if (!IsPostBack) { dropTopAisle.bindTopAisleCheckbox(chkTopAisles);//Bind Checkbox into dropdown lblMsg.Text = ""; } }
protected void Page_Load(object sender, EventArgs e) { btnUpdate.Attributes.Add("onclick", "clcontent();"); changeLinks(); getCompanyName(); try { DataSet dsAislesList = new DataSet(); DataSet dsTopAisleMappingList = new DataSet(); changeLinks(); btnUpdate.Attributes.Add("onclick", "clcontent();"); if (!IsPostBack) { lblMsg.Text = ""; dropTopAisle.bindTopAisleCheckbox(chkTopAisles);//Bind Checkbox into dropdown int aislesId = Convert.ToInt32(Request.QueryString["aislesId"]); dsAislesList = dbEditInfo.SelectAislesDeatils(aislesId); if (dsAislesList.Tables.Count > 0) { if (dsAislesList != null && dsAislesList.Tables.Count > 0 && dsAislesList.Tables[0].Rows.Count > 0) { txtAisleName.Text = Convert.ToString(dsAislesList.Tables[0].Rows[0]["aisle_name"]); if (Convert.ToString(dsAislesList.Tables[0].Rows[0]["aisle_show"]) == "0") { rdShow.SelectedValue = "0"; } else { rdShow.SelectedValue = "1"; } dsTopAisleMappingList = dbEditInfo.SelectTopAisleMappingDeatils(aislesId); if (dsTopAisleMappingList.Tables.Count > 0) { if (dsTopAisleMappingList != null && dsTopAisleMappingList.Tables.Count > 0 && dsTopAisleMappingList.Tables[0].Rows.Count > 0) { for (int intShelf = 0; intShelf < chkTopAisles.Items.Count; intShelf++) { for (int intShelfMapping = 0; intShelfMapping < dsTopAisleMappingList.Tables[0].Rows.Count; intShelfMapping++) { if (Convert.ToInt32(chkTopAisles.Items[intShelf].Value) == Convert.ToInt32(dsTopAisleMappingList.Tables[0].Rows[intShelfMapping]["aisletop_id"])) { chkTopAisles.Items[intShelf].Selected = true; } } } } } } } lblMsg.Text = ""; } dbEditInfo.dispose(); } catch (Exception ex) { Response.Write(ex.Message); } }