CCN.Modules.Customer.DataAccess.CustomerDA.UpdateAuthentication C# (CSharp) Method

UpdateAuthentication() public method

用户修改认证信息
public UpdateAuthentication ( CustAuthenticationModel model ) : int
model CCN.Modules.Customer.BusinessEntity.CustAuthenticationModel 认证信息
return int
        public int UpdateAuthentication(CustAuthenticationModel model)
        {
            var sqlStr = new StringBuilder("update `cust_authentication` set ");
            sqlStr.Append(Helper.CreateField(model).Trim().TrimEnd(','));
            sqlStr.Append(" where innerid = @innerid");

            const string sqlU = "update cust_info set authstatus=4 where innerid=@innerid;";
            using (var conn = Helper.GetConnection())
            {
                var tran = conn.BeginTransaction();
                try
                {
                    conn.Execute(sqlU, new { innerid = model.Custid }, tran);
                    conn.Execute(sqlStr.ToString(), model, tran);
                    tran.Commit();
                    return 1;
                }
                catch (Exception ex)
                {
                    LoggerFactories.CreateLogger().Write("UpdateAuthentication Ex:" + ex.Message, TraceEventType.Error);
                    tran.Rollback();
                    return 0;
                }
            }
        }