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;
}
}
}