Ejemplo n.º 1
0
        public string saveScanItem(string scanBarCode, string strLastItemID)
        {
            string ItemBarCode     = string.Empty;
            string ItemNum         = string.Empty;
            string BatchNum        = string.Empty;
            string strMasterAction = string.Empty;
            string strNewItemID    = string.Empty;

            try
            {
                if (scanBarCode.Substring(0, 3) == "ATO")
                {
                    ItemBarCode = scanBarCode.Substring(3);
                }
                else
                {
                    ItemBarCode = scanBarCode;
                }
                ItemNum  = ItemBarCode.Substring(0, ItemBarCode.IndexOf("/"));
                BatchNum = ItemBarCode.Substring(ItemBarCode.IndexOf("/") + 1);

                strMasterAction = objHelper.checkScanItem(ItemNum, BatchNum, ItemActivityID, conn);
                if (strMasterAction == "E")
                {
                    MessageBox.Show("Invalid Item.");
                    strCurrentItem = strLastItemID;
                }
                else
                {
                    strNewItemID         = objHelper.insertScanItem(ItemNum, BatchNum, CustName, LocationName, ItemActivityID, 1, strScannerID, UserID, strMasterAction, conn);
                    strCurrentItem       = strNewItemID;
                    this.lbScanItem.Text = scanBarCode;
                    this.lbQtyNum.Text   = "Qty: " + "1";
                }
                return(strCurrentItem);
            }
            catch (Exception ex)
            {
                strCurrentItem = strLastItemID;
                Helper.LogError(ex, "saveScanItem");
                return(strCurrentItem);
            }
        }
Ejemplo n.º 2
0
        private void LiftNumber_PreviewKeyUp(object sender, KeyEventArgs e)



        {
            try
            {
                if (e.Key == Key.Enter)
                {
                    dhItems ObjDhInputItem = new dhItems();
                    if (ItemBarCode.Text.Length > 1)
                    {
                        ObjDhInputItem.VItemBarcode = ItemBarCode.Text;
                        Int32 tabid;
                        int.TryParse(LiftNumber.Text.ToString(), out tabid);
                        if (tabid > tabDynamic.Items.Count)
                        {
                            MessageBox.Show("No Lift is open with this number.");
                        }
                        tabid = tabid > 0 ? tabid - 1 : tabid;
                        EmptyInvoiceView objabc = (EmptyInvoiceView)this._tabItems[tabid].Content as EmptyInvoiceView;
                        //
                        //objabc.
                        objabc.AddItem(ObjDhInputItem);
                        //  AddItem(ObjDhInputItem);
                        tabDynamic.SelectedIndex = tabid;
                        ItemBarCode.Text         = "";
                        ItemBarCode.Focus();
                        Keyboard.Focus(this.ItemBarCode);
                    }
                }
            }
            catch (Exception ex)
            {
                //  Globalized.setException(ex, lblErrorMsg, MsgType.Error);
            }
        }