/EQT_V2/EQT/EQT.DAL/DaTestRecord.cs
C# | 57 lines | 42 code | 7 blank | 8 comment | 4 complexity | 0c1cfa83d6161928cc0bb58b715af3f2 MD5 | raw file
Possible License(s): LGPL-2.1
1using System; 2using System.Collections; 3using System.Collections.Generic; 4using System.Data; 5using System.Globalization; 6using System.Text; 7using System.Xml; 8using System.Data.Common; 9using Microsoft.Practices.EnterpriseLibrary.Data; 10using Microsoft.Practices.EnterpriseLibrary.Data.Sql; 11//using Microsoft.Practices.EnterpriseLibrary.Logging; 12using EQT.Model; 13//using IDataLayer; 14 15namespace EQT.Dal 16{ 17 public partial class DaTestRecord 18 { 19 /// <summary> 20 /// ????????. 21 /// </summary> 22 /// <param name="motf">??????</param> 23 /// <param name="motr">??????</param> 24 /// <returns></returns> 25 public int AddTestRecordFile(MoTfiles motf, MoTestRecord motr) 26 { 27 if (motf == null || motr == null) return 0; 28 int rc = 0; 29 using (DbConnection conn = db.CreateConnection()) 30 { 31 try 32 { 33 conn.Open(); 34 using (DbTransaction trans = conn.BeginTransaction()) 35 { 36 rc+= Add(motr, trans); 37 DaTfiles da = new DaTfiles(db); 38 rc+= da.Add(motf, trans); 39 trans.Commit(); 40 } 41 conn.Close(); 42 } 43 catch (DbException ex) 44 { 45 HandleDbException(ex); 46 } 47 } 48 return rc; 49 } 50 51 52 53 54 55 56 } 57}