yangle
2023-05-24 b129762a4bb5ec2cde5edf16bc9cbda57c73587d
WorkM/Á÷ת¿¨¹ÜÀí/MES_StationEntrustOutBill.cs
@@ -85,10 +85,23 @@
        {
            DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp);
            //DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp2);
            txtHBarCode.Focus();
            txtHTaxRate.Text = "16";
            DBUtility.Xt_BaseBillFun.Sub_ClearBill1(tabPage1);
            DBUtility.Xt_BaseBillFun.Sub_ClearBill1(tabPage2);
            initGrid();
            initGrid_Sub();
            txtHBarCode.Text = "";
            txtHProcExchBillNo.Enabled = true;
            txtHWWWorkOrderBillNo.Enabled = true;
            txtHProcNO.Enabled = true;
            txtHBarCode.Enabled = true;
            txtHPieceQty.Enabled = true;
            txtHBadPNL.Enabled = true;
            tabControl1.SelectedIndex = 0;
            txtHBarCode.Focus();
            lngBillKey = 0;
            lngBillSubKey = 0;
            txtHTaxRate.Text = "16";
            this.txtHICMOBillNo.Tag = "0";
        }
        //出站按钮
        private void cmdOK_Click(object sender, EventArgs e)
@@ -469,6 +482,7 @@
            this.txtHBadPNL.Text = BillOld.omodel.HBadPNL.ToString();
            this.txtHRemark.Text = BillOld.omodel.HRemark.ToString();
            this.txtHWasterQty.Text = BillOld.omodel.HWasterQty.ToString();
            this.txtHBadCount.Text = BillOld.omodel.HBadCount.ToString();
            this.txtHQty.Text = BillOld.omodel.HQty.ToString();
            this.txtHPieceQty.Text = BillOld.omodel.HPieceQty.ToString();
            this.txtHPlanPieceQty.Text = BillOld.omodel.HPlanPieceQty.ToString();
@@ -646,14 +660,16 @@
            //    MessageBox.Show("接收个数不能为0!", "提示");
            //    return false;
            //}
            if (DBUtility.ClsPub.isDoule(txtHQty.Text.Trim()) + DBUtility.ClsPub.isDoule(txtHWasterQty.Text.Trim()) <= 0)
            if (DBUtility.ClsPub.isDoule(txtHQty.Text.Trim())
                + DBUtility.ClsPub.isDoule(txtHWasterQty.Text.Trim())
                + DBUtility.ClsPub.isDoule(txtHBadCount.Text) <= 0)
            {
                MessageBox.Show("接收个数不能为0!", "提示");
                return false;
            }
            if (DBUtility.ClsPub.isDoule(txtHQty.Text.Trim()) < 0) 
            {
                MessageBox.Show("接收个数不能小于0!", "提示");
                MessageBox.Show("接收合格个数不能小于0!", "提示");
                return false;
            }
            //if (DBUtility.ClsPub.isDoule(txtHQty.Text.Trim()) > DBUtility.ClsPub.isDoule(txtHPlanQty.Text.Trim()))
@@ -665,6 +681,11 @@
            if (DBUtility.ClsPub.isDoule(txtHWasterQty.Text.Trim()) < 0)
            {
                MessageBox.Show("不合格数不能小于0!", "提示");
                return false;
            }
            if (DBUtility.ClsPub.isDoule(txtHBadCount.Text.Trim()) < 0)
            {
                MessageBox.Show("不良品数不能小于0!", "提示");
                return false;
            }
            //if (DBUtility.ClsPub.isDoule(txtHWasterQty.Text.Trim()) > DBUtility.ClsPub.isDoule(txtHPlanQty.Text.Trim()))
@@ -737,8 +758,18 @@
            if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify)
                BillNew.omodel.HInterID = BillOld.omodel.HInterID;
            //主类赋值
            BillNew.omodel.HYear = 2011;
            BillNew.omodel.HPeriod = 1;
            //判断会计期是否合理
            string s = "";
            int sYear = 0;
            int sPeriod = 0;
            if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(DBUtility.ClsPub.isDate(this.txtHStationOutTime.Text), ref sYear, ref sPeriod, ref s) == false)
            {
                MessageBox.Show(s, "提示");
                return false;
            }
            //
            BillNew.omodel.HYear = sYear;
            BillNew.omodel.HPeriod = sPeriod;
            BillNew.omodel.HBillNo = this.txtHBillNo.Text.Trim();
            BillNew.omodel.HInnerBillNo = this.txtHInnerBillNo.Text.Trim();
            BillNew.omodel.HICMOBillNo = this.txtHICMOBillNo.Text.Trim();
@@ -769,6 +800,7 @@
            BillNew.omodel.HOrderProcNO = DBUtility.ClsPub.isStrNull(this.txtHOrderProcNO.Text);
            BillNew.omodel.HBadPNL = DBUtility.ClsPub.isDoule(this.txtHBadPNL.Text);
            BillNew.omodel.HWasterQty = DBUtility.ClsPub.isDoule(this.txtHWasterQty.Text);
            BillNew.omodel.HBadCount = DBUtility.ClsPub.isDoule(this.txtHBadCount.Text);
            BillNew.omodel.HRemark = DBUtility.ClsPub.isStrNull(this.txtHRemark.Text);
            BillNew.omodel.HLastSubProc = true;
            BillNew.omodel.HMainSourceInterID = sHMainSourceInterID;
