Ejemplo n.º 1
0
        protected override void DoEnter()
        {
            if (string.IsNullOrEmpty(ProductNameTxt.Text) || string.IsNullOrEmpty(ProductBornCodeTxt.Text))
            {
                FrmDialog.ShowDialog(this, "产品信息不准确,请重新扫码");
                return;
            }

            if (!AlreadyInJudge())
            {
                FrmDialog.ShowDialog(this, "周转库中暂无该产品库存信息");
                BeginInvoke(new Action((() =>
                {
                    ProductBornCodeTxt.Clear();
                    ProductNameTxt.Clear();
                })));
                return;
            }

            var dialogResult = FrmDialog.ShowDialog(this, "是否确认出库?", "确认", true);

            if (dialogResult == DialogResult.OK)
            {
                PutOut();
            }

            FrmDialog.ShowDialog(this, "出库成功!");
            Close();
            serialPort1.Close();
        }
Ejemplo n.º 2
0
        private void EnrichTextbox(string receivedData)
        {
            using (var context = new Model())
            {
                var baseDataDictionaryDetail = context.Base_DataDictionaryDetail.FirstOrDefault(s => s.DataDictionaryDetailId == receivedData);
                if (baseDataDictionaryDetail != null)
                {
                    BeginInvoke(new Action((() =>
                    {
                        ShelvesIdTxt.Clear();
                        ShelvesNameTxt.Clear();
                    })));

                    BeginInvoke(new Action((() =>
                    {
                        ShelvesIdTxt.Text = _baseDataDictionaryDetail.Code;
                        ShelvesNameTxt.Text = _baseDataDictionaryDetail.FullName;
                    })));
                    _baseDataDictionaryDetail = baseDataDictionaryDetail;
                }


                var aPlanProductInfomation =
                    context.A_PlanProductInfomation.FirstOrDefault(s =>
                                                                   s.IsAvailable == true && s.ProductBornCode == receivedData);
                if (aPlanProductInfomation != null)
                {
                    BeginInvoke(new Action((() =>
                    {
                        ProductNameTxt.Clear();
                        ProductBornCodeTxt.Clear();
                    })));

                    _aPlanProductInfomation = aPlanProductInfomation;
                    BeginInvoke(new Action((() =>
                    {
                        ProductNameTxt.Text = aPlanProductInfomation.ProductName;
                        ProductBornCodeTxt.Text = aPlanProductInfomation.ProductBornCode;
                    })));
                }
            }
        }
Ejemplo n.º 3
0
 private void EnrichTextbox(string receivedData)
 {
     using (var context = new Model())
     {
         BeginInvoke(new Action((() =>
         {
             ProductNameTxt.Clear();
             ProductBornCodeTxt.Clear();
         })));
         var aPlanProductInfomation =
             context.A_PlanProductInfomation.FirstOrDefault(s =>
                                                            s.IsAvailable == true && s.ProductBornCode == receivedData);
         if (aPlanProductInfomation != null)
         {
             _aPlanProductInfomation = aPlanProductInfomation;
             BeginInvoke(new Action((() =>
             {
                 ProductNameTxt.Text = aPlanProductInfomation.ProductName;
                 ProductBornCodeTxt.Text = aPlanProductInfomation.ProductBornCode;
             })));
         }
     }
 }