private void LoadGRNInformation(Guid GRN) { LoadGRNType(); GRNBLL obj = new GRNBLL(); obj = obj.GetbyGRN_Number(GRN); if (obj != null) { if (obj.GRN_Number != "") { this.hfGRNID.Value = obj.Id.ToString(); this.lblGRN.Text = obj.GRN_Number; this.lblTrackingNo.Text = obj.TrackingNo; this.lblProductionYear.Text = obj.ProductionYear.ToString(); this.lblCode.Text = obj.GradingCode; this.lblDateDeposited.Text = obj.DateDeposited.ToShortDateString(); this.lblBags.Text = obj.TotalNumberOfBags.ToString(); this.lblGrossWeight.Text = obj.GrossWeight.ToString(); this.lblNetWeight.Text = obj.NetWeight.ToString(); this.lblOriginalQuantity.Text = obj.OriginalQuantity.ToString(); this.lblCurrentQuantity.Text = obj.CurrentQuantity.ToString(); lblGRNCreatedDate.Text = obj.GRNCreatedDate.ToShortDateString(); cmpSampGen.ValueToCompare = obj.CreatedTimestamp.ToShortDateString(); this.lblCommodityGrade.Text = CommodityGradeBLL.GetCommodityGradeNameById(obj.CommodityGradeId); ClientBLL objClient = new ClientBLL(); //objClient = ClientBLL.GetClinet(obj.ClientId); //this.lblClinet.Text = objClient.ClientName; LoadSampling(obj.GradingId); LoadGrading(obj.GradingId); LoadDepositeRequest(obj.CommodityRecivingId); this.cboGRNType.SelectedValue = obj.GRNTypeId.ToString(); BagTypeBLL objBag = new BagTypeBLL(); objBag.GetBagTypeById(obj.BagTypeId); this.lblBagType.Text = objBag.BagTypeName; this.cboStatus.SelectedValue = obj.Status.ToString(); if (obj.ClientAccepted == true) { this.cboClientAccpted.SelectedValue = "1"; } else { this.cboClientAccpted.SelectedValue = "2"; } this.txtClientAcceptedTimeStamp.Text = obj.ClientAcceptedTimeStamp.ToString(); this.hfStatus.Value = obj.Status.ToString(); if (this.cboStatus.SelectedValue == "4" && this.cboStatus.SelectedValue == "5" && this.cboStatus.SelectedValue == "6") { this.cboStatus.Enabled = false; this.cboClientAccpted.Enabled = false; this.btnAdd.Enabled = false; this.txtClientAcceptedTimeStamp.Enabled = false; this.txtClientAcceptedTimeStamp.Visible = false; this.cboClientAccpted.Visible = false; this.btnAdd.Visible = false; this.lblmsg.Text = "The Client can not accpet or reject this GRN as the status of the GRN is not new or approved."; } } } }
private bool RemainingWeight() { GINModel ginModel = (GINModel)Session["GINMODEL"]; double remainingBalance; if (Session["remainingBalance"] == null) { if (Session["EditMode"] == null) { Session["remainingBalance"] = ginModel.PickupNoticesList.Sum(s => s.RemainingWeight); } else { Session["remainingBalance"] = ginModel.PickupNoticesList.Sum(s => s.RemainingWeight); } } Guid commodityGradeId = ((GINModel)Session["GINMODEL"]).PickupNoticesList[0].CommodityGradeID; List <BagTypeBLL> bagTypeList = BagTypeBLL.GetCommodityGradeBagTypes(commodityGradeId); double netWeight = 0; if (CurrentGINModel.PickupNoticesList[0].ConsignmentType != "Bonded Yard") { netWeight = double.Parse(txtGrossWeight.Text) - double.Parse(txtTruckWeight.Text) - double.Parse(txtNoOfBags.Text) * double.Parse(HiddenFieldTare.Value) + double.Parse(drpAdjustmentType.SelectedValue) * double.Parse(txtWeightAdjustment.Text); } else if (CurrentGINModel.PickupNoticesList[0].ConsignmentType == "Bonded Yard") { HiddenFieldTare.Value = "0.93"; netWeight = double.Parse(txtNetWeight.Text); } Session["netWeight"] = netWeight; remainingBalance = Math.Round(double.Parse(Session["remainingBalance"].ToString()), 2) - Math.Round(netWeight, 2); if (CurrentGINModel.PickupNoticesList[0].Commodity != new Guid("71604275-df23-4449-9dae-36501b14cc3b")) { if (remainingBalance < 0) { Messages.SetMessage("Requested Net Weight is greater than total available PUN weight. Please check the Loading Ticket.", WarehouseApplication.Messages.MessageType.Warning); return(false); } } if (remainingBalance >= 0) { Session["RemainingMsg"] = "Selected PUNs have Total Remaining weights to be issued of = " + Convert.ToDouble(remainingBalance) + " Kg"; } Session["remainingBalance"] = remainingBalance; return(true); }
private void LoadGRNInformation(Guid GRNId) { LoadGRNType(); GRNBLL obj = new GRNBLL(); obj = obj.GetbyGRN_Number(GRNId); if (obj != null) { if (obj.GRN_Number != "") { this.hfGRNId.Value = obj.Id.ToString(); this.lblGRN.Text = obj.GRN_Number; this.lblTrackingNo.Text = obj.TrackingNo; //this.lblProductionYear.Text = obj.ProductionYear.ToString(); this.lblCode.Text = obj.GradingCode; this.lblDateDeposited.Text = obj.DateDeposited.ToShortDateString(); this.lblBags.Text = obj.TotalNumberOfBags.ToString(); this.lblGrossWeight.Text = obj.GrossWeight.ToString(); this.lblNetWeight.Text = obj.NetWeight.ToString(); this.lblOriginalQuantity.Text = obj.OriginalQuantity.ToString(); this.lblCurrentQuantity.Text = obj.CurrentQuantity.ToString(); this.lblCommodityGrade.Text = CommodityGradeBLL.GetCommodityGradeNameById(obj.CommodityGradeId); ClientBLL objClient = new ClientBLL(); LoadSampling(obj.GradingId); LoadGrading(obj.GradingId); LoadDepositeRequest(obj.CommodityRecivingId); GetGRNServices(GRNId); this.cboGRNType.SelectedValue = obj.GRNTypeId.ToString(); BagTypeBLL objBag = new BagTypeBLL(); objBag.GetBagTypeById(obj.BagTypeId); this.lblBagType.Text = objBag.BagTypeName; this.hfStatus.Value = obj.Status.ToString(); if (obj.ClientAcceptedTimeStamp != null) { this.txtClientAcceptedTimeStamp.Text = obj.ClientAcceptedTimeStamp.ToShortDateString(); } this.chkClientAccepted.Checked = obj.ClientAccepted; if (this.chkClientAccepted.Checked != true) { //TOdo- GRN Statas. } if (this.cboStatus.SelectedValue == "6" || this.cboStatus.SelectedValue == "3") { this.cboStatus.Enabled = false; this.btnAdd.Enabled = false; } } } }
private void LoadUnloading(Guid commDepositeId) { UnloadingBLL objUnloading = new UnloadingBLL(); objUnloading = objUnloading.GetApprovedUnloadingByCommodityDepositeId(commDepositeId); if (objUnloading != null) { this.lblBags.Text = objUnloading.TotalNumberOfBags.ToString(); this.lblDateDeposited.Text = objUnloading.DateDeposited.ToShortDateString(); this.hfBagTypeId.Value = objUnloading.BagTypeId.ToString(); this.hfUnloadingId.Value = objUnloading.Id.ToString(); BagTypeBLL objBagType = new BagTypeBLL(); //this.lblBagType.Text = objUnloading. } }
protected void gvStack_SelectedIndexChanged(object sender, EventArgs e) { GINModel gm = (GINModel)Session["GINMODEL"]; Guid stackLoadedId = new Guid(gvStack.SelectedDataKey["StackID"].ToString()); if (gm.StackInfosList.Count != 0) { StackTransactionModel stm = gm.StackInfosList.First(s => s.StackID == stackLoadedId); Guid commodityGradeId = ((GINModel)Session["GINMODEL"]).PickupNoticesList[0].CommodityGradeID; List <BagTypeBLL> bagTypeList = BagTypeBLL.GetCommodityGradeBagTypes(commodityGradeId); if (Session["remainingBalance"] == null) { Session["remainingBalance"] = gm.PickupNoticesList.Sum(s => s.RemainingWeight);//+ (stm.GrossWeight - stm.TruckWeight - bagTypeList[0].Tare * stm.NoOfBags); } else { Session["remainingBalance"] = (double)Session["remainingBalance"] + (stm.GrossWeight - stm.TruckWeight - stm.Tare * stm.NoOfBags); } txtScaleTicketNo.Text = stm.ScaleTicketNumber; txtDateWeighted.Text = stm.DateTimeWeighed.ToShortDateString(); txtDateWeightedTime.Text = stm.DateTimeWeighed.ToShortTimeString(); txtTruckWeight.Text = stm.TruckWeight.ToString(); txtGrossWeight.Text = stm.GrossWeight.ToString(); txtNoOfBags.Text = stm.NoOfBags.ToString(); txtLoadingTicket.Text = stm.LoadUnloadTicketNO; PopulateStack(new Guid(drpInventoryCoordinatorLoad.SelectedValue)); drpStackNo.SelectedValue = stm.StackID.ToString(); //stm.StackID = new Guid(drpStackNo.SelectedValue); HiddenFieldTare.Value = stm.Tare.ToString(); drpWeigherSupervisor.SelectedValue = stm.WeigherID.ToString();// drpWeigherSupervisor.Items.Cast<ListItem>().First(s => new Guid(s.Value) == stm.WeigherID).Value; gm.StackInfosList.Remove(stm); gm.RemoveStack(stm.StackID); btnAddStack.Visible = true; FillWBServiceProvider(drpWBServiceProvider); drpWBServiceProvider.SelectedValue = stm.WBServiceProviderID.ToString(); //drp FillCarType(drpTruckType); drpTruckType.SelectedValue = stm.TruckTypeID.ToString(); // gvStack.DataSource = gm.StackInfosList; // gvStack.DataBind(); } else { Messages.SetMessage("The stack is already selected or Empty Stack.", WarehouseApplication.Messages.MessageType.Warning); } }
private void LoadUnloading(Guid GradingId) { UnloadingBLL objUnloading = new UnloadingBLL(); objUnloading = objUnloading.GetApprovedUnloadingByGradingId(GradingId); if (objUnloading != null) { this.lblBags.Text = objUnloading.TotalNumberOfBags.ToString(); this.lblDateDeposited.Text = objUnloading.DateDeposited.ToShortDateString(); this.hfBagTypeId.Value = objUnloading.BagTypeId.ToString(); this.hfUnloadingId.Value = objUnloading.Id.ToString(); //Get Bag Info BagTypeBLL objBagType = new BagTypeBLL(); if (string.IsNullOrEmpty(objUnloading.BagTypeId.ToString()) != true) { objBagType.GetBagTypeById(objUnloading.BagTypeId); if (objBagType != null) { if (objBagType.BagTypeName != "") { this.lblBagType.Text = objBagType.BagTypeName.ToString(); } else { this.lblmsg.Text = "Unable To get Bag Type"; return; } } else { this.lblmsg.Text = "Unable To get Bag Type"; return; } } } }
private void rptGRN_ReportStart(object sender, EventArgs e) { if (HttpContext.Current.Session["GRNIDPrint"] == null) { throw new Exception("Session expired"); } Guid GRNId = Guid.Empty; GRNId = new Guid(HttpContext.Current.Session["GRNIDPrint"].ToString()); Guid GradingId = Guid.Empty; GRNBLL objGRN = new GRNBLL(); objGRN = objGRN.GetbyGRN_Number(GRNId); GradingId = objGRN.GradingId; this.lblGRN_No.Text = objGRN.GRN_Number; this.lblClient.Text = ClientBLL.GetClinetNameById(objGRN.ClientId); this.lblCommodityGrade.Text = CommodityGradeBLL.GetCommodityGradeNameById(objGRN.CommodityGradeId); this.lblWarehouse.Text = WarehouseBLL.GetWarehouseNameById(objGRN.WarehouseId); this.lblOriginalQuantity.Text = objGRN.OriginalQuantity.ToString(); this.lblNetWeight.Text = objGRN.NetWeight.ToString(); this.lblDateDeposited.Text = objGRN.DateDeposited.ToShortDateString(); this.lblTimeDeposited.Text = objGRN.DateDeposited.ToShortTimeString(); this.lblNoBags.Text = objGRN.TotalNumberOfBags.ToString(); //Bag Type BagTypeBLL objBt = new BagTypeBLL(); objBt.GetBagTypeById(objGRN.BagTypeId); lblBagType.Text = objBt.BagTypeName; //Driver Information List <DriverInformationBLL> list = null; DriverInformationBLL objDI = new DriverInformationBLL(); list = objDI.GetActiveDriverInformationByReceivigRequestId(objGRN.CommodityRecivingId); if (list != null) { string driverName = ""; string plateNo = ""; string driverLicense = ""; string licensceIssuedPlace = ""; foreach (DriverInformationBLL o in list) { if (driverName == "") { driverName = o.DriverName; } else { driverName += "," + o.DriverName; } if (plateNo == "") { if (String.IsNullOrEmpty(o.TrailerPlateNumber) != true) { plateNo = o.PlateNumber + "-" + o.TrailerPlateNumber; } else { plateNo = o.PlateNumber; } } else { if (String.IsNullOrEmpty(o.TrailerPlateNumber) != true) { plateNo += " , " + o.PlateNumber + "-" + o.TrailerPlateNumber; } else { plateNo += " , " + o.PlateNumber; } } if (driverLicense == "") { driverLicense = o.LicenseNumber; } else { driverLicense += " , " + o.LicenseNumber; } if (licensceIssuedPlace == "") { licensceIssuedPlace = o.LicenseIssuedPlace; } else { licensceIssuedPlace += " , " + o.LicenseIssuedPlace; } } this.lblDriverName.Text = driverName; this.lblPlateNo.Text = plateNo; this.lblDriverLicense.Text = driverLicense; this.lblPlaceIssued.Text = licensceIssuedPlace; } // Scaling ScalingBLL objScaling = new ScalingBLL(); objScaling = objScaling.GetById(objGRN.ScalingId); if (objScaling != null) { if (objScaling.WeigherId != null) { try { this.lblWeigherName.Text = UserRightBLL.GetUserNameByUserId(objScaling.WeigherId); } catch { } } } // Sampler SamplerBLL objSampler = new SamplerBLL(); objSampler = objSampler.GetActiveSamplingSupBySamplingId(objGRN.SamplingTicketId); if (objSampler != null) { this.lblSampler.Text = UserRightBLL.GetUserNameByUserId(objSampler.SamplerId); } //Graders GradingByBLL objGrader = new GradingByBLL(); this.lblGrader.Text = objGrader.GetSupGraderNameByGradingId(objGRN.GradingId); if (objGRN.ApprovedBy != null) { try { this.lblApprovedBy.Text = UserRightBLL.GetUserNameByUserId(objGRN.ApprovedBy); } catch { } } if (objGRN.ApprovedTimeStamp != null) { this.lblDateAproved.Text = objGRN.ApprovedTimeStamp.ToShortDateString(); } rpt = new rptGrading(GradingId); rptGS = new rptGRNService(GRNId); this.txtDateGenerated.Text = DateTime.Now.ToString(); ScalingBLL objSacling = new ScalingBLL(); objSacling = objSacling.GetById(objGRN.ScalingId); if (objSacling != null) { this.lblScaleTicketNo.Text = objSacling.ScaleTicketNumber; } this.subReport1.Report = rpt; this.subReport2.Report = this.rptGS; }
private void selectedGradechanged(Guid Id) { GradingResultBLL obj = new GradingResultBLL(); obj = obj.GetGradingResultById(Id); this.cboGradingCode.Items.Add(new ListItem(obj.GradingCode.ToString(), obj.GradingCode.ToString())); this.cboGradingCode.SelectedValue = obj.GradingCode.ToString(); this. hfTrackingNo.Value = obj.TrackingNo; if (obj != null) { this.hfRecivingRequestId.Value = obj.CommodityDepositRequestId.ToString(); CommodityGradeBLL objCG = new CommodityGradeBLL(); string CGName; CGName = CommodityGradeBLL.GetCommodityGradeNameById(obj.CommodityGradeId); ViewState["UnloadingCommGradeId"] = obj.CommodityGradeId; this.lblCommodityGrade.Text = CGName; lblCADateTime.Text = ((DateTime)obj.ClientAcceptanceTimeStamp).ToShortDateString(); //try //{ // cmpSampGen.ValueToCompare = ((DateTime)obj.ClientAcceptanceTimeStamp).ToShortDateString(); //} //catch //{ // cmpSampGen.ValueToCompare = ((DateTime.Now).AddDays(-100)).ToShortDateString(); //} // Get Grading Id GradingBLL objGrading = new GradingBLL(); objGrading = objGrading.GetById(obj.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 agin.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; } } else { this.lblmsg.Text = "please select grading code and try again."; return; } //Load Commodity Grade Bags List <BagTypeBLL> list = new List <BagTypeBLL>(); BagTypeBLL objBagType = new BagTypeBLL(); list = objBagType.GetCommodityGradeBag(obj.CommodityGradeId); this.cboBagType.Items.Clear(); if (list != null) { if (list.Count > 0) { this.cboBagType.Items.Add(new ListItem("Please Select Bag Type", "")); foreach (BagTypeBLL i in list) { this.cboBagType.Items.Add(new ListItem(i.BagTypeName, i.Id.ToString())); } } } }
//private CachedDictionary<ECXLookUp.CNIDType> nidTypeLookup = new CachedDictionary<ECXLookUp.CNIDType>( // delegate(ECXLookUp.CNIDType nidType) // { // return nidType.Name; // }, // delegate(object key) // { // return null; // }, // delegate() // { // ECXLookUp.ECXLookup ecxLookup = new WarehouseApplication.ECXLookUp.ECXLookup(); // ECXLookUp.CNIDType[] nidTypes = ecxLookup.GetActiveNIDTypes(BLL.Utility.GetWorkinglanguage()); // List<KeyValuePair<object, WarehouseApplication.ECXLookUp.CNIDType>> kvps = new List<KeyValuePair<object, WarehouseApplication.ECXLookUp.CNIDType>>(); // foreach (ECXLookUp.CNIDType nidType in nidTypes) // { // kvps.Add(new KeyValuePair<object, WarehouseApplication.ECXLookUp.CNIDType>(nidType.Id, nidType)); // } // return kvps; // }); //private Dictionary<object, string> shedLookup = new Dictionary<object,string>(); //private Dictionary<object, string> stackLookup = new Dictionary<object,string>(); //private CachedDictionary<BagTypeBLL> bagTypeLookup = new CachedDictionary<BagTypeBLL>( // delegate(BagTypeBLL bagType) // { // return bagType.BagTypeName; // }, // delegate(object key) // { // return BagTypeBLL.GetBagType((Guid)key); // }, // delegate() // { // List<KeyValuePair<object, BagTypeBLL>> kvps = new List<KeyValuePair<object, BagTypeBLL>>(); // foreach (BagTypeBLL bagType in BagTypeBLL.GetAllBagTypes()) // { // kvps.Add(new KeyValuePair<object, BagTypeBLL>(bagType.Id, bagType)); // } // return kvps; // }); //private WarehouseBLL currentWareHouse = new WarehouseBLL() { // Code = "102", // WarehouseId = new Guid("fa0a52e8-9308-4d5e-b323-88ca5ba232ed") //}; #region ILookupSource Members public IDictionary <object, string> GetLookup(string lookupName) { try { Dictionary <object, string> lookup = new Dictionary <object, string>(); switch (lookupName) { case "CommodityGrade": return(new CachedDictionary <CommodityGradeBLL>( delegate(CommodityGradeBLL commodityGrade) { return commodityGrade.GradeName; }, delegate(object key) { return CommodityGradeBLL.GetCommodityGrade((Guid)key); }, delegate() { List <KeyValuePair <object, CommodityGradeBLL> > kvps = new List <KeyValuePair <object, CommodityGradeBLL> >(); foreach (CommodityGradeBLL commodityGrade in CommodityGradeBLL.GetAllCommodityDetail()) { kvps.Add(new KeyValuePair <object, CommodityGradeBLL>(commodityGrade.CommodityGradeId, commodityGrade)); } return kvps; })); case "Client": return(new CachedDictionary <ClientBLL>( clientLookup, delegate(ClientBLL client) { return client.ClientName; }, delegate(object key) { return ClientBLL.GetClinet((Guid)key); })); case "ClientId": return(new CachedDictionary <ClientBLL>( clientLookup, delegate(ClientBLL client) { return client.ClientId; }, delegate(object key) { return ClientBLL.GetClinet((Guid)key); })); case "Warehouse": return(new CachedDictionary <WarehouseBLL>( warehouseLookup, delegate(WarehouseBLL warehouse) { return warehouse.WarehouseName; }, delegate(object key) { return WarehouseBLL.GetById((Guid)key); })); case "WarehouseManager": return(new CachedDictionary <string>( delegate(string warehouseManager) { return warehouseManager; }, delegate(object key) { //return UserRightBLL.GetUsersWithRight("WHPWM").Find(u => u.UserId == (Guid)key).FullName; return UserRightBLL.GetUserNameByUserId((Guid)key); })); case "NIDType": //ICollection<object> keys = nidTypeLookup.Keys; //return nidTypeLookup; List <NIDTypeBLL> nidTypes = NIDTypeBLL.GetAllNIDTypes(); nidTypes.ForEach(nidType => lookup.Add(nidType.Id, nidType.Name)); break; case "VerifyingClerk": //return GetWorkersLookup("VerifyingClerk"); UserRightBLL.GetUsersWithRight("VerifyingClerk").ForEach(user => lookup.Add(user.UserId, user.FullName)); break; case "InventoryController": //return GetWorkersLookup("InventoryController"); UserRightBLL.GetUsersWithRight("InventoryController").ForEach(user => lookup.Add(user.UserId, user.FullName)); break; case "Loader": //return GetWorkersLookup("Loader"); UserRightBLL.GetUsersWithRight("Loader").ForEach(user => lookup.Add(user.UserId, user.FullName)); break; case "Weigher": //return GetWorkersLookup("Weigher"); UserRightBLL.GetUsersWithRight("Weigher").ForEach(user => lookup.Add(user.UserId, user.FullName)); break; case "Sampler": //return GetWorkersLookup("Sampler"); UserRightBLL.GetUsersWithRight("Sampler").ForEach(user => lookup.Add(user.UserId, user.FullName)); break; case "Grader": //return GetWorkersLookup("Grader"); UserRightBLL.GetUsersWithRight("Grader").ForEach(user => lookup.Add(user.UserId, user.FullName)); break; case "Gatekeeper": //return GetWorkersLookup("Gatekeeper"); UserRightBLL.GetUsersWithRight("Gatekeeper").ForEach(user => lookup.Add(user.UserId, user.FullName)); break; case "Inspector": //return GetWorkersLookup("Gatekeeper"); UserRightBLL.GetUsersWithRight("WHPCT").ForEach(user => lookup.Add(user.UserId, user.FullName)); break; case "BagType": foreach (BagTypeBLL bagType in BagTypeBLL.GetAllBagTypes()) { lookup.Add(bagType.Id, bagType.BagTypeName); } break; case "BagWeight": foreach (BagTypeBLL bagType in BagTypeBLL.GetAllBagTypes()) { lookup.Add(bagType.Id, bagType.Tare.ToString()); } break; case "CurrentWarehouse": lookup.Add("Id", WarehouseBLL.CurrentWarehouse.WarehouseId.ToString()); lookup.Add("WarehouseCode", WarehouseBLL.CurrentWarehouse.Code); //lookup.Add("WarehouseManagerId", currentWareHouse.WarehouseId.ToString()); //lookup.Add("WarehouseManagerName", ""); break; case "CurrentUser": lookup.Add("Id", UserBLL.GetCurrentUser().ToString()); lookup.Add("Name", UserBLL.GetName(UserBLL.GetCurrentUser())); break; case "WorkerStatus": lookup.Add(0, "Status 1"); lookup.Add(1, "Status 2"); break; case "EmployeeRole": lookup.Add(WorkType.GINGrading, "0e604921-ee27-4406-97ce-846b47b1cd75"); lookup.Add(WorkType.GINLoading, "0e604921-ee27-4406-97ce-846c47b1cd75"); lookup.Add(WorkType.GINSampling, "0e604921-ee27-4406-97ce-84db47b1cd75"); lookup.Add(WorkType.GINScaling, "0e604921-ee27-4406-97ce-846e47b1cd75"); break; case "Shed": foreach (ShedBLL shed in new ShedBLL().GetActiveShedByWarehouseId(WarehouseBLL.CurrentWarehouse.WarehouseId)) { lookup.Add(shed.Id, shed.ShedNumber); } break; case "Stack": foreach (Guid shedId in GetLookup("Shed").Keys) { foreach (StackBLL stack in new StackBLL().GetActiveStackbyShedId(shedId)) { lookup.Add(stack.Id, stack.StackNumber); } } break; case "TruckType": lookup.Add(Guid.Empty, "Not Registred"); TruckTypeBLL objTT = new TruckTypeBLL(); List <TruckTypeBLL> list = objTT.GetActiveTrucksTypes(); list.Sort(TruckTypeComp); list.ForEach(tt => lookup.Add(tt.Id, tt.TruckTypeName)); break; } lookup.OrderBy(lkup => lkup.Value); return(lookup); } catch (Exception ex) { throw new Exception(string.Format("Item not found for the {0} lookup.", lookupName), ex); } }