Example #1
0
        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);
            }
        }
Example #2
0
 public bool update(SqlConnection cn, SqlTransaction tc, MailBoxModel model)
 {
     return DbHelperSQL.updateModel<MailBoxModel>(model, "MailBox", "Evenid", model.Evenid.ToString(), "'", cn, tc);
 }
Example #3
0
 public bool add(SqlConnection cn, SqlTransaction tc, MailBoxModel model)
 {
     return DbHelperSQL.insertModel<MailBoxModel>(model, "MailBox", cn, tc);
 }