Esempio n. 1
0
        private void btnMannualPrint_Click(object sender, EventArgs e)
        {
            if (!PermissionCheckHelper.GetHighUserPermission("强制打印,需要高级权限!"))
            {
                return;
            }


            if (_recentBarcodeList.Count == 0)
            {
                return;
            }
            var saveResult = PrintTwoDimensioncode();

            if (!saveResult)
            {
                DlgHelper.AlarmSound();
                while (saveResult == false)
                {
                    var dlgResult = MessageBox.Show("入库失败,请检查打印机和服务器状态后重试,点击重试!\n点击取消,需要重新入库这条二维码上的产品!", "重试", MessageBoxButtons.RetryCancel);
                    if (dlgResult == DialogResult.Retry)
                    {
                        saveResult = PrintTwoDimensioncode();
                    }
                    else
                    {
                        _recentBarcodeList.Clear();
                        return;
                    }
                }
            }
        }
        private void btnRemovalSet_Click(object sender, EventArgs e)
        {
            if (btnRemovalSet.Text == "修改")
            {
                SetPutinSetEnable(true);
                btnStartRemoval.Enabled = false;
                btnRemovalSet.Text      = "确定";
            }
            else
            {
                if (!MainForm.CurrentUserRoles.Contains(PermissionEnum.班长.ToString()) &&
                    !MainForm.CurrentUserRoles.Contains(PermissionEnum.系统管理员.ToString()))
                {
                    var isHasPermission = PermissionCheckHelper.GetHighUserPermission("出库设置需要高级权限!");
                    if (isHasPermission == false)
                    {
                        return;
                    }
                }

                var result = WriteConfigToFile();
                if (result == false)
                {
                    return;
                }
                SetPutinSetEnable(false);
                btnStartRemoval.Enabled = true;
                btnRemovalSet.Text      = "修改";
            }
        }
Esempio n. 3
0
        private void btnStopPutin_Click(object sender, EventArgs e)
        {
            if (_recentBarcodeList.Count > 0)
            {
                var result = DlgHelper.ShowConfirmMsgBox("是否打印二维码?");
                if (result == DialogResult.Yes)
                {
                    if (_recentBarcodeList.Count != int.Parse(txtPrintCount.Text.Trim()))
                    {
                        if (PermissionCheckHelper.GetHighUserPermission("打印不满数量设置的二维码,需要高级权限"))
                        {
                            var saveResult = PrintTwoDimensioncode();
                            while (saveResult == false)
                            {
                                var dlgResult = MessageBox.Show("入库失败,请检查打印机和服务器状态后重试,点击重试!\n点击取消,需要重新入库这条二维码上的产品!", "重试", MessageBoxButtons.RetryCancel);
                                if (dlgResult == DialogResult.Retry)
                                {
                                    saveResult = PrintTwoDimensioncode();
                                }
                                else
                                {
                                    _recentBarcodeList.Clear();
                                    return;
                                }
                            }
                        }
                        else
                        {
                            int removeCount = _recentBarcodeList.Count;
                            _recentBarcodeList.Clear();
                            SetCountStatisticProp((int)lblCountStatistic.Tag - removeCount);
                            DlgHelper.ShowAlertMsgBox("此货架上的货物没有入库,请重新扫描入库!");
                        }
                    }
                }
                else
                {
                    int removeCount = _recentBarcodeList.Count;
                    _recentBarcodeList.Clear();
                    SetCountStatisticProp((int)lblCountStatistic.Tag - removeCount);
                    DlgHelper.ShowAlertMsgBox("此货架上的货物没有入库,请重新扫描入库!");
                }
            }

            btnStopPutin.Enabled  = false;
            btnStartPutin.Enabled = true;
            btnPutinSet.Enabled   = true;
        }
Esempio n. 4
0
        private void txtBarCode_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar != 13)
            {
                if (_isScanOnefinished == true)
                {
                    txtBarCode.Text    = "";
                    _isScanOnefinished = false;
                }
                txtBarCode.Text = txtBarCode.Text + e.KeyChar;
                return;
            }
            else
            {
                _isScanOnefinished = true;
            }

            if (btnStartPutin.Enabled == true)
            {
                DlgHelper.ShowAlertMsgBox("请进行入库设置并点击开始入库后,再开始入库操作!", true);
                txtBarCode.Text = "";
                return;
            }
            var barCode = txtBarCode.Text.Trim();

            if (barCode.Length != 17)
            {
                DlgHelper.ShowAlertMsgBox("条形码长度有误!", true);
                return;
            }

            Console.Beep(5000, 1000);

            if (_recentBarcodeList.Contains(barCode))
            {
                //DlgHelper.ShowAlertMsgBox("产品编号重复!", true);
                return;
            }

            var isNumCorrect = PutInWarehouseBLL.IsSpeedChangeTypeNumRight(barCode, ((WebSpeedChangeBoxType)cbxProductType.SelectedItem).SpeedChangeBoxName);

            if (isNumCorrect == false)
            {
                DlgHelper.ShowAlertMsgBox("产品型号和当前设置的型号不一致!", true);
                return;
            }

            if ((int)lblCountStatistic.Tag >= int.Parse(txtCountLimit.Text.Trim()))
            {
                DlgHelper.ShowAlertMsgBox("已达到数量限制,不能入库!", true);
                return;
            }

            var numCheckResult = PutInWarehouseBLL.IsCurrentPutInInfoRight(barCode);

            if (numCheckResult == PutInResultEnum.仓库已经存在此货物)
            {
                DlgHelper.ShowAlertMsgBox(numCheckResult.ToString(), true);
                return;
            }
            else if (numCheckResult == PutInResultEnum.重复入库)
            {
                if (!PermissionCheckHelper.GetHighUserPermission("重复入库,需要高级权限!"))
                {
                    return;
                }
            }

            _recentBarcodeList.Add(txtBarCode.Text.Trim());

            if (_recentBarcodeList.Count == int.Parse(txtPrintCount.Text))
            {
                var saveResult = PrintTwoDimensioncode();
                if (!saveResult)
                {
                    DlgHelper.AlarmSound();
                    while (saveResult == false)
                    {
                        var dlgResult = MessageBox.Show("入库失败,请检查打印机和服务器状态后重试,点击重试!\n点击取消,需要重新入库这条二维码上的产品!", "重试", MessageBoxButtons.RetryCancel);
                        if (dlgResult == DialogResult.Retry)
                        {
                            saveResult = PrintTwoDimensioncode();
                        }
                        else
                        {
                            _recentBarcodeList.Clear();
                            return;
                        }
                    }
                }
            }

            SetCountStatisticProp((int)lblCountStatistic.Tag + 1);
        }