private void dgvSpeedChangeBox_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int columnIndex = e.ColumnIndex;
            int rowIndex    = e.RowIndex;

            if (rowIndex == -1)
            {
                return;
            }

            if (this.dgvSpeedChangeBox.Columns[columnIndex] == this.dgvSpeedChangeBox.Columns["Delete"])
            {
                var dialogResult = DlgHelper.ShowConfirmMsgBox("确定要删除吗?");
                if (dialogResult == DialogResult.Yes)
                {
                    var id     = (int)dgvSpeedChangeBox.Rows[rowIndex].Cells["SpeedChangeBoxTypeID"].Value;
                    var result = new SpeedChangeBoxTypeBLL().DelSpeedChangeBox(id);
                    if (result.Code > 0)
                    {
                        DlgHelper.ShowAlertMsgBox(result.Msg);
                        return;
                    }
                    BindData();
                }
            }
        }
        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;
            }
            if (btnStartRemoval.Enabled == true)
            {
                DlgHelper.ShowAlertMsgBox("请进行出库设置并点击开始入库后,再开始出库操作!", true);
                txtBarCode.Text = "";
                return;
            }

            _isScanOnefinished = true;

            var twoDimensionCode  = txtBarCode.Text;
            var planTotalCount    = int.Parse(txtCountLimit.Text.Trim());
            var currentTotalCount = (int)lblCountStatistic.Tag;
            int containCount      = 0;

            var saveRemovalResult = RemovalWarehouseBLL.SaveRemalWarehouseInfo(out barCodeList, out containCount, twoDimensionCode, _currentOrderID, ((WebSpeedChangeBoxType)cbxProductType.SelectedItem).SpeedChangeBoxTypeID
                                                                               , planTotalCount, currentTotalCount);

            if (saveRemovalResult != RemovalResultEnum.执行成功)
            {
                if (saveRemovalResult == RemovalResultEnum.变速箱型号不一致)
                {
                    //报警
                    new AlarmForm(RemovalResultEnum.变速箱型号不一致.ToString(), AlarmType.出库报警).ShowDialog();
                    return;
                }
                else if (saveRemovalResult == RemovalResultEnum.当前出库数量已经大于设置的出库数量)
                {
                    new AlarmForm(RemovalResultEnum.当前出库数量已经大于设置的出库数量.ToString(), AlarmType.出库报警).ShowDialog();
                    var dlgResult = DlgHelper.ShowConfirmMsgBox("是否继续将超出的数量出库?");
                    if (dlgResult == DialogResult.Yes)
                    {
                        RemovalWarehouseBLL.SaveRemalWarehouseInfo(out barCodeList, out containCount, twoDimensionCode, _currentOrderID, ((WebSpeedChangeBoxType)cbxProductType.SelectedItem).SpeedChangeBoxTypeID
                                                                   , planTotalCount, currentTotalCount, true);
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    DlgHelper.ShowAlertMsgBox(saveRemovalResult.ToString(), true);
                    return;
                }
            }
            SetCountStatisticText(containCount, false);
        }
Beispiel #3
0
        private void btnChangeUser_Click(object sender, EventArgs e)
        {
            var result = DlgHelper.ShowConfirmMsgBox("是否切换用户?");

            if (result == DialogResult.Yes)
            {
                this.Dispose();
                new UserLoginForm().ShowDialog();
            }
        }
Beispiel #4
0
        private void dgvUserList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int columnIndex = e.ColumnIndex;
            int rowIndex    = e.RowIndex;

            if (rowIndex == -1)
            {
                return;
            }

            var clickColumn = dgvUserList.Columns[columnIndex];
            var id          = (int)dgvUserList.Rows[rowIndex].Cells["ID"].Value;

            if (clickColumn == dgvUserList.Columns["Delete"])
            {
                var dialogResult = DlgHelper.ShowConfirmMsgBox("确定要删除吗?");
                if (dialogResult == DialogResult.Yes)
                {
                    var result = new UserBLL().DeleteUserByID(id);
                    if (result.Code > 0)
                    {
                        DlgHelper.ShowAlertMsgBox(result.Msg);
                        return;
                    }
                    BindData();
                }
            }
            else if (clickColumn == this.dgvUserList.Columns["Edit"])
            {
                var departmentForm = new UserEditForm(true, id);
                departmentForm.CallBack += BindData;

                departmentForm.ShowDialog();
            }
            else if (clickColumn == dgvUserList.Columns["IsMonitor"])
            {
                var  checkBox = (DataGridViewCheckBoxCell)dgvUserList.Rows[rowIndex].Cells[columnIndex];
                bool value    = (bool)checkBox.EditingCellFormattedValue;
            }
            else if (clickColumn == dgvUserList.Columns["IsPutinMan"])
            {
                var  checkBox = (DataGridViewCheckBoxCell)dgvUserList.Rows[rowIndex].Cells[columnIndex];
                bool value    = (bool)checkBox.EditingCellFormattedValue;
            }
            else if (clickColumn == dgvUserList.Columns["IsRemovalMan"])
            {
                var  checkBox = (DataGridViewCheckBoxCell)dgvUserList.Rows[rowIndex].Cells[columnIndex];
                bool value    = (bool)checkBox.EditingCellFormattedValue;
            }
            else if (clickColumn == dgvUserList.Columns["ReSetPassword"])
            {
                new ReNewPasswordForm(id).ShowDialog();
            }
        }
Beispiel #5
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (e.CloseReason != CloseReason.ApplicationExitCall)
            {
                e.Cancel = true;
                Application.Exit();
                return;
            }
            var result = DlgHelper.ShowConfirmMsgBox("是否要退出系统?", false);

            if (result != DialogResult.Yes)
            {
                e.Cancel = true;
            }
        }
Beispiel #6
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;
        }
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int columnIndex = e.ColumnIndex;
            int rowIndex    = e.RowIndex;

            if (rowIndex == -1)
            {
                return;
            }

            if (this.dgvDepartment.Columns[columnIndex] == this.dgvDepartment.Columns["Delete"])
            {
                var dialogResult = DlgHelper.ShowConfirmMsgBox("确定要删除吗?");
                if (dialogResult == DialogResult.Yes)
                {
                    var id     = (int)dgvDepartment.Rows[rowIndex].Cells["DepartmentID"].Value;
                    var result = new DepartmentBLL().DeleteDepartmentByID(id);
                    if (result.Code > 0)
                    {
                        DlgHelper.ShowAlertMsgBox(result.Msg);
                        return;
                    }
                    BindData();
                }
            }
            else if (this.dgvDepartment.Columns[columnIndex] == this.dgvDepartment.Columns["Edit"])
            {
                var id   = (int)dgvDepartment.Rows[rowIndex].Cells["DepartmentID"].Value;
                var name = dgvDepartment.Rows[rowIndex].Cells["DepartmentName"].Value.ToString();

                var departmentForm = new AddDepartmentForm(true, id, name);
                departmentForm.CallBack += BindData;

                departmentForm.ShowDialog();
            }
        }