yangle
2023-09-20 03fcb2f55afe8b4067688da0f666e418dea0d95f
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
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using gregn6Lib;
using Pub_Class;
namespace WorkM
{
    public partial class Sc_ProcessExchangeBill_PL : Form
    {
        public Sc_ProcessExchangeBill_PL()
        {
            InitializeComponent();
        }
 
        public const Int16 HTagCol = 0;
        public const Int16 HSnoCol = 1;
        public const Int16 HBillNoCol = 2;
        public const Int16 HQtyCol = 3;
 
 
        public DataSet oXT;
        public DAL.ClsSc_ProcessExchangeBill BillNew = new DAL.ClsSc_ProcessExchangeBill();   //¶ÔÓ¦µ¥¾ÝÀà
        public bool grdStatus;                                 //Íø¸ñ״̬£¨²»¿É±à¼­£¬¿É±à¼­£©
        ClsGridViewSum oSumGrid = new ClsGridViewSum();
 
        private void Sc_ProcessExchangeBill_PL_FormClosing(object sender, FormClosingEventArgs e)
        { 
            DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name);
        }
 
        private void Sc_ProcessExchangeBill_PL_Load(object sender, EventArgs e)
        { 
            oSumGrid.NoCol = HSnoCol;
            oSumGrid.ogrdMain = grdMain;
            oSumGrid.oGridsum = grdSum;
            grdStatus = true;
            initGrid();
        }
 
