public static void InsertMaillAttach(Attach attach, TranscationHelper trans) { InsertMaillAttach(attach, trans.DataBase, trans.Transaction); }
private static Attach PopulateAttach(IDataReader dataReader) { Attach attach = new Attach(dataReader.GetInt32(0), dataReader.GetGuid(1), dataReader.IsDBNull(2) ? null : dataReader.GetString(2), dataReader.GetString(3), dataReader.GetString(4)); return attach; }
public static void InsertMaillAttach(Attach attach) { InsertMaillAttach(attach, DBHelper.GetDatabase(), null); }
private static void InsertMaillAttach(Attach attach, Database db, DbTransaction trans) { DbCommand dbCommand = db.GetStoredProcCommand("Usp_InsertMailAttach", attach.MailID, attach.ContentID, attach.Title, attach.Path); try { if (trans == null) db.ExecuteNonQuery(dbCommand); else db.ExecuteNonQuery(dbCommand, trans); } catch (System.Data.SqlClient.SqlException sex) // 只捕获SqlException,其余抛出继续传播 { DBHelper.ParseSqlException(sex, false); } }