/EQT_V2/EQT/EQT.DAL/DaTestRecord.cs
http://sgsoft-las.googlecode.com/ · C# · 57 lines · 42 code · 7 blank · 8 comment · 4 complexity · 0c1cfa83d6161928cc0bb58b715af3f2 MD5 · raw file
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Data;
- using System.Globalization;
- using System.Text;
- using System.Xml;
- using System.Data.Common;
- using Microsoft.Practices.EnterpriseLibrary.Data;
- using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
- //using Microsoft.Practices.EnterpriseLibrary.Logging;
- using EQT.Model;
- //using IDataLayer;
-
- namespace EQT.Dal
- {
- public partial class DaTestRecord
- {
- /// <summary>
- /// ????????.
- /// </summary>
- /// <param name="motf">??????</param>
- /// <param name="motr">??????</param>
- /// <returns></returns>
- public int AddTestRecordFile(MoTfiles motf, MoTestRecord motr)
- {
- if (motf == null || motr == null) return 0;
- int rc = 0;
- using (DbConnection conn = db.CreateConnection())
- {
- try
- {
- conn.Open();
- using (DbTransaction trans = conn.BeginTransaction())
- {
- rc+= Add(motr, trans);
- DaTfiles da = new DaTfiles(db);
- rc+= da.Add(motf, trans);
- trans.Commit();
- }
- conn.Close();
- }
- catch (DbException ex)
- {
- HandleDbException(ex);
- }
- }
- return rc;
- }
-
-
-
-
-
-
- }
- }