private bool ValidateLoc() { if (!LocValidated) { if (string.IsNullOrEmpty(LocEdit.Text)) { LocValidated = false; } else { string Loc = LocEdit.Text, LocDescription = "", Lot = LotEdit.Text, Qty = ""; LocValidated = CSIItemLocs.GetItemLocInfor(CSISystemContext, ItemEdit.Text, WhseEdit.Text, ref Loc, ref LocDescription, ref Qty); if (LocValidated) { LocEdit.Text = Loc; LocDescText.Text = LocDescription; bool RtnCSILotLocs = CSILotLocs.GetItemLotLocInfor(CSISystemContext, ItemEdit.Text, WhseEdit.Text, LocEdit.Text, ref Lot, ref Qty); if (RtnCSILotLocs) { LotEdit.Text = Lot; LotValidated = false; ValidateLot(); //OnHandQuantityText.Text = Qty; //used for validate Qty } } else { LocDescText.Text = string.Empty; } } } EnableDisableComponents(); return(LocValidated); }
private bool ValidateLoc() { if (!LocValidated) { if (string.IsNullOrEmpty(LocEdit.Text)) { LocValidated = false; } else { string Loc = LocEdit.Text, LocDescription = "", Lot = LotEdit.Text, Qty = ""; LocValidated = CSIItemLocs.GetItemLocInfor(CSISystemContext, JobEdit.Text, WhseEdit.Text, ref Loc, ref LocDescription, ref Qty); if (LocValidated) { LocDescText.Text = LocDescription; } else { try { CSILocations SLLoc = new CSILocations(CSISystemContext); SLLoc.UseAsync(false); SLLoc.AddProperty("Loc"); SLLoc.AddProperty("Description"); SLLoc.SetFilter(string.Format("Loc = N'{0}'", Loc)); SLLoc.LoadIDO(); if (SLLoc.CurrentTable.Rows.Count <= 0) { LocDescText.Text = string.Empty; LocValidated = false; } else { LocEdit.Text = SLLoc.GetCurrentPropertyValueOfString("Loc");; LocDescText.Text = SLLoc.GetCurrentPropertyValueOfString("Description");; LocValidated = true; } }catch (Exception Ex) { WriteErrorLog(Ex); LocValidated = false; } //LocEdit.Text = Loc; //LocDescText.Text = LocDescription; //bool RtnCSILotLocs = CSILotLocs.GetItemLotLocInfor(CSISystemContext, JobEdit.Text, WhseEdit.Text, Loc, ref Lot, ref Qty); //if (RtnCSILotLocs) //{ // LotEdit.Text = Lot; // LotValidated = false; ValidateLot(); // //ReleasedQuantityText.Text = Qty; //used for validate Qty //} } } } EnableDisableComponents(); return(LocValidated); }
private bool ValidateItem() { if (!ItemValidated) { if (string.IsNullOrEmpty(ItemEdit.Text)) { ItemValidated = false; } else { try { string Item = ItemEdit.Text, Desc = ItemDescText.Text, UM = ItemUMText.Text, Qty = OnHandQuantityText.Text; ItemValidated = CSIItems.GetItemInfor(CSISystemContext, ref Item, ref Desc, ref UM, ref Qty, ref LotTracked, ref SNTracked); if (ItemValidated == true) { ItemEdit.Text = Item; ItemDescText.Text = Desc; ItemUMText.Text = UM; if (string.IsNullOrEmpty(UMEdit.Text)) { UMEdit.Text = UM; UMValidated = true; } OnHandQuantityText.Text = Qty; } else { ItemDescText.Text = string.Empty; ItemUMText.Text = string.Empty; OnHandQuantityText.Text = string.Empty; } string Loc = LocEdit.Text, LocType = ""; bool RtnCSIItemLocs = CSIItemLocs.GetItemLocInfor(CSISystemContext, ItemEdit.Text, WhseEdit.Text, ref Loc, ref LocType, ref Qty); if (RtnCSIItemLocs == true) { LocEdit.Text = Loc; LocValidated = false; ValidateLoc(); //OnHandQuantityText.Text = Qty; //used for validate Qty } } catch (Exception Ex) { WriteErrorLog(Ex); ItemValidated = false; } } } EnableDisableComponents(); return(ItemValidated); }
private bool ValidateSuffix() { if (!SuffixValidated) { if (string.IsNullOrEmpty(SuffixEdit.Text)) { SuffixValidated = false; } else { SuffixEdit.Text = SuffixEdit.Text; try { string Job = JobEdit.Text, Suffix = SuffixEdit.Text, Desc = JobDescText.Text, Item = ItemText.Text , ItemDesc = ItemDescText.Text, ItemUM = ItemUMText.Text, QtyReleased = QtyReleasedText.Text , QtyComplete = "", QtyRequired = ""; //validate Job and Suffix SuffixValidated = CSIJobs.GetJobInfor(CSISystemContext, ref Job, ref Suffix, ref Desc, ref Item , ref ItemDesc, ref ItemUM, ref QtyReleased, ref QtyComplete, ref QtyRequired, ref LotTracked, ref SNTracked); if (SuffixValidated == true) { JobEdit.Text = Job; SuffixEdit.Text = Suffix; JobDescText.Text = Desc; ItemText.Text = Item; ItemDescText.Text = ItemDesc; ItemUMText.Text = ItemUM; QtyReleasedText.Text = QtyReleased; //validate OperNum if (string.IsNullOrEmpty(QtyEdit.Text) || decimal.Parse(QtyEdit.Text) == 0) { QtyEdit.Text = QtyRequired; OperNumValidated = false; ValidateQty(); } //Validate OperNum string Operation = OperNumEdit.Text, Wc = WorkCenterText.Text, QtyReceived = ""; bool RtnSLJobRoutes = CSIJobRoutes.GetOperationInfor(CSISystemContext, JobEdit.Text, SuffixEdit.Text, ref Operation, ref Wc, ref QtyReceived); if (RtnSLJobRoutes == true) { OperNumEdit.Text = Operation; OperNumValidated = false; ValidateOperNum(); WorkCenterText.Text = Wc; } //Validate ItemLoc string Loc = LocEdit.Text, LocDescription = "", Qty = ""; bool RtnCSIItemLocs = CSIItemLocs.GetItemLocInfor(CSISystemContext, ItemText.Text, WhseEdit.Text, ref Loc, ref LocDescription, ref Qty); if (RtnCSIItemLocs == true) { LocEdit.Text = Loc; LocDescText.Text = LocDescription; LocValidated = false; ValidateLoc(); //OnHandQuantityText.Text = Qty; //used for validate Qty } } else { JobDescText.Text = string.Empty; ItemText.Text = string.Empty; ItemDescText.Text = string.Empty; ItemUMText.Text = string.Empty; } } catch (Exception Ex) { WriteErrorLog(Ex); SuffixValidated = false; } } } EnableDisableComponents(); return(SuffixValidated); }
private bool ValidateItem() { if (!ItemValidated) { if (string.IsNullOrEmpty(ItemEdit.Text)) { ItemValidated = false; } else { try { string Item = ItemEdit.Text, Desc = ItemDescText.Text, UM = ItemUMText.Text, Qty = QtyEdit.Text; ItemValidated = CSIJobmatls.GetItemInfor(CSISystemContext, JobEdit.Text, SuffixEdit.Text, OperNumEdit.Text, ref Item, ref Desc, ref UM, ref Qty, ref LotTracked, ref SNTracked); if (ItemValidated == true) { ItemEdit.Text = Item; ItemDescText.Text = Desc; ItemUMText.Text = UM; if (string.IsNullOrEmpty(UMEdit.Text)) { UMEdit.Text = UM; UMValidated = true; } if (string.IsNullOrEmpty(QtyEdit.Text)) { QtyEdit.Text = Qty; QtyValidated = true; } } else { ItemDescText.Text = string.Empty; ItemUMText.Text = string.Empty; QtyEdit.Text = string.Empty; } string Loc = LocEdit.Text, LocDescription = ""; bool LocValidated = CSIItemLocs.GetItemLocInfor(CSISystemContext, ItemEdit.Text, WhseEdit.Text, ref Loc, ref LocDescription, ref Qty); if (LocValidated == true) { LocEdit.Text = Loc; LocDescText.Text = LocDescription; OnHandQuantityText.Text = Qty; //used for validate Qty LocValidated = true; string Lot = LotEdit.Text; bool RtnCSILotLocs = CSILotLocs.GetItemLotLocInfor(CSISystemContext, JobEdit.Text, WhseEdit.Text, LocEdit.Text, ref Lot, ref Qty); if (RtnCSILotLocs) { LotEdit.Text = Lot; LotValidated = true; } } else { } } catch (Exception Ex) { WriteErrorLog(Ex); ItemValidated = false; } } } EnableDisableComponents(); return(ItemValidated); }
private bool ValidateRelease() { if (!ReleaseValidated) { if (string.IsNullOrEmpty(ReleaseEdit.Text)) { ReleaseValidated = false; } else { try { string PoNum = PoNumEdit.Text, Line = LineEdit.Text, Release = ReleaseEdit.Text, Vendor = VendorText.Text , Item = ItemText.Text, ItemDesc = ItemDescText.Text, UM = ItemUMText.Text , QuantityOrdered = QuantityOrderedText.Text, QtyReceived = "", QtyToBeReceived = ""; //validate PoNum and Line, Release PoNumValidated = CSIPoItems.GetPoNumInfor(CSISystemContext, ref PoNum, ref Line, ref Release, ref PoType, ref Vendor, ref Item , ref ItemDesc, ref UM, ref QuantityOrdered, ref QtyReceived, ref QtyToBeReceived, ref LotTracked, ref SNTracked); if (PoNumValidated == true) { PoNumEdit.Text = PoNum; LineEdit.Text = Line; LineValidated = true; ReleaseEdit.Text = Release; ReleaseValidated = true; VendorText.Text = Vendor; ItemText.Text = Item; ItemDescText.Text = ItemDesc; ItemUMText.Text = UM; if (string.IsNullOrEmpty(UMEdit.Text)) { UMEdit.Text = UM; UMValidated = true; } if (string.IsNullOrEmpty(QtyEdit.Text) || QtyEdit.Text.Equals("0") /* || Convert.ToDecimal(QtyEdit.Text) > Convert.ToDecimal(QtyToBeReceived)*/) { QtyEdit.Text = QtyToBeReceived; QtyValidated = true; } QuantityOrderedText.Text = QuantityOrdered; if (PoType == "R") { ReleaseEdit.Enabled = false; } else { ReleaseEdit.Enabled = true; } //Validate ItemLoc string Loc = LocEdit.Text, LocDescription = "", Qty = ""; bool RtnCSIItemLocs = CSIItemLocs.GetItemLocInfor(CSISystemContext, ItemText.Text, WhseEdit.Text, ref Loc, ref LocDescription, ref Qty); if (RtnCSIItemLocs == true) { LocEdit.Text = Loc; LocDescText.Text = LocDescription; LocValidated = false; ValidateLoc(); } } else { VendorText.Text = string.Empty; ItemText.Text = string.Empty; ItemDescText.Text = string.Empty; ItemUMText.Text = string.Empty; QuantityOrderedText.Text = string.Empty; LotTracked = false; SNTracked = false; LineValidated = false; ReleaseValidated = false; } } catch (Exception Ex) { WriteErrorLog(Ex); PoNumValidated = false; LineValidated = false; ReleaseValidated = false; } } } EnableDisableComponents(); return(ReleaseValidated); }