protected void cboShed_SelectedIndexChanged(object sender, EventArgs e) { //TODO :Remove the ff ////populate Stack from the list. this.cboStackNo.Items.Add(new ListItem("Please select Stack", "")); this.cboStackNo.AppendDataBoundItems = true; List <StackBLL> list = new List <StackBLL>(); StackBLL obj = new StackBLL(); list = obj.GetActiveStackbyShedId(new Guid(this.cboShed.SelectedValue.ToString())); if (list.Count < 1) { this.lblMsg2.Text = "Ther are no stacks in this shed."; this.btnSave.Enabled = false; } else { this.cboStackNo.DataSource = list; this.cboStackNo.DataTextField = "StackNumber"; this.cboStackNo.DataValueField = "Id"; this.cboStackNo.DataBind(); } }
protected void cboShed_SelectedIndexChanged(object sender, EventArgs e) { //TODO :Remove the ff if (this.cboShed.SelectedValue.ToString() == "") { this.lblmsg.Text = "Please Selected Shed"; return; } ////populate Stack from the list. this.cboStackNo.Items.Add(new ListItem("Please select Stack", "")); this.cboStackNo.AppendDataBoundItems = true; List <StackBLL> list = new List <StackBLL>(); StackBLL obj = new StackBLL(); Guid CG = Guid.Empty; if (ViewState["UnloadingCommGradeId"] != null) { CG = new Guid(ViewState["UnloadingCommGradeId"].ToString()); } int productionYear = -1; if (ViewState["productionYear"] != null) { productionYear = int.Parse(ViewState["productionYear"].ToString()); } list = obj.GetActiveStackbyShedId(new Guid(this.cboShed.SelectedValue.ToString()), CG, productionYear); if (list.Count < 1) { this.lblMsg2.Text = "Ther are no stacks in this shed."; this.btnSave.Enabled = false; } else { foreach (StackBLL s in list) { this.cboStackNo.Items.Add(new ListItem(s.StackNumber, s.Id.ToString())); } } }