private void WarehouseChanged() { this.cboShed.Items.Clear(); // load Stack based on the selected index. if (this.cboWarehouse.SelectedValue == "") { return; } else { Guid WarehouseId = new Guid(); ShedBLL objShed = new ShedBLL(); try { WarehouseId = new Guid(this.cboWarehouse.SelectedValue.ToString()); } catch { this.lblmsg.Text = "Please select warehouse and try again"; return; } List <ShedBLL> list = new List <ShedBLL>(); list = objShed.GetActiveShedByWarehouseId(WarehouseId); this.cboShed.Items.Add(new ListItem("Please Select Shed", "")); if (list.Count > 0) { foreach (ShedBLL oshed in list) { this.cboShed.Items.Add(new ListItem(oshed.ShedNumber, oshed.Id.ToString())); } } } }
protected void cboShed_SelectedIndexChanged(object sender, EventArgs e) { if (String.IsNullOrEmpty(this.cboShed.SelectedValue.ToString()) == false) { Guid Id = new Guid(this.cboShed.SelectedValue.ToString()); ShedBLL objShed = new ShedBLL(); objShed = objShed.GetActiveShedById(Id); objShed.NoStack = 150; this.cboStackNumber.Items.Clear(); this.cboStackNumber.Items.Add(new ListItem("Please Select physical Stack No", "")); if (objShed != null) { for (int i = 1; i < objShed.NoStack; i++) { this.cboStackNumber.Items.Add(new ListItem(i.ToString(), i.ToString())); } } } else { this.lblmsg.Text = "Please select Shed"; return; } }
private void BindUnloading() { try { Guid UnloadingId = new Guid(Request.QueryString["Id"].ToString()); this.hfUnloadingId.Value = UnloadingId.ToString(); UnloadingBLL obj = new UnloadingBLL(); CommodityGradeBLL objCommodityGrade = new CommodityGradeBLL(); obj.Id = UnloadingId; obj = obj.GetById(); if (obj != null) { this.lblGradingCode.Text = obj.GradingCode.ToString(); string CommodityGradeName = CommodityGradeBLL.GetCommodityGradeNameById(obj.CommodityGradeId); this.lblCommodityGrade.Text = CommodityGradeName; this.txtNumberOfBags.Text = obj.TotalNumberOfBags.ToString(); this.txtDateDeposited.Text = obj.DateDeposited.ToShortDateString(); this.cboStatus.SelectedValue = ((int)obj.Status).ToString(); ViewState["UnloadingCommGradeId"] = obj.CommodityGradeId; ViewState["totBagCount"] = obj.TotalNumberOfBags.ToString(); // Get Grading Id GradingResultBLL objGradingResult = new GradingResultBLL(); objGradingResult = objGradingResult.GetGradingResultById(obj.GradingResultId); if (objGradingResult != null) { GradingBLL objGrading = new GradingBLL(); objGrading = objGrading.GetById(objGradingResult.GradingId); if (objGrading != null) { SamplingResultBLL objSamplingResult = new SamplingResultBLL(); objSamplingResult = objSamplingResult.GetSamplingResultById(objGrading.SamplingResultId); if (objSamplingResult != null) { ViewState["SamplingNoBags"] = objSamplingResult.NumberOfBags; } else { this.lblmsg.Text = "An error has occured please try again.If the error persists contact the administrator"; return; } } else { this.lblmsg.Text = "An error has occured please try agin.If the error persists contact the administrator"; return; } } } //TODO :Remove the ff // this.cboStackNo.Items.Add(new ListItem("Stack No 1", "eaf7ebcc-f39a-4c7d-b855-1e5d5578dbcb")); //TODO Remove Comment Guid warehouseId = UserBLL.GetCurrentWarehouse(); // Loading shedby warehouse. ShedBLL shed = new ShedBLL(); List <ShedBLL> shedlist = new List <ShedBLL>(); shedlist = shed.GetActiveShedByWarehouseId(warehouseId); cboShed.Items.Add(new ListItem("Please select Shed", "")); if (shedlist.Count > 0) { foreach (ShedBLL o in shedlist) { cboShed.Items.Add(new ListItem(o.ShedNumber, o.Id.ToString())); } } else { this.btnAdd.Enabled = false; } GRNBLL objGRN = new GRNBLL(); string strE = " UnLoadingId='" + UnloadingId.ToString() + "' "; if (objGRN.IsEditableGRN(strE) == false) { this.btnAdd.Enabled = false; this.btnSave.Enabled = false; this.lblmsg.Text = "You can't edit this information as GRN has already been created using this Unloading Information."; } } catch (Exception ex) { throw ex; } }
private void LoadPage() { List <StackUnloadedBLL> list = new List <StackUnloadedBLL>(); ViewState["StackUnloaded"] = list; // load controls.' GradingResultBLL obj = new GradingResultBLL(); //TODO : change by warhouse id. Guid warehouseId = UserBLL.GetCurrentWarehouse(); //Loading Grading Results pending Unloading. this.cboGradingCode.Items.Clear(); List <GradingResultBLL> grdinglist = new List <GradingResultBLL>(); try { grdinglist = obj.GetAcceptedresultsPendingUnloading(warehouseId); } catch (Exception ex) { this.lblmsg.Text = ex.Message; } if (grdinglist != null) { if (grdinglist.Count > 0) { this.cboGradingCode.Items.Add(new ListItem("Please Select Code", "")); this.cboGradingCode.AppendDataBoundItems = true; this.cboGradingCode.DataSource = grdinglist; this.cboGradingCode.DataTextField = "GradingCode"; this.cboGradingCode.DataValueField = "Id"; this.cboGradingCode.DataBind(); this.cboGradingCode.AppendDataBoundItems = false; } else { this.lblmsg.Text = "There are no pending results awaiting Unloading."; } } else { this.lblmsg.Text = "There are no pending results awaiting Unloading."; } //TODO Remove Comment // Loading shedby warehouse. cboShed.Items.Clear(); ShedBLL shed = new ShedBLL(); List <ShedBLL> shedlist = new List <ShedBLL>(); shedlist = shed.GetActiveShedByWarehouseId(warehouseId); cboShed.Items.Add(new ListItem("Select Shed", "")); cboShed.AppendDataBoundItems = true; if (shedlist.Count > 0) { foreach (ShedBLL s in shedlist) { cboShed.Items.Add(new ListItem(s.ShedNumber, s.Id.ToString())); } cboShed.AppendDataBoundItems = false; this.btnSave.Enabled = true; } else { this.btnSave.Enabled = false; } }