        private void bclk_Click(object sender, EventArgs e)
        { 
            //±£´æÁпí
            DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name);
        }
 
        private void mrlk_Click(object sender, EventArgs e)
        {
            DBUtility.Xt_BaseBillFun.DefaultGridView(grdMain, this.Name);
        }
 
        private void initGrid()
        {
            //
            //grdMain.RowCount = 0;
            grdMain.ColumnCount = 4;                       //×ÜÁÐÊý
            DBUtility.Xt_BaseBillFun.initGridFst(grdMain, this.Name);
            grdMain.Columns[HSnoCol].HeaderText = "ÐòºÅ";
            grdMain.Columns[HBillNoCol].HeaderText = "µ¥¾ÝºÅ";
            grdMain.Columns[HQtyCol].HeaderText = "ÊýÁ¿"; 
            //¸ñʽ»¯ 
            grdMain.Columns[HTagCol].Visible = false;                           //Òþ²ØÁР
            //ÉèÖÿɱ༭ÁÐ
            string sAllowCol =   HQtyCol.ToString()  ;
            string sTotalCol = HQtyCol.ToString();
            //
            DBUtility.Xt_BaseBillFun.initGridLast(sAllowCol, sTotalCol, oSumGrid);
        }
 
        //Íø¸ñ±à¼­Ç°ÅжÏ
        private void grdMain_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
        {
            int i = grdMain.CurrentCell.ColumnIndex;
            if (DBUtility.Xt_BaseBillFun.AllowEdit(grdStatus, oSumGrid, i))
            {
                e.Cancel = true;
            }
        }
 
        //Íø¸ñ±à¼­ºó´¦Àí
        private void grdMain_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            DBUtility.Xt_BaseBillFun.SetSumGrid(oSumGrid); 
            //
            if (this.EditingControl != null)      //ÊÍ·Åʼþ
            {
                EditingControl.KeyDown -= new KeyEventHandler(this.EditingControl_KeyDown);
                this.EditingControl = null;
            }
        }
        DataGridViewTextBoxEditingControl EditingControl;
 
        private void grdMain_CellLeave(object sender, DataGridViewCellEventArgs e)
        {
            //
            if (!grdStatus)
            {
                return;
            }
            DBUtility.Xt_BaseBillFun.SetSumGrid(oSumGrid);
            //
            //if (oSumGrid.Changelock)
            //    return;
            //if(oSumGrid.EditStatus)
            //{
            if (!CheckGridRow(oSumGrid.OldCell.Row))
                return;
            //}
        }
        //'ÅжÏÍø¸ñÐеļÈëÊÇ·ñÕýÈ·
        private bool CheckGridRow(int Row)
        {
            Cell oCell = new Cell();
            int c = 0;
            for (c = 0; c < grdMain.ColumnCount; c++)
            {
                oCell.Row = Row;
                oCell.Col = c;
                //if (!CheckGridCell(oCell))
                //    return false;
 
            }
            return true;
        }
 
        private void grdMain_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
        {
            DBUtility.Xt_BaseBillFun.SetSumGrid(oSumGrid);
        }
 
        private void grdMain_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
        {
            if (grdMain.CurrentCell != null)
            {
                if (e.Control is DataGridViewTextBoxEditingControl)
                {
                    this.EditingControl = (DataGridViewTextBoxEditingControl)e.Control;
                    //Ôö¼ÓίÍд¦Àí 
                    this.EditingControl.KeyDown += new KeyEventHandler(this.EditingControl_KeyDown);
                }
            }
        }
        private void EditingControl_KeyDown(object sender, KeyEventArgs e)
        {
            //ÒµÎñ´¦Àí 
            Sub_GridKey(e.KeyValue, grdMain.CurrentRow.Index, grdMain.CurrentCell.ColumnIndex, EditingControl);
        }
        private void grdMain_RowHeadersWidthChanged(object sender, EventArgs e)
        {
            DBUtility.Xt_BaseBillFun.SetSumGrid(oSumGrid);
        }
 
        private void grdMain_Scroll(object sender, ScrollEventArgs e)
        {
            DBUtility.Xt_BaseBillFun.SetSumGrid(oSumGrid);
            oSumGrid.DisplayCurRow();
        }
        
        //°ïÖúº¯Êý
        private void Sub_GridKey(int sKeyCode, int sRow, int sCol, DataGridViewTextBoxEditingControl oEdit)
        { }
 
        private void tim_Click(object sender, EventArgs e)
        {
            if (ClsPub.isDoule(txtHLastQty.Text) < 0)
            {
                MessageBox.Show("β¿òÊýÁ¿²»ÄÜΪ¸º£¡");
                return;
            }
            if (DBUtility.ClsPub.isDoule(txtHQty.Text) > DBUtility.ClsPub.isDoule(txtHICMOBillQty.Text) - DBUtility.ClsPub.isDoule(txtHRelationQty.Text))
            {
                MessageBox.Show("±¾´ÎÉú³ÉÊýÁ¿²»ÄÜ´óÓÚ " + ClsPub.isStrNull(DBUtility.ClsPub.isDoule(txtHICMOBillQty.Text) - DBUtility.ClsPub.isDoule(txtHRelationQty.Text)) + " £¡");
                return;
            }
            initGrid();
            for (int i = 0; i < ClsPub.isInt(txtHCardQty.Text); i++)
            {
                grdMain.Rows[i].Cells[HSnoCol].Value = ClsPub.isStrNull(i + 1);
                grdMain.Rows[i].Cells[HBillNoCol].Value = ClsPub.CreateBillCode(BillNew.BillType, ref ClsPub.sExeReturnInfo, true);//µÃµ½Ðµ¥ºÅ 
 
 
                if (i != ClsPub.isInt(txtHCardQty.Text) - 1)
                {
                    grdMain.Rows[i].Cells[HQtyCol].Value = txtHMinQty.Text;
                }
                else
                {
                    grdMain.Rows[i].Cells[HQtyCol].Value = txtHLastQty.Text;
                } 
 
            }
            gbUp.Enabled = false;
            tim.Enabled = false;
        }
 
        private void txtHQty_Leave(object sender, EventArgs e)
        {
            txtHCardQty.Text = ClsPub.isStrNull(Math.Ceiling(ClsPub.isDoule(txtHQty.Text) / ClsPub.isDoule(txtHMinQty.Text)));
            if (ClsPub.isDoule(txtHCardQty.Text) == 0)
            {
                txtHLastQty.Text = "0";
            }
            else
            {
                txtHLastQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHQty.Text) - (ClsPub.isDoule(txtHMinQty.Text) * (ClsPub.isDoule(txtHCardQty.Text) - 1)));
            }
        }
 
        private void txtHCardQty_Leave(object sender, EventArgs e)
        {
            if (ClsPub.isDoule(txtHCardQty.Text) == 0)
            {
                txtHLastQty.Text = "0";
            }
            else
            {
                txtHLastQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHQty.Text) - (ClsPub.isDoule(txtHMinQty.Text) * (ClsPub.isDoule(txtHCardQty.Text) - 1)));
            }
        }
 
        private void txtHMinQty_Leave(object sender, EventArgs e)
        {
            txtHCardQty.Text = ClsPub.isStrNull(Math.Ceiling(ClsPub.isDoule(txtHQty.Text) / ClsPub.isDoule(txtHMinQty.Text)));
            if (ClsPub.isDoule(txtHCardQty.Text) == 0)
            {
                txtHLastQty.Text = "0";
            }
            else
            {
                txtHLastQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHQty.Text) - (ClsPub.isDoule(txtHMinQty.Text) * (ClsPub.isDoule(txtHCardQty.Text) - 1)));
            }
        }
 
        private void txtHQty_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                txtHCardQty.Text = ClsPub.isStrNull(Math.Ceiling(ClsPub.isDoule(txtHQty.Text) / ClsPub.isDoule(txtHMinQty.Text)));
                if (ClsPub.isDoule(txtHCardQty.Text) == 0)
                {
                    txtHLastQty.Text = "0";
                }
                else
                {
                    txtHLastQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHQty.Text) - (ClsPub.isDoule(txtHMinQty.Text) * (ClsPub.isDoule(txtHCardQty.Text) - 1)));
                }
            }
        }
 
        private void txtHCardQty_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (ClsPub.isDoule(txtHCardQty.Text) == 0)
                {
                    txtHLastQty.Text = "0";
                }
                else
                {
                    txtHLastQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHQty.Text) - (ClsPub.isDoule(txtHMinQty.Text) * (ClsPub.isDoule(txtHCardQty.Text) - 1)));
                }
            }
        }
 
        private void txtHMinQty_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                txtHCardQty.Text = ClsPub.isStrNull(Math.Ceiling(ClsPub.isDoule(txtHQty.Text) / ClsPub.isDoule(txtHMinQty.Text)));
                if (ClsPub.isDoule(txtHCardQty.Text) == 0)
                {
                    txtHLastQty.Text = "0";
                }
                else
                {
                    txtHLastQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHQty.Text) - (ClsPub.isDoule(txtHMinQty.Text) * (ClsPub.isDoule(txtHCardQty.Text) - 1)));
                }
            }
        }
 
        private void splitContainer1_SplitterMoved(object sender, SplitterEventArgs e)
        {
 
        }
 
        private void tc_Click(object sender, EventArgs e)
        {
            this.Close();
        }
 
        private void bc_Click(object sender, EventArgs e)
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            DataSet Ds;
            Ds = oCn.RunProcReturn(" select isnull(Á÷ת¿¨¹ØÁªÊýÁ¿,0) HQty  from  h_v_Sc_ICMOBillList where hmainid=" + DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[0]["hmainid"]), "h_v_Sc_ICMOBillList");
            if (Ds == null || Ds.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("¹ØÁªÊý´íÎó£¬ÇëÖØÐÂÏÂÍÆ£¡");
                return;
            }
            else
            {
                if (DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0][0]) != DBUtility.ClsPub.isDoule(txtHRelationQty.Text))
                {
                    MessageBox.Show("¹ØÁªÊýÒѱ»¸üУ¬ÇëÖØÐÂÏÂÍÆ£¡");
                }
            }
            if (DBUtility.ClsPub.isDoule(txtHQty.Text) <= 0)
            {
                MessageBox.Show("±¾´ÎÉú³ÉÊýÁ¿²»ÄÜСÓÚµÈÓÚ0£¡");
                return;
            }
            if (DBUtility.ClsPub.isDoule(txtHQty.Text) > DBUtility.ClsPub.isDoule(txtHICMOBillQty.Text) - DBUtility.ClsPub.isDoule(txtHRelationQty.Text))
            {
                MessageBox.Show("±¾´ÎÉú³ÉÊýÁ¿²»ÄÜ´óÓÚ " +ClsPub.isStrNull( DBUtility.ClsPub.isDoule(txtHICMOBillQty.Text) - DBUtility.ClsPub.isDoule(txtHRelationQty.Text))+" £¡");
                return;
            }
 
            for (int z = 0; z < grdMain.Rows.Count; z++)
            {
                if (ClsPub.isStrNull(grdMain.Rows[z].Cells[HBillNoCol].Value) != "")
                {
                    Model.ClsSc_ProcessExchangeBillSub oBillSub = new Model.ClsSc_ProcessExchangeBillSub();
                    Int32 i;
                    bool bResult;
                    BillNew = new DAL.ClsSc_ProcessExchangeBill();
                    //Ö÷Àำֵ
                    //ÅÐ¶Ï»á¼ÆÆÚÊÇ·ñºÏÀí
                    string s = "";
                    int sYear = 0;
                    int sPeriod = 0;
                    if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(DateTime.Now, ref sYear, ref sPeriod, ref s) == false)
                    {
                        MessageBox.Show(s, "Ìáʾ");
                        return;
                    }
                    //Ô´µ¥ÐÅÏ¢
                    //BillNew.omodel.HMainSourceBillType = cmbSourceBillType.Text;
                    //
                    BillNew.omodel.HYear = sYear;
                    BillNew.omodel.HPeriod = sPeriod;
                    //¹Ì¶¨¸³Öµ=================================
                    BillNew.omodel.HBillNo = grdMain.Rows[z].Cells[HBillNoCol].Value.ToString();
                    BillNew.omodel.HDate = DateTime.Now;
                    BillNew.omodel.HRemark = "";
                    //====================================================
                    BillNew.omodel.HWWOrderInterID = 0;
                    BillNew.omodel.HWWOrderEntryID = 0;
                    BillNew.omodel.HWWOrderBillNo = "";
                    BillNew.omodel.HICMOInterID = DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[0]["hmainid"]);
                    BillNew.omodel.HICMOBillNo = DBUtility.ClsPub.isStrNull(oXT.Tables[0].Rows[0]["ÈÎÎñµ¥ºÅ"]);
                    BillNew.omodel.HMaterID = DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[0]["hmaterid"]);
                    BillNew.omodel.HMaterNumber = DBUtility.ClsPub.isStrNull(oXT.Tables[0].Rows[0]["ÎïÁÏ´úÂë"]);
                    BillNew.omodel.HUnitID = DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[0]["hunitid"]);
                    BillNew.omodel.HUnitNumber = DBUtility.ClsPub.isStrNull(oXT.Tables[0].Rows[0]["¼ÆÁ¿µ¥Î»´úÂë"]);
 
                    BillNew.omodel.HEmpID = DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[0]["HEmpID"]);
 
                    BillNew.omodel.HPlanQty = DBUtility.ClsPub.isDoule(grdMain.Rows[z].Cells[HQtyCol].Value);
 
                    BillNew.omodel.HPlanBeginDate = DBUtility.ClsPub.isDate(oXT.Tables[0].Rows[0]["¼Æ»®¿ª¹¤ÈÕÆÚ"]);
                    BillNew.omodel.HPlanEndDate = DBUtility.ClsPub.isDate(oXT.Tables[0].Rows[0]["¼Æ»®Í깤ÈÕÆÚ"]);
                    BillNew.omodel.HJHDate = DBUtility.ClsPub.isDate(oXT.Tables[0].Rows[0]["½»»õÈÕÆÚ"]);
                    BillNew.omodel.HExplanation = "";
                    BillNew.omodel.HInnerBillNo = "";
                    BillNew.omodel.HWorkShopID = 0;
                    BillNew.omodel.HSupID = 0;
                    //Ã÷ϸÀำֵ
                    BillNew.DetailColl = new List<Model.ClsSc_ProcessExchangeBillSub>();
                    for (i = 0; i < oXT.Tables[0].Rows.Count; i++)
                    {
                        if (DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[i]["hprocid"]) != 0)
                        {
                            Model.ClsSc_ProcessExchangeBillSub oSub = new Model.ClsSc_ProcessExchangeBillSub();
                            //¹Ì¶¨¸³Öµ========================================
                            oSub.HEntryID = i + 1;
                            oSub.HRemark = DBUtility.ClsPub.isStrNull(oXT.Tables[0].Rows[i]["±¸×¢"]);
                            oSub.HSourceInterID = DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[i]["hmainid"]);
                            oSub.HSourceEntryID = DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[i]["hsubid"]);
                            oSub.HSourceBillType = DBUtility.ClsPub.isStrNull(oXT.Tables[0].Rows[i]["HBillType"]);
                            oSub.HSourceBillNo = DBUtility.ClsPub.isStrNull(oXT.Tables[0].Rows[i]["ÈÎÎñµ¥ºÅ"]);
                            oSub.HRelationQty = 0;
                            oSub.HRelationMoney = 0;
                            oSub.HCloseMan = "";
                            //oSub.HEntryCloseDate = null;
                            //oSub.HCloseType = 0;
                            //============================= 
                            oSub.HQty = DBUtility.ClsPub.isDoule(grdMain.Rows[z].Cells[HQtyCol].Value);
 
                            oSub.HProcNo = DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[i]["¹¤ÐòºÅ"]);
                            oSub.HProcID = DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[i]["hprocid"]);
                            oSub.HProcNumber = DBUtility.ClsPub.isStrNull(oXT.Tables[0].Rows[i]["¹¤Ðò´úÂë"]);
                            oSub.HWorkRemark = "";
                            oSub.HCenterID = DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[i]["HCenterID"]);
                            oSub.HDeptID = DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[i]["hdeptid"]);
                            oSub.HDeptNumber = DBUtility.ClsPub.isStrNull(oXT.Tables[0].Rows[i]["Éú²ú³µ¼ä´úÂë"]);
                            oSub.HGroupID = DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[i]["HGroupID"]);
                            oSub.HGroupNumber = DBUtility.ClsPub.isStrNull(oXT.Tables[0].Rows[i]["°à×é´úÂë"]);
                            oSub.HWorkerID = DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[i]["HWorkerID"]);
                            oSub.HWorkerNumber = DBUtility.ClsPub.isStrNull(oXT.Tables[0].Rows[i]["²Ù×÷¹¤´úÂë"]);
                            oSub.HSourceID = DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[i]["HSourceID"]);
                            oSub.HTimeUnit = DBUtility.ClsPub.isStrNull(oXT.Tables[0].Rows[i]["ʱ¼äµ¥Î»"]);
 
                            oSub.HPlanWorkTimes = 0;
 
                            oSub.HPlanBeginDate = DBUtility.ClsPub.isDate(oXT.Tables[0].Rows[i]["¼Æ»®¿ª¹¤ÈÕÆÚ"]);
                            oSub.HPlanEndDate = DBUtility.ClsPub.isDate(oXT.Tables[0].Rows[i]["¼Æ»®Í깤ÈÕÆÚ"]);
                            //oSub.HRelBeginDate = "";
                            //oSub.HRelEndDate = "";
 
                            oSub.HReadyTime = DBUtility.ClsPub.isSingle(oXT.Tables[0].Rows[i]["×¼±¸Ê±¼ä"]);
                            oSub.HQueueTime = DBUtility.ClsPub.isSingle(oXT.Tables[0].Rows[i]["ÅŶÓʱ¼ä"]);
                            oSub.HMoveTime = DBUtility.ClsPub.isSingle(oXT.Tables[0].Rows[i]["×ªÒÆÊ±¼ä"]);
                            oSub.HBeginDayQty = 0;
                            oSub.HBeginFixQty = 0;
                            oSub.HFixWorkDays = 0;
                            oSub.HTrunWorkDays = 0;
                            oSub.HReadyTimes = 0;
                            oSub.HMyWorkDays = 0;
                            oSub.HOutPrice = 0;
                            oSub.HOutMoney = 0;
                            oSub.HLastProc = "";
                            oSub.HFstProc = "";
 
                            //if (oSub.HSourceID == 0)
                            //{
                            //    MessageBox.Show("µÚ" + ClsPub.isStrNull(i + 1) + "ÐУ¬Éú²ú×ÊÔ´²»ÄÜΪ¿Õ");
                            //    return false;
                            //}
                            //
                            oSub.HICMOBillNo = DBUtility.ClsPub.isStrNull(oXT.Tables[0].Rows[i]["ÈÎÎñµ¥ºÅ"]);
                            oSub.HICMOInterID = DBUtility.ClsPub.isLong(oXT.Tables[0].Rows[i]["hmainid"]);
                            oSub.HSeOrderInterID = 0;
                            oSub.HSeOrderEntryID = 0;
                            oSub.HSeOrderBillNo = "";
                            oSub.HWWOrderInterID = 0;
                            oSub.HWWOrderEntryID = 0;
                            oSub.HWWOrderBillNo = "";
                            BillNew.DetailColl.Add(oSub);
                        }
                    }
                    //±£´æÍê±Ïºó´¦Àí
                    bResult = BillNew.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    //Ìáʾ
                    if (bResult == true)
                    {
                        //MessageBox.Show("µ¥¾Ý´æÅÌÍê±Ï!µ¥¾ÝºÅ:" + this.txtHBillNo.Text.Trim(), "Ìáʾ");
                        //return true;
                    }
                    else
                    {
                        MessageBox.Show("±£´æÊ§°Ü!Ô­Òò:" + DBUtility.ClsPub.sExeReturnInfo, "Ìáʾ");
                        return;
                    }
                }
            }
            MessageBox.Show("Á÷ת¿¨Éú³ÉÍê±Ï!", "Ìáʾ");
            gbUp.Enabled = false;
            grdMain.Enabled = false;
            tim.Enabled = false;
            bc.Enabled = false;
        }
 
    }
}