@@ -859,6 +891,8 @@
        //初始化GRID
        private void initGrid()
        {
            DBUtility.Xt_BaseBillFun.initGridMESList(grdCardList, this.Name + "grdCardList");
            grdCardList.DataSource = null;
            //
            grdMain.ColumnCount = 10;                       //总列数
@@ -1850,6 +1884,7 @@
            if (e.KeyCode == Keys.Enter)
            {
                txtHPrice.Select();
                txtHInnerBillNo.Focus();
            }
        }
@@ -1866,6 +1901,7 @@
            if (e.KeyCode == Keys.Enter)
            {
                txtHPieceQty.Select();
                txtHBadCount.Focus();
            }
        }
@@ -2424,6 +2460,7 @@
                if (Ds == null || Ds.Tables[0].Rows.Count == 0)
                {
                    txtHProcExchBillNo.Text = "";
                    txtHBarCode.Text = "";
                    MessageBox.Show("未查询到流转卡信息!");
                    return;
                }
@@ -2459,5 +2496,92 @@
            //}
        }
        //新增
        private void cmdXZ_Click(object sender, EventArgs e)
        {
            this.Sub_AddBill();
        }
        //报废品质确认按钮
        private void cmdBFChecker_Click(object sender, EventArgs e)
        {
            QC_NoPassProdCheckBill oBF = new QC_NoPassProdCheckBill();
            oBF.BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
            oBF.HMainSourceInterID = BillOld.omodel.HInterID;
            oBF.HProcExchInterID = lngBillKey;
            oBF.HProcExchEntryID = lngBillSubKey;
            oBF.HBillSubType = "报废评审";
            oBF.txtHLotNo.Text = txtHProcExchBillNo.Text;
            oBF.txtHOrderProcNo.Text = txtHOrderProcNO.Text;
            oBF.txtHMaterID.Text = txtHMaterName.Text;
            oBF.txtHMaterNumber.Text = txtHMaterID.Text;
            oBF.txtHModel.Text = txtHMaterModel.Text;
            oBF.txtHMaterID.Tag = txtHMaterID.Tag;
            oBF.txtHProcID.Tag = txtHProcID.Tag;
            oBF.txtHProcID.Text = txtHProcID.Text;
            oBF.txtHWorkCenterID.Text = "";
            oBF.txtHWorkCenterID.Tag = 0;
            oBF.txtHICMOInterID.Text = Pub_Class.ClsPub.isStrNull(txtHICMOBillNo.Tag);
            oBF.txtHICMOBillNo.Text = txtHICMOBillNo.Text;
            oBF.txtHProcExchQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHPlanQty.Text));
            oBF.txtHPlanQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHWasterQty.Text));
            oBF.txtHPlanPNL.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHBadPNL.Text));
            oBF.txtHBadPNL.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHBadPNL.Text));
            oBF.txtHBadQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHWasterQty.Text));
            oBF.ShowDialog();
            if (oBF.BillChange)
            {
                this.Sub_ShowBill();
            }
        }
        //不良品质确认按钮
        private void cmdChecker_Click(object sender, EventArgs e)
        {
            QC_NoPassProdCheckBill oBF = new QC_NoPassProdCheckBill();
            oBF.BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
            oBF.HMainSourceInterID = BillOld.omodel.HInterID;
            oBF.HProcExchInterID = lngBillKey;
            oBF.HProcExchEntryID = lngBillSubKey;
            oBF.HBillSubType = "不良评审";
            oBF.txtHLotNo.Text = txtHProcExchBillNo.Text;
            oBF.txtHOrderProcNo.Text = txtHOrderProcNO.Text;
            oBF.txtHMaterID.Text = txtHMaterName.Text;
            oBF.txtHMaterNumber.Text = txtHMaterID.Text;
            oBF.txtHModel.Text = txtHMaterModel.Text;
            oBF.txtHMaterID.Tag = txtHMaterID.Tag;
            oBF.txtHProcID.Tag = txtHProcID.Tag;
            oBF.txtHProcID.Text = txtHProcID.Text;
            oBF.txtHWorkCenterID.Text = "";
            oBF.txtHWorkCenterID.Tag = 0;
            oBF.txtHICMOInterID.Text = Pub_Class.ClsPub.isStrNull(txtHICMOBillNo.Tag);
            oBF.txtHICMOBillNo.Text = txtHICMOBillNo.Text;
            oBF.txtHProcExchQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHPlanQty.Text));
            oBF.txtHPlanQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHBadCount.Text));
            oBF.txtHPlanPNL.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHBadPNL.Text));
            oBF.txtHBadPNL.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHBadPNL.Text));
            oBF.txtHBadQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHBadCount.Text));
            oBF.ShowDialog();
            if (oBF.BillChange)
            {
                this.Sub_ShowBill();
            }
        }
        private void txtHInnerBillNo_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                txtHWasterQty.Focus();
            }
        }
        private void txtHBadCount_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                cmdOK.Focus();
            }
        }
    }
}