From 4b7c59e6042aeb0908b43a7bae53d15c47a674c0 Mon Sep 17 00:00:00 2001
From: jingh <jingh@LAPTOP-I53VDLOO>
Date: 星期三, 14 四月 2021 14:58:30 +0800
Subject: [PATCH] 条码生成

---
 SCM/条码打印/Gy_BarCodeBill.cs |  138 ++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 132 insertions(+), 6 deletions(-)

diff --git "a/SCM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs" "b/SCM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
index 09cde9b..c26e1a7 100644
--- "a/SCM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
+++ "b/SCM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
@@ -185,9 +185,10 @@
         public Int64 HOrgID = -1;
         public string HOrgNumber = "";
         public string CampanyName = ""; //瀹㈡埛瀹氬埗鍖栧悕绉�
-        //-------------------------------------------------------------------------
+        public Int64 HInterID = 0;      //鍐呯爜
+                                        //-------------------------------------------------------------------------
         #region 鍥哄畾浠g爜
-         
+
         //娓呯┖鐣岄潰
         public void Sub_ClearBill()
         {
@@ -643,6 +644,13 @@
         //淇濆瓨鍗曟嵁
         private bool Sub_SaveBill()
         {
+            //鑾峰彇鍐呯爜
+            if (!oWeb.get_MaxBillID(ModName, ref HInterID, ref DBUtility.ClsPub.sExeReturnInfo))
+            {
+                MessageBox.Show("鑾峰彇鍐呯爜澶辫触锛岃閲嶆柊鐐瑰嚮鐢熸垚鎸夐挳鐢熸垚鏉$爜锛�");
+                return false;
+            }
+            //
             HOrgID = oWeb.get_ORGANIZATIONSIDByName(cmbHOrgID.Text);
             HOrgNumber = oWeb.get_ORGANIZATIONSNOByName(cmbHOrgID.Text);
             if (HOrgID == -1)
@@ -1472,7 +1480,7 @@
                         POOrderBillNo = ClsPub.isStrNull(grdSub.Rows[i].Cells[POOrderBillNo2Col].Value);
                         HSellMaterName = ClsPub.isStrNull(grdSub.Rows[i].Cells[HSellMaterName2Col].Value);
                         HSellBillNo = ClsPub.isStrNull(grdSub.Rows[i].Cells[HSellBillNo2Col].Value);
-                        sSQLMul[mm] = "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
+                        sSQLMul[mm] = "insert into Gy_BarCodeBill (HinterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" +
                                     ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                     ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
                                     ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
@@ -1483,7 +1491,7 @@
                                     ",POOrderBillNo " +
                                     ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HSellMaterName,HSellBillNo " +
                                     ") values ("
-                                    + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
+                                    + HInterID.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
                                     + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString()
                                     + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'"
                                     + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
@@ -1948,8 +1956,50 @@
             DBUtility.Xt_BaseBillFun.GetGrid(grdMain, this.Name);
             DBUtility.Xt_BaseBillFun.GetGrid(grdSub, this.Name + "grdSub");
             grdSub.SelectionMode = DataGridViewSelectionMode.FullRowSelect;                     //閫夎妯″紡
+
+            ////
+            ClsPub1.initGridList(grdList, this.Name + "grdList");
+
+
         }
-        
+
+
+
+
+        private void Display()
+        {
+            //ClsCN SubCn = new ClsCN();
+            DataSet DSet;
+            string sSql = "";
+            string sWhere = "";
+            //杩囨护鏉′欢  
+            if (HInterID <= 0)
+            {
+                return;
+            }
+            //
+            DSet = oWeb.getDataSetBySQL("select * from h_v_IF_BarCodeBillList Where HinterID=" + HInterID.ToString(), "h_v_IF_BarCodeBillList", ref DBUtility.ClsPub.sExeReturnInfo);
+            //DSet = SubCn.RunProcReturn(sSql, ViewName, ref DBUtility.ClsPub.sExeReturnInfo);
+            //鐢熸垚棣栬鏍囬
+            if (DSet == null)
+            {
+                MessageBox.Show("娌℃湁杩斿洖浠讳綍缁撴灉,鏉$爜涓嶅瓨鍦紒" + DBUtility.ClsPub.sExeReturnInfo);
+                return;
+            }
+            //
+            grdList.DataSource = DSet.Tables[0].DefaultView;
+            //鍐荤粨
+            int FrCol = 0;
+            string s = "鏄�";
+            ClsPub1.DisplayGrid(grdList, this.Name + "grdList", s, FrCol);
+            //鐢荤嚎
+            //GraphLine();
+
+
+            // 
+        }
+
+
         //鍏紡閲嶇畻
         private void RowCount(int sRow, int sTag)
         {
@@ -2944,6 +2994,55 @@
             }
         }
 
+
+        //濉叆鍗曟嵁琛ㄥご淇℃伅
+        private void ReportBeforePostRecord_WB()// 
+        {
+            try
+            {
+                //Report.FieldByName("鐗╂枡浠g爜").AsString = ClsPub.isStrNull(grdSub.Rows[CurRows].Cells[HMaterNumber2Col].Value);
+                //Report.FieldByName("鐗╂枡鍚嶇О").AsString = ClsPub.isStrNull(grdSub.Rows[CurRows].Cells[HMaterName2Col].Value);
+                //Report.FieldByName("瑙勬牸鍨嬪彿").AsString = ClsPub.isStrNull(grdSub.Rows[CurRows].Cells[HMaterModel2Col].Value);
+                ////Report.FieldByName("鑷畾涔夎鏍�").AsString = ClsPub.isStrNull(grdSub.Rows[CurRows].Cells[HModel2Col].Value);
+                //Report.FieldByName("鏉$爜缂栧彿").AsString = ClsPub.isStrNull(grdSub.Rows[CurRows].Cells[HTMCol].Value);
+                //Report.FieldByName("鏁伴噺").AsString = ClsPub.isStrNull(grdSub.Rows[CurRows].Cells[HQty2Col].Value);
+                //Report.FieldByName("婧愬崟鍗曞彿").AsString = ClsPub.isStrNull(grdSub.Rows[CurRows].Cells[HSourceBillNoCol].Value);
+                //Report.FieldByName("閿�鍞鍗曞彿").AsString = ClsPub.isStrNull(grdSub.Rows[CurRows].Cells[HSeOrderBillNo2Col].Value);
+                //Report.FieldByName("鐢熶骇杞﹂棿").AsString = ClsPub.isStrNull(grdSub.Rows[CurRows].Cells[HDeptName2Col].Value);
+                //Report.FieldByName("澶囨敞").AsString = ClsPub.isStrNull(grdSub.Rows[CurRows].Cells[HRemark2Col].Value);
+            }
+            catch (Exception e)
+            {
+                MessageBox.Show("鎵撳嵃澶辫触!琛ㄥご锛�" + e.Message);
+            }
+        }
+
+        private void ReportFetchRecordByDataTable_WB()
+        {
+            try
+            {
+                DataTable ds = new DataTable(); 
+                SCM.Utility.FillRecordToReport(Report, grdList, ds, 0);
+            }
+            catch (Exception e)
+            {
+                MessageBox.Show("鎵撳嵃澶辫触!琛ㄤ綋锛�" + e.Message);
+            }
+        }
+
+
+        private void Sub_SetReport_WB(string sOpenTmp)
+        {
+            //鍒ゆ柇琛屾暟
+            //
+            Report = new GridppReport();
+            Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf");  //here .
+            Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord_WB);
+            Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable_WB);
+            //Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd_WB);
+        }
+
+
         private void dy_Click(object sender, EventArgs e)
         {
             //鍒ゆ柇鏄惁宸茬粡鐢熸垚鏉$爜
@@ -3179,7 +3278,34 @@
 
         }
 
-        
+        private void wbdy_Click(object sender, EventArgs e)
+        {
+            //鍒ゆ柇鏄惁宸茬粡鐢熸垚鏉$爜
+            if (DBUtility.ClsPub.isStrNull(grdList.Rows[0].Cells[1].Value) == "")
+            {
+                MessageBox.Show("鏉$爜鏈敓鎴愶紝璇峰厛鐢熸垚鏉$爜鍚庡啀鎵撳嵃锛�");
+                return;
+            }
 
+            ////鎵撳嵃鍓嶅垽鏂潯鐮佹槸鍚﹀凡鎵撳嵃杩�
+            //if (ReportPrintBegin())
+            //{
+            //    return;
+            //}
+
+            //鏍规嵁瀹㈡埛绫诲瀷鎵惧埌瀵瑰簲鎵撳嵃妯℃澘杩涜寰幆鎵撳嵃
+            for (int i = 0; i < grdList.Rows.Count; i++)
+            {
+                //鑾峰彇褰撳墠琛岀殑瀹㈡埛绫诲瀷 骞舵壘鍒� 瀵瑰簲 妯℃澘
+
+
+                //
+                Sub_SetReport_WB("");
+                Report.Print(true);
+                Thread.Sleep(1000); 
+            }
+
+
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1