コード例 #1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>

        public int Add(USR_CustomerMod model)
        {
            int ret = 0;
            TransactionOptions options = new TransactionOptions();

            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout        = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                ret = dal.Add(model);
                USR_MessageMod m_notice = new USR_MessageMod();
                m_notice.CustomerSysNo = ret;
                m_notice.Context       = AppConst.NewUserWelcome.Replace("@nickname", model.NickName)
                                         .Replace("@userinfourl", AppConfig.HomeUrl() + "Qin/UserInfo.aspx?id=" + model.SysNo)
                                         .Replace("@pointhelpurl", AppConfig.HomeUrl() + "About/HelpCenter.aspx?memo=POINTANDCREDIT");
                m_notice.DR     = 0;
                m_notice.IsRead = 0;
                m_notice.Title  = "欢迎加入上上签";
                m_notice.TS     = DateTime.Now;
                m_notice.Type   = (int)AppEnum.MessageType.notice;
                USR_MessageBll.GetInstance().AddMessage(m_notice);
                scope.Complete();
            }
            return(ret);
        }