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 ValidateLot() { if (!LotValidated) { if (string.IsNullOrEmpty(LotEdit.Text)) { LotValidated = false; } else { string Loc = LocEdit.Text, Lot = "", Qty = ""; bool LotValidated = CSILotLocs.GetItemLotLocInfor(CSISystemContext, JobEdit.Text, WhseEdit.Text, Loc, ref Lot, ref Qty); if (LotValidated) { LotEdit.Text = Lot; } else { LotEdit.Text = string.Empty; } } } EnableDisableComponents(); return(LotValidated); }
private bool ValidateToLoc() { if (!ToLocValidated) { if (string.IsNullOrEmpty(ToLocEdit.Text)) { ToLocValidated = false; } else { string Loc = ToLocEdit.Text, LocDescription = "", Lot = ToLotEdit.Text, Qty = ""; ToLocValidated = CSIItemLocs.GetItemLocInfor(CSISystemContext, ItemEdit.Text, WhseEdit.Text, ref Loc, ref LocDescription, ref Qty); if (ToLocValidated) { ToLocEdit.Text = Loc; ToLocDescText.Text = LocDescription; bool RtnCSILotLocs = CSILotLocs.GetItemLotLocInfor(CSISystemContext, ItemEdit.Text, WhseEdit.Text, Loc, ref Lot, ref Qty); if (RtnCSILotLocs) { ToLotEdit.Text = Lot; ToLotValidated = false; ValidateToLot(); //OnHandQuantityText.Text = Qty; //used for validate Qty } } 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) { ToLocDescText.Text = string.Empty; ToLocValidated = false; } else { ToLocEdit.Text = SLLoc.GetCurrentPropertyValueOfString("Loc");; ToLocDescText.Text = SLLoc.GetCurrentPropertyValueOfString("Description");; ToLocValidated = true; } } catch (Exception Ex) { WriteErrorLog(Ex); ToLocValidated = false; } } } } EnableDisableComponents(); return(ToLocValidated); }
private bool ValidateLot() { if (!LotValidated) { if (string.IsNullOrEmpty(LotEdit.Text)) { if (LotTracked) { /* Get Current Lot */ string Loc = LocEdit.Text, Lot = LotEdit.Text, Qty = ""; bool RtnCSILotLocs = CSILotLocs.GetItemLotLocInfor(CSISystemContext, PoNumEdit.Text, WhseEdit.Text, Loc, ref Lot, ref Qty); if (RtnCSILotLocs) { LotEdit.Text = Lot; LotValidated = true; } /* Get Next Lot */ //string Message = "", Key = ""; //LotValidated = CSIItems.GetNextLotSp(CSISystemContext, ItemText.Text, "", ref Message, ref Key); //if (string.IsNullOrEmpty(Message)) //{ // LotEdit.Text = Key; //} //else //{ // //LotValidated = false; //} } else { LotValidated = true; } } else { LotValidated = true; } } EnableDisableComponents(); return(LotValidated); }
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); }