public void add(MailBoxModel mailbox) { SqlConnection cn = null; SqlTransaction tc = null; try { cn = DbHelperSQL.getConnection(); tc = DbHelperSQL.startTransaction(cn); //执行新增写进数据库 mailboxDal.add(cn, tc, mailbox); DbHelperSQL.commitTransaction(tc); } catch (Exception dalEx) { DbHelperSQL.rollBackTransaction(tc); throw new MakeException(ExpSort.数据库, dalEx.Message); } finally { DbHelperSQL.closeConnection(cn); } }
public bool update(SqlConnection cn, SqlTransaction tc, MailBoxModel model) { return DbHelperSQL.updateModel<MailBoxModel>(model, "MailBox", "Evenid", model.Evenid.ToString(), "'", cn, tc); }
public bool add(SqlConnection cn, SqlTransaction tc, MailBoxModel model) { return DbHelperSQL.insertModel<MailBoxModel>(model, "MailBox", cn, tc); }