Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     btnAdd.Attributes.Add("onclick", "clcontent();");
     changeLinks();
     getCompanyName();
     if (!IsPostBack)
     {
         dropAsile.bindAsileCheckbox(chkAisles);//Bind client name  into dropdown
         lblMsg.Text = "";
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            btnUpdate.Attributes.Add("onclick", "clcontent();");
            changeLinks();
            getCompanyName();
            try
            {
                if (!IsPostBack)
                {
                    DataSet dsShelfList        = new DataSet();
                    DataSet dsShelfMappingList = new DataSet();
                    dropAsile.bindAsileCheckbox(chkAisles);//Bind Checkbox into dropdown
                    int shelfId = Convert.ToInt32(Request.QueryString["shelfId"]);
                    dsShelfList = dbEditInfo.SelectShelfDeatils(shelfId);
                    if (dsShelfList.Tables.Count > 0)
                    {
                        if (dsShelfList != null && dsShelfList.Tables.Count > 0 && dsShelfList.Tables[0].Rows.Count > 0)
                        {
                            txtShelfName.Text = Convert.ToString(dsShelfList.Tables[0].Rows[0]["shelf_name"]);
                            txtMapping.Text   = Convert.ToString(dsShelfList.Tables[0].Rows[0]["shelf_position"]);
                            if (Convert.ToString(dsShelfList.Tables[0].Rows[0]["shelf_popular"]) == "1")
                            {
                                chkPopular.Checked = true;
                            }

                            if (Convert.ToString(dsShelfList.Tables[0].Rows[0]["shelf_show"]) == "0")
                            {
                                rdShow.SelectedValue = "0";
                            }
                            else
                            {
                                rdShow.SelectedValue = "1";
                            }

                            dsShelfMappingList = dbEditInfo.SelectShelfMappingDeatils(shelfId);
                            if (dsShelfMappingList.Tables.Count > 0)
                            {
                                if (dsShelfMappingList != null && dsShelfMappingList.Tables.Count > 0 && dsShelfMappingList.Tables[0].Rows.Count > 0)
                                {
                                    for (int intShelf = 0; intShelf < chkAisles.Items.Count; intShelf++)
                                    {
                                        for (int intShelfMapping = 0; intShelfMapping < dsShelfMappingList.Tables[0].Rows.Count; intShelfMapping++)
                                        {
                                            if (Convert.ToInt32(chkAisles.Items[intShelf].Value) == Convert.ToInt32(dsShelfMappingList.Tables[0].Rows[intShelfMapping]["aisle_id"]))
                                            {
                                                chkAisles.Items[intShelf].Selected = true;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }

                    lblMsg.Text = "";
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }