From c2a0693fb9c718f29a62e3add2fac4c722cb314a Mon Sep 17 00:00:00 2001
From: ouyangqing <ouyangqing@DESKTOP-B85SG1D>
Date: 星期三, 27 一月 2021 13:21:59 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/YqnMes

---
 SCM/生产管理/Sc_PackUnionBillList.cs |   83 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 82 insertions(+), 1 deletions(-)

diff --git "a/SCM/\347\224\237\344\272\247\347\256\241\347\220\206/Sc_PackUnionBillList.cs" "b/SCM/\347\224\237\344\272\247\347\256\241\347\220\206/Sc_PackUnionBillList.cs"
index 5617b37..d40b573 100644
--- "a/SCM/\347\224\237\344\272\247\347\256\241\347\220\206/Sc_PackUnionBillList.cs"
+++ "b/SCM/\347\224\237\344\272\247\347\256\241\347\220\206/Sc_PackUnionBillList.cs"
@@ -4,7 +4,9 @@
 using System.Data;
 using System.Drawing;
 using System.Text;
+using System.Threading;
 using System.Windows.Forms;
+using gregn6Lib;
 using Pub_Class;
 
 namespace SCM
@@ -206,6 +208,85 @@
                 return false;
             }
         }
-        
+
+        //鎵撳嵃
+        GridppReport Report;
+        private void btnFQBD_Click(object sender, EventArgs e)
+        {
+            string sOpenTmp="鍦ㄧ嚎鎵撳寘";
+            if (!Sub_SetReportList(sOpenTmp))
+            {
+                return;
+            }
+            Report.PrintPreview(false);
+            Thread.Sleep(500);
+        }
+        protected double AllQty = 0;
+        protected string str = "";
+        private bool Sub_SetReportList(string sOpenTmp)
+        {
+            //鍒ゆ柇琛屾暟
+            for (int i = 0; i < grdMain.Rows.Count; i++)
+            {
+                grdMain.Rows[i].Cells[0].Value = "";
+            }
+            for (int i = 0; i < grdMain.SelectedRows.Count; i++)
+            {
+                grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[0].Value = "*";
+                AllQty += DBUtility.ClsPub.isDoule(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[Fun_GetCol("鏁伴噺")].Value);
+                //鍒ゆ柇澶氳琛ユ墦鏃跺寘瑁呭崟鍙锋槸鍚﹀敮涓�
+                string str2 = DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[Fun_GetCol("鍖呰鍗曞彿")].Value);
+                if (i==0)
+                {
+                    str = str2;
+                }
+                else if (i>0)
+                {
+                    if (!str.Equals(str2))
+                    {
+                        str = "";
+                        MessageBox.Show("鍖呰鍗曞彿涓嶅敮涓�锛岃閲嶆柊閫夋嫨锛�");
+                        return false;
+                    }
+                }
+            }
+            Report = new GridppReport();
+            Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf");  //here .
+            Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecordList);
+            Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTableList);
+            //Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd);
+            return true;
+        }
+
+        private void ReportBeforePostRecordList()
+        {
+            try
+            {
+                //Report.FieldByName("婧愬崟鍗曞彿").AsString = DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.CurrentCell.RowIndex].Cells[Fun_GetCol("鍖呰鍗曞彿")].Value);
+                //Report.FieldByName("鍒跺崟浜�").AsString = DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.CurrentCell.RowIndex].Cells[Fun_GetCol("鍒跺崟浜�")].Value);
+                //Report.FieldByName("鍒跺崟鏃ユ湡").AsString = DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.CurrentCell.RowIndex].Cells[Fun_GetCol("鍒跺崟鏃ユ湡")].Value);
+                Report.FieldByName("婧愬崟鍗曞彿").AsString = DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.CurrentCell.RowIndex].Cells[Fun_GetCol("鐢熶骇璁㈠崟鍙�")].Value);
+                //Report.FieldByName("婧愬崟绫诲瀷").AsString = DBUtility.ClsPub.isStrNull(grdMain.Rows[grdMain.CurrentCell.RowIndex].Cells[Fun_GetCol("婧愬崟绫诲瀷")].Value);
+                Report.FieldByName("鎬婚噸閲�").AsString = DBUtility.ClsPub.isStrNull(AllQty);
+                AllQty = 0;
+            }
+            catch (Exception e)
+            {
+                MessageBox.Show("鎵撳嵃澶辫触!琛ㄥご锛�" + e.Message);
+            }
+        }
+
+        private void ReportFetchRecordByDataTableList()
+        {
+            try
+            {
+                DataTable ds = new DataTable();
+                SCM.Utility.FillRecordToReport(Report, grdMain, ds, Fun_GetCol("閫夋嫨"));
+            }
+            catch (Exception e)
+            {
+                MessageBox.Show("鎵撳嵃澶辫触!琛ㄤ綋锛�" + e.Message);
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1