yangle
2023-06-25 6585cda35b87eb1a3a05a948faf7dc5d08ef8ff7
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
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Data.SqlClient;
using System.Windows.Forms;
using System.Data;
using Pub_Class;
 
namespace BLL
{
    public class ClsXt_FileCtrl
    {
 
        public Int64 HInterID;
        public Int64 HFileSize;
        public string HFileType;
        public string HPath;
        public string HFileName;
        public string HMaker;
        public DateTime HMakeDate;
        public string HRemark;
        //
        public Int64 HBillID;
        public string HBillNo;
        public string HBillType;
        private string mvarItemKey;
        public string _sqlConnection;
 
        //
        public ClsXt_FileCtrl()
        {
            mvarItemKey = "8001";
            mvarReportTitle = "µ¥¾Ý¸½¼þ"; 
            if (DBUtility.ClsPub.isStrNull(DBUtility.ClsPub.AppPath) == "")
            {
                DBUtility.ClsPub.AppPath = System.Environment.CurrentDirectory;
                //ClsPub.AppPath = @"C:\Windows\System32";
            }
            string sServer = ClsIni.ReadIni("K32Erp", "Server", ClsPub.AppPath + @"\" + "HXErp.ini");
            string sDataBase = ClsIni.ReadIni("K32Erp", "DataBase", ClsPub.AppPath + @"\" + "HXErp.ini");
            string sUser = ClsIni.ReadIni("K32Erp", "UserName", ClsPub.AppPath + @"\" + "HXErp.ini");
            string sPassword = ClsIni.ReadIni("K32Erp", "PassWord", ClsPub.AppPath + @"\" + "HXErp.ini");
            _sqlConnection = "Data Source=" + sServer + ";DataBase=" + sDataBase + ";User ID=" + sUser + ";PWD=" + sPassword + ";max pool size=512";
            //
        }
 
        public string MvarItemKey
        {
            get { return mvarItemKey; }
            set { mvarItemKey = value; }
        }
        private string mvarReportTitle;
 
        public string MvarReportTitle
        {
            get { return mvarReportTitle; }
            set { mvarReportTitle = value; }
        }
 
        //ѹËõÎļþ
        public bool CompressFile(string sFilePath, string sTable, string sFieldName, long HInterID, Pub_Class.ClsSqlHelper oCn)
        {
            //KDZIP.ZIP oZip = new ZIP();
            //File.Delete(DBUtility.ClsPub.AppPath + @"\tmpfile");
            //short iErr = oZip.CompressEx(sFilePath, DBUtility.ClsPub.AppPath + @"\tmpfile", 6);
            //string sErr = oZip.GetErrorDescription(iErr);
            //if (sErr.Trim() == "ûÓдíÎó")
            //{
            if (LoadUpFile(sTable, sFieldName, sFilePath, HInterID, oCn))
                {
                    //oZip = null;
                    return true;
                }
                else
                {
                    //oZip = null;
                    return false;
                }
            //}
            //else
            //{
            //    MessageBox.Show("ѹËõʧ°Ü!");
            //    oZip = null;
            //    return false;
            //}
        }
 
 
        //×÷ÒµÖ¸µ¼ÊéÉÏ´«Í¼Æ¬
        public bool LoadUpImage(Int64 sHFileID, string sSafeFileName, string sPath)
        {
            try
            {
                SqlConnection con = new SqlConnection(_sqlConnection);
 
                con.Open();
                byte[] FileList = this.FileToByteArray(sPath);
                string commandText = @"  INSERT INTO  HX_LCEIFile..Gy_SOPFile (HFileID,HFileName,HFileSize,HFile,HUpTime) " +
                "VALUES (" + sHFileID + ",'" + sSafeFileName + "',0,@FileList,getdate())";
                SqlCommand comm = new SqlCommand(commandText, con);
                comm.Parameters.AddWithValue("@FileList", FileList);
                comm.ExecuteNonQuery();
                con.Close();
            }
            catch (Exception e)
            {
                return false;
            }
            return true;
        }
 
 
        //ѹËõÎļþA3
        public bool CompressFile(string sFilePath, string sTable, string sFieldName, string HBillNo, string sType, Pub_Class.ClsSqlHelper oCn)
        {
            //KDZIP.ZIP oZip = new ZIP();
            ////File.Delete(DBUtility.ClsPub.AppPath + @"\tmpfile");
            //short iErr = oZip.CompressEx(sFilePath, DBUtility.ClsPub.AppPath + @"\tmpfile", 6);
            //string sErr = oZip.GetErrorDescription(iErr);
            //if (sErr.Trim() == "ûÓдíÎó")
            //{
            if (LoadUpFile(sTable, sFieldName, sFilePath, HBillNo, sType, oCn))
            {
                //oZip = null;
                return true;
            }
            else
            {
                //oZip = null;
                return false;
            }
            //}
            //else
            //{
            //    MessageBox.Show("ѹËõʧ°Ü!");
            //    oZip = null;
            //    return false;
            //}
        }
 
        //½âѹËõÎļþ
        public bool CompressBackFile(string sFilePath, long HInterID, Pub_Class.ClsSqlHelper oCn)
        {
            //KDZIP.ZIP oZip = new ZIP();
            //File.Delete(DBUtility.ClsPub.AppPath + @"\tmpfile2");
            if (WriteFile("", "HFile", sFilePath, HInterID, oCn))
            {
                //short iErr = oZip.DeCompressEx(DBUtility.ClsPub.AppPath + @"\tmpfile2", sFilePath);
                //string sErr = oZip.GetErrorDescription(iErr);
                //if (sErr.Trim() == "ûÓдíÎó")
                //{
                return true;
                //}
                //else
                //{
                //    MessageBox.Show("½âѹËõʧ°Ü!" + sErr);
                //    return false;
                //}
            }
            else
            {
                MessageBox.Show("¶ÁÈ¡Êý¾Ý¿âÎļþʧ°Ü£¡");
                return false;
            }
        }
 
        //½âѹËõÎļþA3
        public bool CompressBackFile(string sFilePath, string HBillNo, string sType, Pub_Class.ClsSqlHelper oCn)
        {
            //KDZIP.ZIP oZip = new ZIP();
            //File.Delete(DBUtility.ClsPub.AppPath + @"\tmpfile2");
            if (WriteFile("", "HFile", sFilePath, HBillNo, sType, oCn))
            {
                //short iErr = oZip.DeCompressEx(DBUtility.ClsPub.AppPath + @"\tmpfile2", sFilePath);
                //string sErr = oZip.GetErrorDescription(iErr);
                //if (sErr.Trim() == "ûÓдíÎó")
                //{
                return true;
                //}
                //else
                //{
                //    MessageBox.Show("½âѹËõʧ°Ü!" + sErr);
                //    return false;
                //}
            }
            else
            {
                MessageBox.Show("¶ÁÈ¡Êý¾Ý¿âÎļþʧ°Ü£¡");
                return false;
            }
        }
 
        //ÉÏ´«ÎļþA3
        public bool LoadUpFile(Int64 iFileID, int iMainType, string sPath, int sSize, string sFileName, string sUpMan)
        {
            try
            {
                SqlConnection con = new SqlConnection(_sqlConnection);
                con.Open();
                byte[] FileList = this.FileToByteArray(sPath);
                string commandText = @"  INSERT INTO  OA_Accessories (FFileID,FMainType,FPath,FFileSize,FFileName,FFile,FUpMan) " +
                "VALUES (" + iFileID.ToString() + "," + iMainType.ToString() + ",'" + sPath + "'," + sSize.ToString() + ",'" +
                sFileName + "',@FileList,'" + sUpMan + "')";
                SqlCommand comm = new SqlCommand(commandText, con);
                comm.Parameters.AddWithValue("@FileList", FileList);
                comm.ExecuteNonQuery();
                con.Close();
            }
            catch (Exception e)
            {
                return false;
            }
            return true;
        }
 
        //ÉÏ´«Îļþ¸öÈËÏûÏ¢
        public bool LoadUpFile2(Int64 iFileID, string sPath, int sSize, string sFileName, string sUpMan, string ROperator, string LoadDate, int HBillStatus)
        {
            try
            {
                SqlConnection con = new SqlConnection(_sqlConnection);
                con.Open();
                byte[] FileList = this.FileToByteArray(sPath);
                string commandText = @"  INSERT INTO  oa_PicBill (MainID,sPath,picsize,sFileName,pic,operator,ROperator,isread,Status,LoadDate) " +
                "VALUES (" + iFileID.ToString() + ",'" + sPath + "'," + sSize.ToString() + ",'" +
                sFileName + "',@FileList2,'" + sUpMan + "','" + ROperator + "',0,'','" + LoadDate + "','" + HBillStatus + "')";
                SqlCommand comm = new SqlCommand(commandText, con);
                comm.Parameters.AddWithValue("@FileList2", FileList);
                comm.ExecuteNonQuery();
                con.Close();
            }
            catch (Exception e)
            {
                return false;
            }
            return true;
        }
 
 
        //ÉÏ´«Îļþ
        public bool LoadUpFile(string sTable, string sFieldName, string sPath, long HInterID, Pub_Class.ClsSqlHelper oCn)
        {
            try
            {
                string s = "";
                byte[] FileList = FileToByteArray(sPath);
                string commandText = @"  INSERT INTO " + sTable + "(HInterID," + sFieldName + ") " +
                "VALUES (" + HInterID.ToString() + ",@FileList)";
                if (!oCn.CreateCommand(commandText, FileList, ref s))
                {
                    return false;
                }
                return true;
            }
            catch (Exception e)
            {
                return false;
            }
        }
 
        //ÉÏ´«ÎļþA3
        public bool LoadUpFile(string sTable, string sFieldName, string sPath, string HBillNo, string sType, Pub_Class.ClsSqlHelper oCn)
        {
            try
            {
                string s = "";
                byte[] FileList = FileToByteArray(sPath);
                string commandText = @"  INSERT INTO " + sTable + "(HBillNo,HBillType," + sFieldName + ") " +
                "VALUES ('" + HBillNo + "','" + sType + "',@FileList)";
                if (!oCn.CreateCommand(commandText, FileList, ref s))
                {
                    return false;
                }
                return true;
            }
            catch (Exception e)
            {
                return false;
            }
        }
 
        //ÉÏ´«Îļþ¹ÜÀíÎļþ
        public bool LoadUpFile3(Int64 FFileSize, string PicName, string PicType, string PicPath, string LoadDate, string Remark, int ParentID, string sLoadMan)
        {
            //PicPath Îļþ·¾¶ PicName ÎļþÃû³Æ LoadMan ÉÏ´«ÈË PicType ÎļþÀàÐÍ LoadDate ÉÏ´«Ê±¼ä
 
            //           YF_PictureID  ID, PicType ÀàÐÍ,PicName ÎļþÃû³Æ, PicPath  Îļþ·¾¶,LoadDate ÉÏ´«Ê±¼ä,LoadMan ÉÏ´«ÈË,CloseDate null
            //, CloseMan  null, Remark ÃèÊö,YF_CmpolderMainID 0
            //,YF_CmpolderSubID 0, YF_CmpolderType '',ParentID Ê÷ÐÎID,BbNumber, FFile, BbID ,LJnull
 
            //grdCSFJ.Columns[HFileNameCol].HeaderText = "ÎļþÃû³Æ";
            //grdCSFJ.Columns[HFilePathCol].HeaderText = "Îļþ·¾¶";
            //grdCSFJ.Columns[HUpManCol].HeaderText = "ÉÏ´«ÈË";
            //grdCSFJ.Columns[HROperatorCol].HeaderText = "½ÓÊÕÈË";
            //grdCSFJ.Columns[iFileIDCSCol].HeaderText = "ID";
 
 
            //if (oFile2.WriteFile2("Pic"
            //    , DBUtility.ClsPub.AppPath + @"\a\" + DBUtility.ClsPub.isStrNull(grdJSFJ.Rows[grdJSFJ.CurrentRow.Index].Cells[HFileNameCol].Value)
            //    , DBUtility.ClsPub.isLong(grdJSFJ.Rows[grdJSFJ.CurrentRow.Index].Cells[iFileIDJSCol].Value), oCNK32) == false)
            try
            {
                SqlConnection con = new SqlConnection(_sqlConnection);
                con.Open();
                byte[] FileList = this.FileToByteArray(PicPath);
                string commandText = @"  INSERT INTO  oa_picturebill (FFileSize,PicName,PicType,PicPath,LoadDate,Remark,YF_CmpolderMainID,YF_CmpolderSubID,YF_CmpolderType,ParentID,BbNumber,FFile,BbID,LoadMan) " +
                "VALUES (" + FFileSize.ToString() + ",'" + PicName + "','" + PicType + "','" + PicPath + "','" + LoadDate + "','" + Remark + "',0,0,''," + ParentID.ToString() + ",''" +
                 ",@FileList,0,'" + sLoadMan + "')";
                SqlCommand comm = new SqlCommand(commandText, con);
                comm.Parameters.AddWithValue("@FileList", FileList);
                comm.ExecuteNonQuery();
                con.Close();
            }
            catch (Exception e)
            {
                return false;
            }
            return true;
        }
 
 
        //°ÑÎļþת»»³Ébyte[]
        public byte[] FileToByteArray(String FilePath)
        {
            FileStream stream = new FileInfo(FilePath).OpenRead();
            byte[] buffer = new byte[stream.Length];
            stream.Read(buffer, 0, Convert.ToInt32(stream.Length));
            stream.Close();
            stream = null;
            return buffer;
            return null;
        }
 
        //ÏÂÔØÎļþ²¢ÔËÐÐ
        public bool WriteFile(string sFieldName, string sFileName, long HInterID, Pub_Class.ClsSqlHelper oCn)
        {
            string s = "";
            SqlDataReader dr = oCn.RunReader("select FFile from OA_Accessories where FItemID=" + HInterID.ToString(), "OA_Accessories", ref s);
            if (dr == null)
            {
                return false;
            }
            byte[] oFile = null;
            if (dr.Read())
            {
                oFile = (byte[])dr[sFieldName];
            }
            FileStream fs;
            FileInfo fi = new FileInfo(sFileName);
            fs = fi.OpenWrite();
            fs.Write(oFile, 0, oFile.Length);
            fs.Close();
            dr.Close();
            return true;
        }
 
        //ÏÂÔØÎļþ²¢ÔËÐиöÈËÏûÏ¢
        public bool WriteFile2(string sFieldName, string sFileName, long HInterID, Pub_Class.ClsSqlHelper oCn)
        {
            string s = "";
            oCn.RunProc("Update  oa_PicBill set " +
                  "HBillStatus= 1 Where ID =" + HInterID.ToString(), ref DBUtility.ClsPub.sExeReturnInfo);
            SqlDataReader dr = oCn.RunReader("select Pic from oa_PicBill where ID=" + HInterID.ToString(), "oa_PicBill", ref s);
            if (dr == null)
            {
                return false;
            }
            byte[] oFile = null;
            if (dr.Read())
            {
                oFile = (byte[])dr[sFieldName];
            }
            FileStream fs;
            FileInfo fi = new FileInfo(sFileName);
            fs = fi.OpenWrite();
 
 
 
            fs.Write(oFile, 0, oFile.Length);
            fs.Close();
            dr.Close();
 
            return true;
        } 
        //ÏÂÔØÎļþ
        public bool WriteFile(string sSQL, string sFieldName, string sFileName, long HInterID, Pub_Class.ClsSqlHelper oCn)
        {
            string s = "";
            SqlDataReader dr = oCn.RunReader("select HFile from Xt_Accessories where HInterID=" + HInterID.ToString(), "Xt_Accessories", ref s);
            if (dr == null)
            {
                return false;
            }
            byte[] oFile = null;
            if (dr.Read())
            {
                oFile = (byte[])dr[sFieldName];
            }
            FileStream fs;
            FileInfo fi = new FileInfo(sFileName);
            fs = fi.OpenWrite();
            fs.Write(oFile, 0, oFile.Length);
            fs.Close();
            dr.Close();
            return true;
        }
 
        //ÏÂÔØÎļþ²¢ÔËÐйÜÀíÎļþ
        public bool WriteFile3(string sFieldName, string sFileName, long YF_PictureID, Pub_Class.ClsSqlHelper oCn)
        {
            string s = "";
            SqlDataReader dr = oCn.RunReader("select FFile from oa_picturebill where YF_PictureID=" + YF_PictureID.ToString(), "oa_picturebill", ref s);
            if (dr == null)
            {
                return false;
            }
            byte[] oFile = null;
            if (dr.Read())
            {
                oFile = (byte[])dr[sFieldName];
            }
            FileStream fs;
            FileInfo fi = new FileInfo(sFileName);
            fs = fi.OpenWrite();
            fs.Write(oFile, 0, oFile.Length);
            fs.Close();
            dr.Close();
            return true;
        }
 
        //ÏÂÔØÎļþA3
        public bool WriteFile(string sSQL, string sFieldName, string sFileName, string HBillNo, string sType, Pub_Class.ClsSqlHelper oCn)
        {
            string s = "";
            SqlDataReader dr = oCn.RunReader("select HFile from Xt_Accessories where HBillNo='" + HBillNo + "' and HBillType='" + sType + "' order by HItemID desc", "Xt_Accessories", ref s);
            if (dr == null)
            {
                return false;
            }
            byte[] oFile = null;
            if (dr.Read())
            {
                oFile = (byte[])dr[sFieldName];
            }
            FileStream fs;
            FileInfo fi = new FileInfo(sFileName);
            fs = fi.OpenWrite();
            fs.Write(oFile, 0, oFile.Length);
            fs.Close();
            dr.Close();
            return true;
        }
 
        //´ò¿ªÎļþ
        //ɾ³ýµ¥¾Ý
        public bool DeleteFile(Int64 lngBillKey, ref string sReturn, Pub_Class.ClsSqlHelper oCn)
        {
            try
            {
                oCn.BeginTran();
                //ɾ³ýÃ÷ϸ±í
                oCn.RunProc("Delete From OA_Accessories where FItemID=" + lngBillKey.ToString());
                sReturn = "ɾ³ý¸½¼þ³É¹¦£¡";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                return false;
            }
        }
 
 
        //ɾ³ýµ¥¾Ý¹ÜÀíÎļþ
        public bool DeleteFile3(Int64 lngBillKey, ref string sReturn, Pub_Class.ClsSqlHelper oCn)
        {
            try
            {
 
                oCn.BeginTran();
                //ɾ³ýÃ÷ϸ±í
                oCn.RunProc("Delete From oa_picturebill where YF_PictureID=" + lngBillKey.ToString());
                sReturn = "ɾ³ý¸½¼þ³É¹¦£¡";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                return false;
            }
        }
 
 
        //ɾ³ýµ¥¾Ý
        public bool DeleteBill(Int64 lngBillKey, ref string sReturn, Pub_Class.ClsSqlHelper oCn)
        {
            try
            {
                oCn.BeginTran();
                //ɾ³ýÃ÷ϸ±í
                oCn.RunProc("Delete From Xt_Accessories where HInterID=" + lngBillKey.ToString());
                //ɾ³ýÖ÷±í
                oCn.RunProc("Delete From Xt_FileList where HInterID=" + lngBillKey.ToString());
                sReturn = "ɾ³ý¸½¼þ³É¹¦£¡";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                return false;
            }
        }
        //ÐÂÔöµ¥¾Ý
        public bool AddBill(ref string sReturn, Pub_Class.ClsSqlHelper oCn)
        {
            try
            {
                //µÃµ½mainid
                this.HInterID = DBUtility.ClsPub.CreateBillID(MvarItemKey, ref DBUtility.ClsPub.sExeReturnInfo);
                //ÈôMAINDIÖØ¸´ÔòÖØÐ»ñÈ¡
                oCn.BeginTran();
                //Ö÷±í
                oCn.RunProc("Insert Into Xt_FileList   " +
                "(HInterID,HFileSize,HFileType" +
                ",HPath,HFileName,HMaker,HMakeDate" +
                ",HRemark,HBillNo,HBillType" +
                ") " +
                " values(" + this.HInterID.ToString() + "," + this.HFileSize.ToString() + ",'" + this.HFileType + "'" +
                ",'" + this.HPath + "','" + this.HFileName + "','" + DBUtility.ClsPub.CurUserName + "','" + DBUtility.ClsPub.GetServerDate(-1) + "'" +
                ",'" + this.HRemark + "','" + this.HBillNo + "','" + this.HBillType + "'" +
                ") ");
                sReturn = "±£´æ¸½¼þ³É¹¦£¡";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                return false;
            }
        }
 
        //ÏÔʾµ¥¾Ý
        public bool ShowBill(Int64 lngBillKey, ref string sReturn, Pub_Class.ClsSqlHelper oCn)
        {
            try
            {
                //²éѯÖ÷±í
                DataSet Ds;
                Ds = oCn.RunProcReturn("Select * from Xt_FileList Where HInterID=" + lngBillKey.ToString(), "Xt_FileList");
                if (Ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "¸½¼þδÕÒµ½£¡";
                    return false;
                }
                //¸³Öµ
                this.HInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"].ToString());
                this.HFileName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HFileName"].ToString());
                //
                sReturn = "ÏÔʾ¸½¼þ³É¹¦£¡";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                return false;
            }
        }
 
        //ÏÔʾµ¥¾ÝA3
        public bool ShowBill(string lngBillKey, string sType, ref string sReturn, Pub_Class.ClsSqlHelper oCn)
        {
            try
            {
                //²éѯÖ÷±í
                DataSet Ds;
                Ds = oCn.RunProcReturn("Select top 1 * from Xt_FileList Where HBillNo='" + lngBillKey + "'  and HBillType='" + sType + "'  order by HItemID desc", "Xt_FileList");
                if (Ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "¸½¼þδÕÒµ½£¡";
                    return false;
                }
                //¸³Öµ
                this.HBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillNo"].ToString());
                this.HFileName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HFileName"].ToString());
                //
                sReturn = "ÏÔʾ¸½¼þ³É¹¦£¡";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                return false;
            }
        }
 
    }
}