zzr99
2022-02-16 b6df3c3b0da45b6a70dd8ea152e8ea4293740a64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
using gregn6Lib;
using Pub_Class;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
 
namespace WarM
{
    public partial class Gy_BarCodeBill_ChaiMa : Form
    {
        public Gy_BarCodeBill_ChaiMa()
        {
            InitializeComponent();
        }
 
        //定义列
        public const Int16 HTagCol = 0;
        public const Int16 HSnoCol = 1;
        public const Int16 HInterID = 2;
        public const Int16 HBarCode = 3;
        public const Int16 HQty = 4;
        public const Int16 HNum = 5;
        public const Int16 HMaterCol = 6;
        public const Int16 HMaterName = 7;
        public const Int16 HMaterMould = 8;
        public const Int16 HBatchNo =9;
        //=======================================================================
        public const Int16 HTagCol2 = 0;
        public const Int16 HSnoCol2 = 1;
        public const Int16 HInterID2 = 2;
        public const Int16 HBarCode2 = 3;
        public const Int16 HQty2 = 4;
        public const Int16 HNum2 = 5;
        public const Int16 HMaterCol2 = 6;
        public const Int16 HMaterName2 = 7;
        public const Int16 HMaterMould2 = 8;
        public const Int16 HBatchNo2 = 9;
 
        public const string ModName = "3302";                   //单据类型
        public const string ModCaption = "条码拆码";          //单据名称
        public const string ModRightName = "Gy_BarCodeBill_ChaiMa";
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;     //单据状态(新增,修改,浏览,更新单价,变更)
        ClsGridViewSum oSumGrid_Mater = new ClsGridViewSum();
        ClsGridViewSum oSumGrid_Pay = new ClsGridViewSum();
        public DAL.ClsGy_BarCodeBill_ChaiMa BillNew = new DAL.ClsGy_BarCodeBill_ChaiMa();   //对应单据类
        public DAL.ClsGy_BarCodeBill_ChaiMa BillOld = new DAL.ClsGy_BarCodeBill_ChaiMa();   //对应单据类
 
        //清空界面
        public void Sub_ClearBill()
        {
            DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp);
            //
            txtHMaker.Text = DBUtility.ClsPub.CurUserName;
            initGrid();
            initGrid_Pay();
            oSumGrid_Mater.NoCol = HSnoCol;
            oSumGrid_Pay.NoCol = HSnoCol2;
        }
 
        #region 窗体处理方法
        //初始化页签1数据
        private void intoDate()
        {
            try
            {
                DataSet Ds;
                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                Ds = oCn.RunProcReturn("select * from h_v_Gy_BarCodeBill_ChaiMa", "h_v_Gy_BarCodeBill_ChaiMa");
                grdMain.DataSource = Ds.Tables[0].DefaultView;
 
            }
            catch (Exception ex )
            {
                MessageBox.Show(ex.Message.ToString());
            }
            
        }
 
        //初始化页签1
        private void initGrid()
        {
            grdMain.ColumnCount = 10;                       //总列数
            DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name + "1");
            grdMain.Columns[HSnoCol].HeaderText = "序号";
            grdMain.Columns[HInterID].HeaderText = "HInterID";
            grdMain.Columns[HBarCode].HeaderText = "条码编号";
            grdMain.Columns[HQty].HeaderText = "条码数量";
            grdMain.Columns[HNum].HeaderText = "拆分数量";
            grdMain.Columns[HMaterCol].HeaderText = "物料代码";
            grdMain.Columns[HMaterName].HeaderText = "物料名称";
            grdMain.Columns[HMaterMould].HeaderText = "规格型号";
            grdMain.Columns[HBatchNo].HeaderText = "批号";
            //=============================================================================
            
