private bool ValidateLot()
 {
     if (!LotValidated)
     {
         if (string.IsNullOrEmpty(LotEdit.Text))
         {
             if (LotTracked)
             {
                 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);
 }
Beispiel #2
0
        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);
        }