wtt
2025-04-22 770c739aeadfd1025bd6b64aa6790201b0b1047d
WarM/²Ö¿â¹ÜÀí/Kf_SellOutBill_BarCodeNote.cs
@@ -29,6 +29,7 @@
        public Int64 HStockOrgID = DBUtility.ClsPub.HOrgID;
        public DateTime HDate = DateTime.Today;
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
        public DAL.ClsKf_SellOutBill BillOld = new DAL.ClsKf_SellOutBill();   //对应单据类
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        #region  //固定代码
@@ -53,6 +54,7 @@
            grdMain.DataSource = null;
            grdSub.DataSource = null;
            grdBarCode.DataSource = null;
            grdTM.DataSource = null;
        }
        //窗体加载
@@ -87,6 +89,7 @@
            DBUtility.Xt_BaseBillFun.initGridList(grdMain, this.Name);
            DBUtility.Xt_BaseBillFun.initGridList(grdSub, this.Name + "grdSub");
            DBUtility.Xt_BaseBillFun.initGridList(grdBarCode, this.Name + "grdBarCode");
            DBUtility.Xt_BaseBillFun.initGridList(grdTM, this.Name + "grdTM");
        }
@@ -126,6 +129,15 @@
            DBUtility.Xt_BaseBillFun.GraphicsGrid(grdBarCode);
        }
        private void grdTM_Paint(object sender, PaintEventArgs e)
        {
            GraphicsGridTM();
        }
        private void GraphicsGridTM()
        {
            DBUtility.Xt_BaseBillFun.GraphicsGrid(grdTM);
        }
        private Int32 Fun_GetCol(string sCol)
        {
            return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdMain);
@@ -139,6 +151,11 @@
        private Int32 Fun_GetBarCodeCol(string sCol)
        {
            return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdBarCode);
        }
        private Int32 Fun_GetTMCol(string sCol)
        {
            return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdTM);
        }
        //画线
@@ -161,6 +178,12 @@
            string s3 = frmCondition.cmbHComplete.Text;
            long n3 = 0;
            DBUtility.Xt_BaseBillFun.GraphLine(grdBarCode, MainIDCol3, SubIDCol3, s3, ref n3);
            int MainIDCol4 = Fun_GetTMCol("hmainid");
            int SubIDCol4 = Fun_GetTMCol("hsubid");
            string s4 = frmCondition.cmbHComplete.Text;
            long n4 = 0;
            DBUtility.Xt_BaseBillFun.GraphLine(grdTM, MainIDCol4, SubIDCol4, s4, ref n4);
        }
        //保存列宽
@@ -169,6 +192,7 @@
            DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name);
            DBUtility.Xt_BaseBillFun.SaveGrid(grdSub, this.Name + "grdSub");
            DBUtility.Xt_BaseBillFun.SaveGrid(grdBarCode, this.Name + "grdBarCode");
            DBUtility.Xt_BaseBillFun.SaveGrid(grdTM, this.Name + "grdTM");
        }
        //默认列宽
@@ -177,6 +201,7 @@
            DBUtility.Xt_BaseBillFun.DefaultGridView(grdMain, this.Name);
            DBUtility.Xt_BaseBillFun.DefaultGridView(grdSub, this.Name + "grdSub");
            DBUtility.Xt_BaseBillFun.DefaultGridView(grdBarCode, this.Name + "grdBarCode");
            DBUtility.Xt_BaseBillFun.DefaultGridView(grdTM, this.Name + "grdTM");
        }
        #endregion
