雅琪诺MES智能条码管理系统
zgq
2021-01-20 efe6576abc12737e898ead7b5d2307cf90faee58
Merge branch 'master' of http://101.37.171.70:10101/r/YqnMes
3个文件已修改
570 ■■■■■ 已修改文件
SCM.sln 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SCM/单据资料/Gy_BarCodeDetailList.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SCM/单据资料/Sc_ICMOReportToBarCode.cs 546 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SCM.sln
@@ -13,8 +13,6 @@
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model", "Model\Model.csproj", "{1EAB90A5-F2E0-4E1F-A787-ABE182EDB86E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DBUtility", "DBUtility\DBUtility.csproj", "{F2098F1B-4FA1-49BB-91EA-AB3522008F28}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
@@ -80,18 +78,6 @@
        {1EAB90A5-F2E0-4E1F-A787-ABE182EDB86E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
        {1EAB90A5-F2E0-4E1F-A787-ABE182EDB86E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
        {1EAB90A5-F2E0-4E1F-A787-ABE182EDB86E}.Release|x86.ActiveCfg = Release|Any CPU
        {F2098F1B-4FA1-49BB-91EA-AB3522008F28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {F2098F1B-4FA1-49BB-91EA-AB3522008F28}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {F2098F1B-4FA1-49BB-91EA-AB3522008F28}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
        {F2098F1B-4FA1-49BB-91EA-AB3522008F28}.Debug|Mixed Platforms.Build.0 = Debug|x86
        {F2098F1B-4FA1-49BB-91EA-AB3522008F28}.Debug|x86.ActiveCfg = Debug|x86
        {F2098F1B-4FA1-49BB-91EA-AB3522008F28}.Debug|x86.Build.0 = Debug|x86
        {F2098F1B-4FA1-49BB-91EA-AB3522008F28}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {F2098F1B-4FA1-49BB-91EA-AB3522008F28}.Release|Any CPU.Build.0 = Release|Any CPU
        {F2098F1B-4FA1-49BB-91EA-AB3522008F28}.Release|Mixed Platforms.ActiveCfg = Release|x86
        {F2098F1B-4FA1-49BB-91EA-AB3522008F28}.Release|Mixed Platforms.Build.0 = Release|x86
        {F2098F1B-4FA1-49BB-91EA-AB3522008F28}.Release|x86.ActiveCfg = Release|x86
        {F2098F1B-4FA1-49BB-91EA-AB3522008F28}.Release|x86.Build.0 = Release|x86
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
SCM/µ¥¾Ý×ÊÁÏ/Gy_BarCodeDetailList.cs
@@ -65,17 +65,7 @@
            if (!string.IsNullOrEmpty(textBox2.Text))
                whereBuilder.Append(" and b.FLOT_TEXT like ''%"+textBox2.Text+"%''");
            if (comboBox1.Text != "全部")
            {
                if(comboBox1.Text=="合格品")
                {
                    whereBuilder.Append(" and c.HProdLev=''''");
                }
                else
                {
                    whereBuilder.Append(" and c.HProdLev=''" + comboBox1.Text + "''");
                }
            }
            if (!string.IsNullOrEmpty(textBox4.Text))
                whereBuilder.Append(" and g.HName like ''%"+textBox4.Text+"%''");
            if (!string.IsNullOrEmpty(textBox5.Text))
SCM/µ¥¾Ý×ÊÁÏ/Sc_ICMOReportToBarCode.cs
@@ -1,5 +1,4 @@
<<<<<<< HEAD
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -540,549 +539,6 @@
                sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString();
                sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
                sDay = "0" + ClsPub.isDate(sDate).Day.ToString();
=======
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using gregn6Lib;
using Pub_Class;
using System.Threading;
using System.IO.Ports;
namespace SCM
{
    public partial class Sc_ICMOReportToBarCode : Form
    {
        public Sc_ICMOReportToBarCode()
        {
            InitializeComponent();
        }
        public frmBillQueryCondition_Base frmCondition;
        public string ModCaption = "成品分切在线检验";
        public string ModName = "Sc_ICMOReportToBarCode";
        public string HSourceBillTypeID = "";   //单据类型
        public string HSourceBillType = "";     //单据类型名称
        public string HSourceBillNo = "";
        public Int64 HSourceInterID = 0;
        public Int64 HSourceEntryID = 0;
        public int HTMCol = 0;
        public int HMaterIDCol = 1;
        Pub_Class.ClsGridListSum oSumGrid = new Pub_Class.ClsGridListSum();
        public Int32 iTopRow = 0;//画横线
        SCM.WMSWeb.WebService1 oWeb = new SCM.WMSWeb.WebService1();
        //
        #region  å›ºå®šä»£ç 
        //清空界面
        public void Sub_ClearBill()
        {
            //清空界面控件 for æŽ§ä»¶
            foreach (Control ct in gbUp.Controls)
            {
                switch (ct.GetType().Name)
                {
                    case "ComboBox":
                        ((ComboBox)ct).SelectedIndex = 0;
                        break;
                    case "TextBox":
                        ((TextBox)ct).Text = "";
                        break;
                    case "DateTimePicker":
                        ((DateTimePicker)ct).Value = DateTime.Today;
                        break;
                    default:
                        break;
                }
            }
            //
            txtHMaker.Text = ClsPub.CurUserName;
            initGrid();
        }
        private void Sc_ICMOReportToBarCode_Load(object sender, EventArgs e)
        {
            //设置动态URL
            oWeb.Url = SCM.ClsPub1.WEBSURL;
            //
            frmCondition = new frmBillQueryCondition_Base();
            this.Text = ModCaption;
            oSumGrid.ogrdMain = grdSub;  //初始化 new
            oSumGrid.oGridsum = grdSum;
            initGrid();
            //cmbHBillType.SelectedIndex = 0;
            //cmbHSourceBillType.SelectedIndex = 0;
            cmbFQMB.Items.Add(this.Text);
            cmbFQMB.SelectedIndex = 0;
            if(DBUtility.ClsPub.CurUserName.ToLower()=="admin")
            {
                txtHDQQty.ReadOnly = false;
                txtHKSQty.ReadOnly = false;
            }
        }
        //初始化网格
        private void initGrid()
        {
            ClsPub1.initGridList(grdMain, this.Name);
            ClsPub1.initGridList(grdSub, this.Name + "grdSub");
            ClsPub1.initGridFst(grdEmp, this.Name + "grdEmp");
            grdMain.RowTemplate.Height = 30;
            grdMain.RowTemplate.MinimumHeight = 30;
            grdMain.RowsDefaultCellStyle.Font = new Font("宋体", 15);
            grdMain.ReadOnly = true;
            grdSub.RowTemplate.Height = 30;
            grdSub.RowTemplate.MinimumHeight = 30;
            grdSub.RowsDefaultCellStyle.Font = new Font("宋体", 15);
            grdSub.ReadOnly = true;
            grdEmp.RowTemplate.Height = 30;
            grdEmp.RowTemplate.MinimumHeight = 30;
            grdEmp.RowsDefaultCellStyle.Font = new Font("宋体", 15);
            grdEmp.ReadOnly = false;
            //DBUtility.Xt_BaseBillFun.initGridList(grdMain, this.Name);
            //DBUtility.Xt_BaseBillFun.initGridList(grdSub, this.Name + "grdSub");
            DBUtility.Xt_BaseBillFun.GetGrid(grdMain, this.Name);
            DBUtility.Xt_BaseBillFun.GetGrid(grdSub, this.Name + "grdSub");
            DBUtility.Xt_BaseBillFun.GetGrid(grdEmp, this.Name + "grdEmp");
        }
        //时间控件
        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Enabled=false;
            Sub_ClearBill();
        }
        private void timer2_Tick(object sender, EventArgs e)
        {
            timer2.Enabled = false;
            //
            if (ClsIni.ReadIni("COMINFO", "txtPortName", DBUtility.ClsPub.AppPath + @"/HXERP.ini").Contains("没有找到")==false)
            {
                txtPortName.Text = ClsIni.ReadIni("COMINFO", "txtPortName", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
                txtBaudRate.Text = ClsIni.ReadIni("COMINFO", "txtBaudRate", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
                cmbParity.Text = ClsIni.ReadIni("COMINFO", "cmbParity", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
                txtDataBits.Text = ClsIni.ReadIni("COMINFO", "txtDataBits", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
                cmbStopBits.Text = ClsIni.ReadIni("COMINFO", "cmbStopBits", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
                txtHSend0.Text = ClsIni.ReadIni("COMINFO", "txtHSend0", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
                txtHSend.Text = ClsIni.ReadIni("COMINFO", "txtHSend", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
                txtHSourceID.Text = ClsIni.ReadIni("COMINFO", "txtHSourceID", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
                txtHSourceID.Tag = ClsIni.ReadIni("COMINFO", "txtHSourceIDTag", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
                this.Text = this.Text + "-" + txtHSourceID.Text;
            }
            //初始化串口
            ComDevice = new SerialPort();
            ComDevice.DataReceived += new SerialDataReceivedEventHandler(Com_DataReceived);//绑定事件
            string[] PortNames = SerialPort.GetPortNames();
            //打开串口
            OpenCom();
        }
        //退出
        private void tc_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        private void grdMain_Paint(object sender, PaintEventArgs e)
        {
            GraphicsGrid();
        }
        private void GraphicsGrid()
        {
            //画底线
            DBUtility.Xt_BaseBillFun.GraphicsGrid(grdMain);
            //画横线
            DBUtility.Xt_BaseBillFun.GraphicsRowGrid(grdMain, iTopRow, iTopRow + 50, Fun_GetCol("hmainid"));
        }
        private Int32 Fun_GetCol(string sCol)
        {
            return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdMain);
        }
        //保存列宽
        private void bclk_Click(object sender, EventArgs e)
        {
            DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name);
            DBUtility.Xt_BaseBillFun.SaveGrid(grdSub, this.Name + "grdSub");
            DBUtility.Xt_BaseBillFun.SaveGrid(grdEmp, this.Name + "grdEmp");
        }
        //默认列宽
        private void mrlk_Click(object sender, EventArgs e)
        {
            DBUtility.Xt_BaseBillFun.DefaultGridView(grdMain, this.Name);
            DBUtility.Xt_BaseBillFun.DefaultGridView(grdSub, this.Name + "grdSub");
            DBUtility.Xt_BaseBillFun.DefaultGridView(grdEmp, this.Name + "grdEmp");
        }
        #endregion
        #region è¿”回源单信息
        private void xd_Click(object sender, EventArgs e)
        {
        }
        private void Display(string SourceBillType, Int64 HSourceBillInterID, Int64 HSourceBillEntryID)
        {
            DataSet Ds;
            //生产订单
            if (SourceBillType == "生产订单")
            {
                //得到信息
                Ds = oWeb.getDataSetBySQL("select * from h_v_IFCLD_ICMOList where hmainid=" + HSourceBillInterID + " and hsubid=" + HSourceBillEntryID, "h_v_IFCLD_ICMOList", ref DBUtility.ClsPub.sExeReturnInfo);
                //写入信息
                Sub_WriteInForm(Ds.Tables[0], 0);
            }
            //收料通知单
            if (SourceBillType == "收料通知单")
            {
                //得到信息
                Ds = oWeb.getDataSetBySQL("select * from h_v_IF_POInStockList where hmainid=" + HSourceBillInterID + " and hsubid=" + HSourceBillEntryID, "h_v_IF_POInStockList", ref DBUtility.ClsPub.sExeReturnInfo);
                //写入信息
                Sub_WriteInForm(Ds.Tables[0], 0);
            }
            //生产汇报单
            if (SourceBillType == "生产汇报单")
            {
                //得到信息
                Ds = oWeb.getDataSetBySQL("select * from h_v_IF_ICMOReportBillList where hmainid=" + HSourceBillInterID + " and hsubid=" + HSourceBillEntryID, "h_v_IF_POInStockList", ref DBUtility.ClsPub.sExeReturnInfo);
                //写入信息
                Sub_WriteInForm(Ds.Tables[0], 0);
            }
        }
        //根据TABLE写入界面
        private void Sub_WriteInForm(DataTable oTable, int i)
        {
            try
            {
                txtHSourceBillNo.Text = oTable.Rows[0]["单据号"].ToString();
                txtHMaterNumber.Text = oTable.Rows[0]["物料代码"].ToString();
                txtHOldMaterNumber.Text = oTable.Rows[0]["旧物料编码"].ToString();
                txtHMaterNumber.Tag = oTable.Rows[0]["HMaterID"].ToString();
                txtHMaterName.Text = oTable.Rows[0]["物料名称"].ToString();
                txtHMaterName.Tag = oTable.Rows[0]["HMaterID"].ToString();
                txtHMaterModel.Text = oTable.Rows[0]["规格型号"].ToString();
                txtHUnitName.Text = oTable.Rows[0]["计量单位"].ToString();
                txtHUnitName.Tag = oTable.Rows[0]["HUnitID"].ToString();
                txtHBatchNo.Text = oTable.Rows[0]["批次"].ToString();
                txtHSumQty.Text = oTable.Rows[0]["数量"].ToString();
                txtHRelationQty.Text = oTable.Rows[0]["已生成条码数量"].ToString();
                txtHSYQty.Text = oTable.Rows[0]["未生成条码数量"].ToString();
                txtHKSQty.Text = lblHNowQty.Text;
                txtHDQQty.Text = lblHNowQty.Text;
                if (DBUtility.ClsPub.isDoule(txtHDQQty.Text) - DBUtility.ClsPub.isDoule(txtHKSQty.Text)>0)
                {
                    txtHSJQty.Text = DBUtility.ClsPub.isDoule(DBUtility.ClsPub.isDoule(txtHDQQty.Text) - DBUtility.ClsPub.isDoule(txtHKSQty.Text), 1);
                }
                else
                {
                    txtHSJQty.Text = "0";
                }
                DisplayMain();
                //DisplaySub();
            }
            catch(Exception e)
            {
                MessageBox.Show("读取失败!" + e.Message);
            }
        }
        private void DisplayMain()
        {
            DataSet DSet;
            string sSql = "";
            string sWhere = "";
            //过滤条件
            sSql = " exec h_p_Sc_ICMOReportToBarCode_All   '" + HSourceBillTypeID + "'," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString();
            //
            DSet = oWeb.getDataSetBySQL(sSql, "h_p_Sc_ICMOReportToBarCode_All", ref DBUtility.ClsPub.sExeReturnInfo);
            //生成首行标题
            if (DSet == null)
            {
                MessageBox.Show("没有返回任何结果,尝试再次查询!" + DBUtility.ClsPub.sExeReturnInfo);
                return;
            }
            //
            if (DSet.Tables[0].Rows.Count>0)
            {
                grdMain.DataSource = DSet.Tables[0].DefaultView;
            }
            //冻结
            int FrCol = DBUtility.ClsPub.isInt(0);
            string s = "是";
            ClsPub1.DisplayGrid(grdMain, this.Name, s, FrCol);
            //画线
            //Total();
            ///////////////////////////////////////////
            if (DSet.Tables[1].Rows.Count > 0)
            {
                grdSub.DataSource = DSet.Tables[1].DefaultView;
            }
            //冻结
            ClsPub1.DisplayGrid(grdSub, this.Name + "grdSub", s, FrCol);
            /////////////////////////////
            txtHRelationQty.Text = DBUtility.ClsPub.isDoule(DSet.Tables[2].Rows[0]["关联数量"], 1);
            if(DBUtility.ClsPub.isDoule(txtHSumQty.Text) - DBUtility.ClsPub.isDoule(txtHRelationQty.Text)>=0)
            {
                txtHSYQty.Text = DBUtility.ClsPub.isDoule(DBUtility.ClsPub.isDoule(txtHSumQty.Text) - DBUtility.ClsPub.isDoule(txtHRelationQty.Text), 1);
            }
            else
            {
                txtHSYQty.Text = "0";
            }
            //////////////////////////
        }
        private void DisplaySub()
        {
            DataSet DSet;
            string sSql = "";
            string sWhere = "";
            //过滤条件
            sSql = " exec h_p_Sc_ICMOReportToBarCode_Sub   '" + HSourceBillTypeID + "'," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString();
            //
            DSet = oWeb.getDataSetBySQL(sSql, "h_p_Sc_ICMOReportToBarCode_Sub", ref DBUtility.ClsPub.sExeReturnInfo);
            //生成首行标题
            if (DSet == null)
            {
                MessageBox.Show("没有返回任何结果,尝试再次查询!" + DBUtility.ClsPub.sExeReturnInfo);
                return;
            }
            //
            grdSub.DataSource = DSet.Tables[0].DefaultView;
            //冻结
            int FrCol = DBUtility.ClsPub.isInt(0);
            string s = "是";
            ClsPub1.DisplayGrid(grdSub, this.Name + "grdSub", s, FrCol);
            //画线
            //Total();
        }
        #endregion
        #region  //打印设置
        GridppReport Report;
        string sBarCode = "";
        //预览
        int CurRows = 0;
        #endregion
        #region ç•Œé¢æŽ§ä»¶å¤„理
        private void cmdHDeptID_Click(object sender, EventArgs e)
        {
            SCM.ClsIF_Department_View oDept = new SCM.ClsIF_Department_View();
            string sWhere = "";
            if (oDept.RefreshView(sWhere))
            {
                this.txtHDeptID.Text = oDept.oModel.HName;
                this.txtHDeptID.Tag = oDept.oModel.HItemID.ToString();
            }
            else
            {
                this.txtHDeptID.Text = "";
            }
        }
        private void txtHDeptID_TextChanged(object sender, EventArgs e)
        {
            BLL.ClsPub_BLL.Sub_ClearText(txtHDeptID);
        }
        #endregion
        //选择源单
        private void cmdHSourceBillNo_Click(object sender, EventArgs e)
        {
            Gy_SourceBillList_Touch oGy_SourceBillList_Touch = new Gy_SourceBillList_Touch();
            oGy_SourceBillList_Touch.HSourceBillType = HSourceBillType;//类型名称
            oGy_SourceBillList_Touch.ShowDialog();
            if (oGy_SourceBillList_Touch.OKTag == 1)
            {
                //根据选中的源单内码和子内码,返回相应信息
                HSourceEntryID = oGy_SourceBillList_Touch.HSelEntryID;
                HSourceInterID = oGy_SourceBillList_Touch.HSelInterID;
                HSourceBillTypeID = oGy_SourceBillList_Touch.HSourceBillTypeID;
                HSourceBillNo = oGy_SourceBillList_Touch.HSourceBillNo;
                Display(HSourceBillType, oGy_SourceBillList_Touch.HSelInterID, oGy_SourceBillList_Touch.HSelEntryID);
            }
            else
            {
                HSourceEntryID = 0;
                HSourceInterID = 0;
                HSourceBillTypeID = "";
                HSourceBillNo = "";
            }
        }
        //
        private void cmdCancel_Click(object sender, EventArgs e)
        {
            CloseCom();
            this.Close();
        }
        private void label19_Click(object sender, EventArgs e)
        {
        }
        public bool SaveBill(string sType)
        {
            try
            {
                int LSHlen = 2;             //流水号长度
                int SumLen = 10;            //总长度
                string TM = "";             //条码
                string HNumber = "";        //物料代码
                double HSumQty = 0;         //产品数量
                double HMinQty = 0;         //最小包装数
                int HBQty = 0;              //箱数
                double HQty = 0;            //数量
                string WeiShu = "";         //尾数
                int LSH = 0;                //流水号
                string LSH2 = "";           //流水号转换成字符
                string sDate = "";          //日期
                string sYear = "";          //å¹´
                string sPeriod = "";        //月
                string sDay = "";           //日
                string HBatchNo = "";       //批次
                int k = 0;
                int n = 0;                  //同一批生成条码中的第几条
                string sTMNumber = "";      //条码自定义前缀
                DataSet Ds;
                //
                string HWei = "";      //尾数
                HBarCode = "";
                string HBarCodeType = "";
                Int64 HMaterID = 0;
                Int64 HAuxPropID = 0;
                Int64 HUnitID = 0;
                double HQty2 = 0;
                string HBatchNo2 = "";
                Int64 HSupID = 0;
                Int64 HGroupID = 0;
                int HPrintQty = 0;
                Int64 HBarcodeNo = 0;       //托号
                Int64 HBarcodeQtys = 0;     //总托数
                Int64 HDeptID = 0;
                Int64 HWhID = 0;
                Int64 HSPID = 0;
                string HRemark = "";
                string HMaterName = "";
                string HMaterModel = "";
                string HPinfan = "";
                string HMTONo = "";
                Int64 HCusID = 0;
                string HCusType = "";
                DateTime HEndDate;
                string HWorkLineName = "";
                DateTime HBeginDate;
                string HSeOrderBillNo = "";
                string HJiaYe2 = "";
                string HPressModel = "";
                string HCusModel = "";
                string HMaterialModel = "";
                string HColor = "";
                string HLogo = "";
                string HPackageSize = "";
                double HMaterialJQty = 0;
                double HMaterialMQty = 0;
                string HCustomBatchNo = "";
                string HGBBarCode = "";
                string POOrderBillNo = "";
                //
                cmdHSaveBill.Enabled = false;
                //判断是否存在 æºå•信息;
                if (HSourceInterID <= 0 || HSourceEntryID <= 0 || DBUtility.ClsPub.isLong(txtHMaterName.Tag) <= 0 || DBUtility.ClsPub.isLong(txtHUnitName.Tag) <= 0)//判断是否有源单
                {
                    MessageBox.Show("没有选单!");
                    cmdHSaveBill.Enabled = true;
                    return false;
                }
                if (DBUtility.ClsPub.isDoule(txtHDQQty.Text) - DBUtility.ClsPub.isDoule(txtHKSQty.Text) >= 0)
                {
                    txtHSJQty.Text = DBUtility.ClsPub.isDoule(DBUtility.ClsPub.isDoule(txtHDQQty.Text) - DBUtility.ClsPub.isDoule(txtHKSQty.Text), 1); //实际米数= å½“前米数-开始米数
                    lblHRelQty.Text = txtHSJQty.Text;
                }
                else
                {
                    if (MessageBox.Show("当前米数小于开始米数,是否确定要清零开始米数", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                    {
                        txtHKSQty.Text = "0";
                        txtHSJQty.Text = DBUtility.ClsPub.isDoule(DBUtility.ClsPub.isDoule(txtHDQQty.Text), 1); //实际米数= å½“前米数-开始米数
                        lblHRelQty.Text = txtHSJQty.Text;
                    }
                }
                if (DBUtility.ClsPub.isDoule(txtHSJQty.Text) <= 0)
                {
                    MessageBox.Show("当前数量不能小于等于0!");
                    cmdHSaveBill.Enabled = true;
                    return false;
                }
                //if (DBUtility.ClsPub.isDoule(txtHSYQty.Text) <= 0)
                //{
                //    MessageBox.Show("剩余数量已经为0,不能在裁切!");
                //    cmdHSaveBill.Enabled = true;
                //    return false;
                //}
                if (DBUtility.ClsPub.isLong(txtHEmpID.Tag) == 0 || DBUtility.ClsPub.isLong(txtHEmpID2.Tag) == 0 )
                {
                    MessageBox.Show("职员1或者职员2没有选择!");
                    cmdHSaveBill.Enabled = true;
                    return false;
                }
                if (DBUtility.ClsPub.isLong(txtHGroupID.Tag) == 0 )
                {
                    MessageBox.Show("班组没有选择!");
                    cmdHSaveBill.Enabled = true;
                    return false;
                }
                //根据源单 ç”Ÿæˆæ¡å½¢ç  å¹¶ä¿å­˜å¦‚数据库
                HNumber = DBUtility.ClsPub.isStrNull(txtHMaterName.Tag);
                HBatchNo = DBUtility.ClsPub.isStrNull(txtHBatchNo.Text);
                sDate = dtpHDate.Value.ToShortDateString();
                sYear = ClsPub.isDate(sDate).Year.ToString().Substring(2, 2);
                sPeriod = "0" + ClsPub.isDate(sDate).Month.ToString();
                sPeriod = sPeriod.Substring(sPeriod.Length - 2, 2);
                sDay = "0" + ClsPub.isDate(sDate).Day.ToString();
>>>>>>> parent of d95a654 (nothing)
                sDay = sDay.Substring(sDay.Length - 2, 2);
                //条码前缀 = ç»„织代码 + ç‰©æ–™å†…码 + å¹´ + æœˆ + æ—¥