ch
2022-05-30 f9ef44a67fbf73f073efe65600bc25e204fde04f
WarM/ÌõÂë´òÓ¡/Sc_ICMOToBarCode.cs
@@ -228,7 +228,7 @@
            DataSet DSet;
            DSet = oCn.RunProcReturn("Select * from gy_czygl Where czymc='" + HUserName + "'", "gy_czygl", ref DBUtility.ClsPub.sExeReturnInfo);
            DSet = oCn.RunProcReturn("Select HEmpID from gy_czygl Where czymc='" + HUserName + "'", "gy_czygl", ref DBUtility.ClsPub.sExeReturnInfo);
            
            if (DSet == null)
            //if (DSet == null|| DSet.Tables[0].Rows.Count == 0)
@@ -238,13 +238,13 @@
            }
            else
            {
                grdMain.DataSource = DSet.Tables[0].DefaultView;
                //grdMain.DataSource = DSet.Tables[0].DefaultView;
                //把当前单据ID å­˜åˆ°ä¸€ä¸ªæŒ‰é’®é‡Œé¢   åˆ·æ–°æ—¶æ¯æ¬¡å­˜ä¸€é
                if (DSet.Tables[0].Rows.Count > 0)
                {
                    txtHEmpID.Tag = DBUtility.ClsPub.isInt(DSet.Tables[0].Rows[0]["HEmpID"]);
                    txtHEmpID.Tag = DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[0]["HEmpID"]);
                }
                else
                {
@@ -748,62 +748,6 @@
            }
        }
        private void zf_Click(object sender, EventArgs e)
        {
            //Sub_AbandonCheck();
            if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName))
            {
                return;
            }
            if (grdMain.CurrentRow == null)
                return;
            DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl();
            if (MessageBox.Show("确定要作废所选条码?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
            {
                return;
            }
            for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++)
            {
                if (DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("HMaterID")].Value) != 0)
                {
                    if (!oBar.Cancelltion(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("条码编号")].Value)))
                    {
                        MessageBox.Show("作废失败!", "提示");
                        return;
                    }
                }
            }
            MessageBox.Show("作废成功!", "提示");
        }
        private void fzf_Click(object sender, EventArgs e)
        {
            //this.Sub_CheckBill();
            if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName))
            {
                return;
            }
            if (grdMain.CurrentRow == null)
                return;
            DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl();
            if (MessageBox.Show("确定要反作废所选条码?", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
            {
                return;
            }
            for (int i = 0; i <= grdMain.SelectedRows.Count - 1; i++)
            {
                if (DBUtility.ClsPub.isLong(grdMain.SelectedRows[i].Cells[Fun_GetCol("HMaterID")].Value) != 0)
                {
                    if (!oBar.UnCancelltion(DBUtility.ClsPub.isStrNull(grdMain.SelectedRows[i].Cells[Fun_GetCol("条码编号")].Value)))
                    {
                        MessageBox.Show("反作废失败!", "提示");
                        return;
                    }
                }
            }
            MessageBox.Show("反作废成功!", "提示");
        }
        private void cmdHSaveBill_Click(object sender, EventArgs e)
        {
@@ -1078,18 +1022,19 @@
                {
                    if (HZXQty > DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value))
                    {
                        //HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
                        //grdMain.Rows[i].Cells["本次数量"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
                        MessageBox.Show("请点击超额生产按钮生成条码!");
                        return;
                        HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
                        grdMain.Rows[i].Cells["本次数量"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
                        //MessageBox.Show("请点击超额生产按钮生成条码!");
                        //return;
                    }
                    else
                    {
                        //grdMain.Rows[i].Cells["本次数量"].Value = HZXQty;
                        grdMain.Rows[i].Cells["本次数量"].Value = HZXQty;
                        //
                        HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
                        grdMain.Rows[i].Cells["本次数量"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
                        //HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
                        //grdMain.Rows[i].Cells["本次数量"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["生产订单数量"].Value);
                    }
                }
                else
@@ -1756,14 +1701,17 @@
        private void cmdHSourceID_Click(object sender, EventArgs e)
        {
            Int64 HEmpID = 0;
            HEmpID = ClsPub.isLong(txtHEmpID.Tag);
            string HEmpName = "";
            HEmpName = ClsPub.isStrNull(txtHEmpID.Text);
            HEmpID = Convert.ToInt64(txtHEmpID.Tag);
            //MessageBox.Show(ClsPub.isStrNull(HEmpID));
            //string HEmpName = "";
            //HEmpName = ClsPub.isStrNull(txtHEmpID.Text);
            DAL.ClsGy_Source_View oSource = new DAL.ClsGy_Source_View();
            if (HEmpName != "")
            if (HEmpID != 0)
            {
                if (oSource.GetInfoByID(HEmpID))
                if (oSource.GetInfoByID_AoBang(HEmpID))
                {
                    this.txtHSourceID.Text = oSource.oModel.HName;
                    this.txtHSourceID.Tag = oSource.oModel.HItemID.ToString();
@@ -1981,6 +1929,7 @@
            grdList.DataSource = null;
            grdSub.DataSource = null;
            grdMain.DataSource = null;
            txtHEmpID.Tag = 0;
        }
        private void button2_Click(object sender, EventArgs e)