@@ -298,42 +323,49 @@
                cmbHStockOrgID.Text = DSet.Tables[0].Rows[0]["销售组织"].ToString();
                cmbHBillStatus.Text = DSet.Tables[0].Rows[0]["单据状态"].ToString();
                txtHMoney.Text = DSet.Tables[0].Rows[0]["本单金额"].ToString();
                txtHCreditDifference.Text = DSet.Tables[0].Rows[0]["信息差额"].ToString();
                txtHCreditDifference.Text = DSet.Tables[0].Rows[0]["信用差额"].ToString();
                HInterID = DBUtility.ClsPub.isLong(DSet.Tables[0].Rows[0]["HInterID"]);
                txtHMaker.Text = DSet.Tables[0].Rows[0]["制单人"].ToString();
                txtHChecker.Text = DSet.Tables[0].Rows[0]["审核人"].ToString();
                //返回基本信息、码单信息
                grdMain.DataSource = DSet.Tables[1].DefaultView;
                grdBarCode.DataSource = DSet.Tables[2].DefaultView;
                grdTM.DataSource = DSet.Tables[3].DefaultView;
                //冻结
                int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text);
                string s = frmCondition.cmbHComplete.Text;
                DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s, FrCol);
                DBUtility.Xt_BaseBillFun.DisplayGrid(grdBarCode, this.Name + "grdBarCode", s, FrCol);
                DBUtility.Xt_BaseBillFun.DisplayGrid(grdTM, this.Name + "grdTM", s, FrCol);
                //画线
                GraphLine();
                //未审核
                if (cmbHBillStatus.Text == "已审核")
                {
                    sh.Enabled = false;
                    fsh.Enabled = true;
                    pic1.Visible = true;
                    pic1.Image = System.Drawing.Image.FromFile(DBUtility.ClsPub.AppPath + @"/Pic/Checked.jpg");
                }
                else if (cmbHBillStatus.Text == "已关闭")
                {
                    sh.Enabled = false;
                    fsh.Enabled = false;
                    pic1.Visible = true;
                    pic1.Image = System.Drawing.Image.FromFile(DBUtility.ClsPub.AppPath + @"/Pic/Closed.jpg");
                }
                else if (cmbHBillStatus.Text == "已作废")
                {
                    sh.Enabled = false;
                    fsh.Enabled = false;
                    pic1.Visible = true;
                    pic1.Image = System.Drawing.Image.FromFile(DBUtility.ClsPub.AppPath + @"/Pic/Deleted.jpg");
                }
                else
                {
                    sh.Enabled = true;
                    fsh.Enabled = false;
                    pic1.Visible = false;
                    pic1.Image = null;
                }
@@ -371,10 +403,40 @@
            else
            {
                cmbHBillStatus.Text="已审核";
                txtHChecker.Text = HMaker.ToString();
                sh.Enabled = false;
                fsh.Enabled = true;
                pic1.Visible = true;
                pic1.Image = System.Drawing.Image.FromFile(DBUtility.ClsPub.AppPath + @"/Pic/Checked.jpg");
                MessageBox.Show("审核成功!", "提示");
                return;
            }
        }
        #endregion
        #region  //反审核销售出库单
        private void fsh_Click(object sender, EventArgs e)
        {
            if(HInterID==0)
            {
                MessageBox.Show("请先选择对应销售出库单!", "提示");
                return;
            }
            if (BillOld.AbandonCheck(HInterID, ref DBUtility.ClsPub.sExeReturnInfo) == true)
            {
                cmbHBillStatus.Text = "创建";
                txtHChecker.Text = "";
                sh.Enabled = true;
                fsh.Enabled = false;
                pic1.Visible = false;
                pic1.Image = null;
                MessageBox.Show("反审核成功!", "提示");
                return;
            }
            else
            {
                MessageBox.Show("反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo, "提示");
                return;
            }
        }
@@ -452,6 +514,8 @@
                Report.FieldByName("单据状态").AsString = cmbHBillStatus.Text;
                Report.FieldByName("本单金额").AsString = txtHMoney.Text;
                Report.FieldByName("信用差额").AsString = txtHCreditDifference.Text;
                Report.FieldByName("制单人").AsString = txtHMaker.Text;
                Report.FieldByName("审核人").AsString = txtHChecker.Text;
            }
            catch (Exception e)
            {
@@ -479,11 +543,11 @@
        private void BarCodedy_Click(object sender, EventArgs e)
        {
            if (cmbHBillStatus.Text != "已审核")
            {
                MessageBox.Show("所选单据对应单据状态不为‘已审核’状态,不允许打印!", "提示");
                return;
            }
            //if (cmbHBillStatus.Text != "已审核")
            //{
            //    MessageBox.Show("所选单据对应单据状态不为‘已审核’状态,不允许打印!", "提示");
            //    return;
            //}
            //选择打印模板
            BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp();
            oFrm.sBillName = ModName;
@@ -533,6 +597,8 @@
                Report.FieldByName("单据状态").AsString = cmbHBillStatus.Text;
                Report.FieldByName("本单金额").AsString = txtHMoney.Text;
                Report.FieldByName("信用差额").AsString = txtHCreditDifference.Text;
                Report.FieldByName("制单人").AsString = txtHMaker.Text;
                Report.FieldByName("审核人").AsString = txtHChecker.Text;
            }
            catch (Exception e)
            {
@@ -566,5 +632,6 @@
        }
        #endregion
    }
}