yxj
2022-08-26 612f93dba4a45edea9d0300a1977e66fe7ce355f
WorkM/Á÷ת¿¨¹ÜÀí/MES_StationEntrustInBill.cs
@@ -42,7 +42,24 @@
        public void Sub_ClearBill()
        {
            DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp);
            DBUtility.Xt_BaseBillFun.Sub_ClearBill1(tabPage1);
            DBUtility.Xt_BaseBillFun.Sub_ClearBill1(tabPage2);
            initGrid();
            txtHBarCode.Text = "";
            txtHProcExchBillNo.Enabled = true;
            txtHWWWorkOrderBillNo.Enabled = true;
            txtHProcNo.Enabled = true;
            txtHBarCode.Enabled = true;
            tabControl1.SelectedIndex = 0;
            txtHBarCode.Focus();
            lngBillKey = 0;
        }
        //初始化GRID
        private void initGrid()
        {
            DBUtility.Xt_BaseBillFun.initGridMESList(grdCardList, this.Name + "grdCardList");
            grdCardList.DataSource = null;
        }
        //进站按钮
        private void cmdOK_Click(object sender, EventArgs e)
@@ -508,8 +525,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.txtHStationInTime.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();
@@ -1165,6 +1192,7 @@
            if (e.KeyCode == Keys.Enter)
            {
                cmdOK.Select();
                txtHWWWorkOrderBillNo.Focus();
            }
        }
@@ -1315,23 +1343,23 @@
                    MessageBox.Show("没有录入流转卡号或者流水号");
                    return;
                }
                //根据工号获取委外工单 åŠå†…码,子内码
                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                DataSet ds;
                ds = oCn.RunProcReturn("exec  h_p_WW_GetWWWorkBillInfoByNo '" + txtHWWWorkOrderBillNo.Text + "'," + lngBillKey.ToString() + "," + lngBillSubKey.ToString(), "h_p_WW_GetWWWorkBillInfoByNo");
                if (ds == null)
                {
                    MessageBox.Show("没有找到对应的委外工单!");
                    return;
                }
                if (ds.Tables[0].Rows.Count > 0)
                {
                    txtHWWWorkOrderBillNo.Text = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBillNo"]);
                    lngBillKey_WW = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HInterID"]);
                    lngBillSubKey_WW = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HEntryID"]);
                    txtHWWWorkOrderBillNo.Enabled = false;
                }
                ////根据工号获取委外工单 åŠå†…码,子内码
                //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                //DataSet ds;
                //ds = oCn.RunProcReturn("exec  h_p_WW_GetWWWorkBillInfoByNo '" + txtHWWWorkOrderBillNo.Text + "'," + lngBillKey.ToString() + "," + lngBillSubKey.ToString(), "h_p_WW_GetWWWorkBillInfoByNo");
                //if (ds == null)
                //{
                //    MessageBox.Show("没有找到对应的委外工单!");
                //    return;
                //}
                //if (ds.Tables[0].Rows.Count > 0)
                //{
                //    txtHWWWorkOrderBillNo.Text = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBillNo"]);
                //    lngBillKey_WW = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HInterID"]);
                //    lngBillSubKey_WW = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HEntryID"]);
                //    txtHWWWorkOrderBillNo.Enabled = false;
                //}
                txtHRemark.Focus();
            }
        }
@@ -1414,6 +1442,7 @@
                if (Ds == null || Ds.Tables[0].Rows.Count == 0)
                {
                    txtHProcExchBillNo.Text = "";
                    txtHBarCode.Text = "";
                    MessageBox.Show("未查询到流转卡信息!");
                    return;
                }
@@ -1449,5 +1478,11 @@
            //}
        }
        //新增
        private void cmdXZ_Click(object sender, EventArgs e)
        {
            this.Sub_AddBill();
        }
    }
}