            ////隐藏列
            grdMain.Columns[HTagCol].Visible = false;
            grdMain.Columns[HInterID].Visible = false;
            //置灰
            grdMain.Columns[HSnoCol].ReadOnly = true;
            grdMain.Columns[HBarCode].ReadOnly = true;
            grdMain.Columns[HQty].ReadOnly = true;
            grdMain.Columns[HMaterCol].ReadOnly = true;
            grdMain.Columns[HMaterName].ReadOnly = true;
            grdMain.Columns[HMaterMould].ReadOnly = true;
            grdMain.Columns[HBatchNo].ReadOnly = true;
            //intoDate();
            //格式化网格
            //DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid_Mater);
        }
 
        //初始化页签2
        private void initGrid_Pay()
        {
            grdMain_Pay.ColumnCount = 10;                       //总列数
            DBUtility.Xt_BaseBillFun.initGridFst(grdMain_Pay, this.Name + "1");
            grdMain_Pay.Columns[HSnoCol2].HeaderText = "序号";
            grdMain_Pay.Columns[HInterID2].HeaderText = "HInterID";
            grdMain_Pay.Columns[HBarCode2].HeaderText = "条码编号";
            grdMain_Pay.Columns[HQty2].HeaderText = "条码数量";
            grdMain_Pay.Columns[HNum2].HeaderText = "拆分数量";
            grdMain_Pay.Columns[HMaterCol2].HeaderText = "物料代码";
            grdMain_Pay.Columns[HMaterName2].HeaderText = "物料名称";
            grdMain_Pay.Columns[HMaterMould2].HeaderText = "规格型号";
            grdMain_Pay.Columns[HBatchNo2].HeaderText = "批号";
            //=============================================================================
            ////隐藏列
            grdMain_Pay.Columns[HTagCol].Visible = false;
            grdMain_Pay.Columns[HInterID].Visible = false;
            //置灰
            grdMain_Pay.Columns[HSnoCol].ReadOnly = true;
            grdMain_Pay.Columns[HBarCode].ReadOnly = true;
            grdMain_Pay.Columns[HQty].ReadOnly = true;
            grdMain_Pay.Columns[HMaterCol].ReadOnly = true;
            grdMain_Pay.Columns[HMaterName].ReadOnly = true;
            grdMain_Pay.Columns[HMaterMould].ReadOnly = true;
            grdMain_Pay.Columns[HBatchNo].ReadOnly = true;
            //设置可编辑列
            string sAllowCol = HNum2.ToString();
            //设置合计列
            string sTotalCol = HTagCol2.ToString() + "0";
            //格式化网格
            //DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid_Pay);
        }
 
        // 基本不变
 
        private void grdMain_RowHeadersWidthChanged(object sender, EventArgs e)
        {
            DBUtility.Xt_BaseBillFun.SetSumGrid(oSumGrid_Mater);
        }
 
        #endregion
 
        //页面加载
        private void Gy_BarCodeBill_ChaiMa_Load(object sender, EventArgs e)
        {
            txtHBillNo.Text = "";
            txtNum.Text = "";
            txtHMaker.Text = DBUtility.ClsPub.CurUserName;
            Sub_ClearBill();
        }
 
        ////数据验证
        //private bool Sub_AllowSave()
        //{
        //    for (int i = 0; i <= grdMain_Pay.RowCount - 1; i++)
        //    {
        //        if (ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HSnoCol2].Value) != 0)
        //        {
        //            if (ClsPub.isStrNull(grdMain_Pay.Rows[i].Cells[HNum2].Value) ==null)
        //            {
        //                MessageBox.Show("请将表格拆分数量填写完整", "提示");
        //                return false;
        //            }
        //        }
        //        else
        //        {
        //            return true;
        //        }
        //    }
        //    return true;
        //}
        
        //生成按钮
        private void xz_Click(object sender, EventArgs e)
        {
            this.SeverDate();
        }
        private bool SeverDate()
        {
            Int32 i;
            bool bResult;
            BillNew = new DAL.ClsGy_BarCodeBill_ChaiMa();
            //if (Sub_AllowSave())
            //{
                //判断会计期是否合理
                string HBillNo = txtHBillNo.Text;
                DataSet Ds;
                double sum = 0.00000000;
                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                Ds = oCn.RunProcReturn("select top 1* from Gy_BarCodeBill where HBarCode='" + HBillNo + "'", "h_v_Gy_BarCodeBill_ChaiMa");
                for (i = 0; i <= grdMain_Pay.RowCount - 1; i++)
                {
                    if (ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HSnoCol2].Value) != 0)
                    {
                        Model.ClsGy_BarCodeEdit_Model model = new Model.ClsGy_BarCodeEdit_Model();
                        //固定赋值========================================
                        model.HEntryID = i + 1;
                        model.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString());
                        model.HBarCode = DBUtility.ClsPub.isStrNull(grdMain_Pay.Rows[i].Cells[HBarCode].Value);
                        model.HQty = DBUtility.ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HNum2].Value);
                        model.HQty = DBUtility.ClsPub.isInt(grdMain_Pay.Rows[i].Cells[HNum2].Value);
                        model.HBatchNo = DBUtility.ClsPub.isStrNull(grdMain_Pay.Rows[i].Cells[HBatchNo].Value);
                        model.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"].ToString());
                        model.HUnitID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HUnitID"].ToString());
                        model.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"].ToString());
                        model.HDeptID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HDeptID"].ToString());
                        model.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"].ToString());
                        model.HBarCodeType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBarCodeType"].ToString());
                        model.HItemSubID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HItemSubID"].ToString());
                        model.HGroupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HGroupID"].ToString());
                        model.HSourceInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceInterID"].ToString());
                        model.HSourceEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceEntryID"].ToString());
                        model.HSourceBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillNo"].ToString());
                        model.HSourceBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceBillType"].ToString());
                        model.HUseFlag = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUseFlag"].ToString());
                        model.HInitQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HInitQty"].ToString());
                        model.HSourceID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInitQty"].ToString());
                        model.HCusID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCusID"].ToString());
                        model.HSTOCKORGID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSTOCKORGID"].ToString());
                        model.HOWNERID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOWNERID"].ToString());
                        model.HBarCodeDate = DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HBarCodeDate"].ToString());
                        model.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"].ToString());
                        model.HMZ = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HMZ"].ToString());
 
                        model.HMakeDate = DateTime.Now;
                        model.HMaker = ClsPub.CurUserName;
 
                        if (model.HQty <= 0 || model.HQty.ToString() == "")
                        {
                            MessageBox.Show("页2第" + ClsPub.isStrNull(i + 1) + "行,拆分数量必须大于0!");
                            return false;
                        }
                        sum += model.HQty;
                        BillNew.DetailColl_Mater.Add(model);
                    }
                    else
                    {
                        break;
                    }
                }
                if (sum > DBUtility.ClsPub.isDoule(grdMain.Rows[0].Cells[HQty].Value))
                {
                     MessageBox.Show("页2拆分数量之和必须小于条码数量!");
                    return false;
                }
                else
                {
                    //保存
                    bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo, HBillNo);
                    //提示
                    if (bResult == true)
                    {
                        MessageBox.Show("单据存盘完毕!单据号:" + this.txtHBillNo.Text.Trim(), "提示");
                        return true;
                    }
                    else
                    {
                        MessageBox.Show("保存失败!原因:" + ClsPub.sExeReturnInfo, "提示");
                        return false;
                    }
                }
        }
        //确定按钮
        private void button1_Click(object sender, EventArgs e)
        {
            if (DBUtility.ClsPub.isStrNull(txtHBillNo.Text) != ""&& DBUtility.ClsPub.isStrNull(txtNum.Text) != "")
            {
                string HBillNo = txtHBillNo.Text;
                int HNumCan = int.Parse(txtNum.Text);
                DataSet Ds;
                SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                Ds = oCn.RunProcReturn("select top 1* from h_v_Gy_BarCodeBill_ChaiMa where 条码编号='" + HBillNo + "'", "h_v_Gy_BarCodeBill_ChaiMa");
                if (Ds == null || Ds.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("条码编号不存在", "提示");
                }
                else
                {
                    grdMain.Rows[0].Cells[HTagCol].Value = "*";
                    grdMain.Rows[0].Cells[HSnoCol].Value = 1;
                    grdMain.Rows[0].Cells[HInterID].Value = Ds.Tables[0].Rows[0]["HInterID"].ToString();
                    grdMain.Rows[0].Cells[HBarCode].Value = Ds.Tables[0].Rows[0]["条码编号"].ToString();
                    grdMain.Rows[0].Cells[HQty].Value = Ds.Tables[0].Rows[0]["条码数量"].ToString();
                    grdMain.Rows[0].Cells[HNum].Value = 0;
                    grdMain.Rows[0].Cells[HMaterCol].Value = Ds.Tables[0].Rows[0]["物料代码"].ToString();
                    grdMain.Rows[0].Cells[HMaterName].Value = Ds.Tables[0].Rows[0]["物料名称"].ToString();
                    grdMain.Rows[0].Cells[HMaterMould].Value = Ds.Tables[0].Rows[0]["规格型号"].ToString();
                    grdMain.Rows[0].Cells[HBatchNo].Value = Ds.Tables[0].Rows[0]["批号"].ToString();
                    for (int i = 0; i < HNumCan; i++)
                    {
                        int Code = 65 + i;
                        System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();
                        byte[] byteArray = new byte[] { (byte)Code };
                        string A = asciiEncoding.GetString(byteArray);
                        string No = Ds.Tables[0].Rows[0]["条码编号"].ToString();
                        grdMain_Pay.Rows[i].Cells[HTagCol2].Value = "*";
                        grdMain_Pay.Rows[i].Cells[HSnoCol2].Value = HSnoCol2+i;
                        grdMain_Pay.Rows[i].Cells[HInterID2].Value = Ds.Tables[0].Rows[0]["HInterID"].ToString();
                        grdMain_Pay.Rows[i].Cells[HBarCode2].Value = No + A;
                        grdMain_Pay.Rows[i].Cells[HQty2].Value = Ds.Tables[0].Rows[0]["条码数量"].ToString();
                        grdMain_Pay.Rows[i].Cells[HMaterCol2].Value = Ds.Tables[0].Rows[0]["物料代码"].ToString();
                        grdMain_Pay.Rows[i].Cells[HMaterName2].Value = Ds.Tables[0].Rows[0]["物料名称"].ToString();
                        grdMain_Pay.Rows[i].Cells[HMaterMould2].Value = Ds.Tables[0].Rows[0]["规格型号"].ToString();
                        grdMain_Pay.Rows[i].Cells[HBatchNo2].Value = Ds.Tables[0].Rows[0]["批号"].ToString();
                    }
                }
            }
            else
            {
                MessageBox.Show("请填写条码编号和拆分条数", "提示");
            }
            
        }
 
        private void tc_Click(object sender, EventArgs e)
        {
            this.Close();
        }
 
        GridppReport Report;
        private void yl_Click(object sender, EventArgs e)
        {
            //选择打印模板
            BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp();
            oFrm.sBillName = ModName;
            oFrm.sBillModel = "条码档案列表";
            oFrm.ShowDialog();
            if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
            {
                Sub_SetReport(oFrm.sOpenTmp);
                Report.PrintPreview(false);
                Thread.Sleep(1000);
            }
        }
 
        private void dy_Click(object sender, EventArgs e)
        {
            //打印前判断条码是否已打印过
            string sBarCode = "";
            string sRelQty = "";
            int i = 0;
            DAL.ClsGy_BarCodeBill_Ctl oBar = new DAL.ClsGy_BarCodeBill_Ctl();
 
            if (ClsPub.isLong(grdMain_Pay.Rows[0].Cells[HSnoCol2].Value) == 0)
            {
                MessageBox.Show("请先生成拆码条码!");
            }
 
            while (ClsPub.isLong(grdMain_Pay.Rows[i].Cells[HSnoCol2].Value) != 0)
            {
                sBarCode = sBarCode + "," + DBUtility.ClsPub.isStrNull(grdMain_Pay.Rows[i].Cells[HBarCode2].Value);
                i++;
            }
           
            //选择打印模板
            BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp();
            oFrm.sBillName = ModName;
            oFrm.sBillModel = "条码档案列表";
            oFrm.ShowDialog();
            if (oFrm.OKTag == Pub_Class.ClsPub.Enum_OKTag.OKTag_OK)
            {
                Sub_SetReport(oFrm.sOpenTmp);
                Report.Print(false);
                //oBar.Set_PrintQty(DBUtility.ClsPub.isStrNull(grdMain.Rows[CurRows].Cells[Fun_GetCol("条码编号")].Value));
                Thread.Sleep(1000);
            }
 
            //批量更新条码打印次数
            oBar.Set_EPrintQty(sBarCode.Substring(1));
        }
 
        private void Sub_SetReport(string sOpenTmp)
        {
            //判断行数
            for (int i = 0; i < grdMain_Pay.Rows.Count; i++)
            {
                grdMain_Pay.Rows[i].Cells[0].Value = "";
            }
            for (int i = 0; i < grdMain_Pay.SelectedRows.Count; i++)
            {
                grdMain_Pay.Rows[grdMain_Pay.SelectedRows[i].Index].Cells[0].Value = "*";
            }
            //
            Report = new GridppReport();
            Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + sOpenTmp + ".grf");  //here .
            Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord);
            Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable);
        }
        //填入单据表头信息
        private void ReportBeforePostRecord()//your report?kao
        {
            try
            {
                //Report.FieldByName("物料代码").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("物料代码")].Value.ToString();
                //Report.FieldByName("物料名称").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("物料名称")].Value.ToString();
                //Report.FieldByName("规格型号").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("规格型号")].Value.ToString();
                //Report.FieldByName("自定义规格").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("自定义规格")].Value.ToString();
                //Report.FieldByName("条码编号").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("条码编号")].Value.ToString();
                //Report.FieldByName("数量").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("数量")].Value.ToString();
                //Report.FieldByName("批次").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("批号")].Value.ToString();
                //Report.FieldByName("源单单号").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("源单单号")].Value.ToString();
                //Report.FieldByName("销售订单号").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("销售订单号")].Value.ToString();
                //Report.FieldByName("采购订单号").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("采购订单号")].Value.ToString();
                //Report.FieldByName("供应商").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("往来单位")].Value.ToString();
                //Report.FieldByName("生产车间").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("生产车间")].Value.ToString();
                //Report.FieldByName("备注").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("备注")].Value.ToString();
                //Report.FieldByName("总托数").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("总托数")].Value.ToString();
                //Report.FieldByName("托号").AsString = grdMain.Rows[CurRows].Cells[Fun_GetCol("托号")].Value.ToString();
            }
            catch (Exception e)
            {
                MessageBox.Show("打印失败!表头:" + e.Message);
            }
            //CurRows = CurRows + 1;
        }
        private void ReportFetchRecordByDataTable()
        {
            try
            {
                DataTable ds = new DataTable();
                BLL.Utility.FillRecordToReport_Sel(Report, grdMain_Pay, ds, Fun_GetCol("序号"));
            }
            catch (Exception e)
            {
                MessageBox.Show("打印失败!表体:" + e.Message);
            }
        }
        private Int32 Fun_GetCol(string sCol)
        {
            return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdMain_Pay);
        }
    }
}