yangle
2022-06-12 9faee57fcc026298a78aa8b6639dcd829baf9862
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
2个文件已修改
122 ■■■■ 已修改文件
DAL/车间管理/ClsSc_StationInBill.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/流转卡管理/MES_StationInBill.cs 113 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/³µ¼ä¹ÜÀí/ClsSc_StationInBill.cs
@@ -323,9 +323,12 @@
        public override bool AddBill(ref string sReturn)
        {
            try
            {
            {
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                if (DBUtility.ClsPub.isLong(omodel.HInterID) == 0)
                {
                    omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //主表
@@ -390,7 +393,7 @@
                oCn.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_In " + omodel.HInterID.ToString() + ",1");
                
                //==================进站单启用配件清单绑定,则将 é…ä»¶æ¸…单写入  å®žé™…表. å¹¶è¿›è¡Œ ä¿å­˜å¼ºåˆ¶æŽ§åˆ¶
                //==================进站单启用配件清单绑定, è¿›è¡Œ ä¿å­˜å¼ºåˆ¶æŽ§åˆ¶
                //==============================
WorkM/Á÷ת¿¨¹ÜÀí/MES_StationInBill.cs
@@ -30,8 +30,9 @@
        public DAL.ClsSc_StationInBill BillNew = new DAL.ClsSc_StationInBill();
        public DAL.ClsSc_StationInBill BillOld = new DAL.ClsSc_StationInBill();
        public Int64 lngBillKey;
        public Int64 lngBillSubKey;
        public Int64 HInterID;//主内吗
        public Int64 lngBillKey; //流转卡ID
        public Int64 lngBillSubKey; //流转卡子ID
        public Int64 lngICMOEntryID;
        //-------------------------------------------------------------------------
@@ -191,11 +192,11 @@
            this.txtHStationInTime.Text = DBUtility.ClsPub.GetServerDate(-1);
            this.txtHBillNo.Text = ClsPub.CreateBillCode(BillNew.BillType, ref ClsPub.sExeReturnInfo, true);//得到新单号
            if (lngBillKey != 0 )
            {
                //LotShow();
            }
            this.HInterID = DBUtility.ClsPub.CreateBillID(this.ModName, ref DBUtility.ClsPub.sExeReturnInfo);
            //if (lngBillKey != 0 )
            //{
            //    //LotShow();
            //}
        }
        private void LotShow() //自动载入 æµè½¬å¡è¿›ç«™ç•Œé¢åŠŸèƒ½
@@ -561,7 +562,13 @@
                return false;
            //赋值ID
            if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify)
            {
                BillNew.omodel.HInterID = BillOld.omodel.HInterID;
            }
            else
            {
                BillNew.omodel.HInterID = HInterID;
            }
            //主类赋值
            //判断会计期是否合理
            string s = "";
@@ -1034,9 +1041,14 @@
                    Sub_WriteInForm_SM2(Ds.Tables[0], i);
                }
                //如果系统参数启用了 è¿›ç«™å•绑定配件清单则 ä»Žç”Ÿäº§ç”¨æ–™æ¸…单中获取工序BOM写入 ä¸´æ—¶è¡¨ï¼Œå¹¶åŠ è½½è¡¨æ ¼
                //刷新表体网格数据
                Pub_Class.ClsXt_SystemParameter oParam = new ClsXt_SystemParameter();
                string sIsBingLine = oParam.GetSingleSystemParameter("MES_StationInBill_LineBindCtl",ref DBUtility.ClsPub.sExeReturnInfo );
                if (sIsBingLine.Trim() == "Y")
                {
                    oCn.RunProc("exec h_p_MES_StationInBillSubBindSource_Insert " + lngBillKey.ToString() + " , " + lngBillSubKey.ToString() + "," + HInterID.ToString() + " ");
                    //刷新表体网格数据
                    DisplaySub();
                }
                //
                txtHGroupID.Focus();
            }
@@ -1452,18 +1464,77 @@
        //配件条形码 å›žè½¦äº‹ä»¶
        private void txtHBarCode_Mater_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            try
            {
                //先判断 ä¸´æ—¶è¡¨ä¸­æ˜¯å¦æœ‰æ•°æ®
                //判断条形码是否在条码档案中
                //判断条形码是否合理
                //写入 æ‰«ç è®°å½•表
                //刷新表体网格数据
                if (e.KeyCode == Keys.Return)
                {
                    if (txtHBarCode_Mater.Text.Trim() == "")
                    {
                        MessageBox.Show("请输入条形码!");
                        return;
                    }
                    string sBarCode = txtHBarCode_Mater.Text.Trim();
                    txtHBarCode_Mater.Text = "";
                    //判断条形码是否在条码档案中,判断条形码是否合理
                    //先判断 ä¸´æ—¶è¡¨ä¸­æ˜¯å¦æœ‰æ•°æ®ï¼Œæ¡å½¢ç çš„物料是否在清单中,写入 æ‰«ç è®°å½•表
                    //得到信息
                    SQLHelper.ClsCN oCn = new ClsCN();
                    DataSet Ds;
                    Ds = oCn.RunProcReturn("exec h_p_MES_StationInBillSub_BindBarCode   " + HInterID.ToString() + " ,'" + sBarCode + "'", "h_p_MES_StationInBillSub_BindBarCode");
                    //写入信息
                    if (Ds == null || Ds.Tables[0].Rows.Count == 0)
                    {
                        MessageBox.Show("未查询到条形码信息!");
                        return;
                    }
                    else if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 2)
                    {
                        MessageBox.Show("错误!" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][1]));
                        return;
                    }
                    //刷新表体网格数据(最好颜色显示)
                    DisplaySub();
                }
            }
            catch (Exception e1)
            {
                MessageBox.Show(e1.Message + "txtHBarCode_Mater_KeyDown");
            }
        }
        private void DisplaySub()
        {
            try
            {
                SQLHelper.ClsCN oCn = new ClsCN();
                DataSet Dsplay;
                Dsplay = oCn.RunProcReturn("exec h_p_MES_StationInBillSub_BindDisplay   " + HInterID.ToString() + "  ", "h_p_MES_StationInBillSub_BindDisplay");
                //写入信息
                if (Dsplay == null || Dsplay.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("刷新失败!");
                    return;
                }
                else
                {
                    grdSub.DataSource = Dsplay.Tables[0].DefaultView;
                    //设置合计列
                    //string sTotalCol = "";
                    //sTotalCol = DBUtility.Gy_BaseFun.GetTotalCols(DSet);
                    //string[] sT;
                    //sT = sTotalCol.Split(Convert.ToChar(","));
                    //oSumGrid.BuildTotalCols(sT);
                    //
                    //冻结
                    int FrCol = 0;
                    string s = "是";
                    DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name + "grdSub", s, FrCol);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message + "DisplaySub");
            }
        }
    }
}