public async Task <int> CreateDraftProfile(MCredit_TempProfile model) { try { model.Id = 0; var param = GetParams(model, "Id", ignoreKey: new string[] { nameof(model.CreatedTime), nameof(model.UpdatedTime), nameof(model.isAddr), nameof(model.isInsur), nameof(model.MCId) }); using (var con = GetConnection()) { await con.ExecuteAsync("sp_insert_MCredit_TempProfile", param, commandType : CommandType.StoredProcedure); return(param.Get <int>("Id")); } } catch (Exception e) { return(0); } }
public async Task <BaseResponse <bool> > UpdateDraftProfileAsync(MCredit_TempProfile model) { var param = GetParams(model, ignoreKey: new string[] { nameof(model.CreatedTime), nameof(model.UpdatedTime), nameof(model.CreatedBy), nameof(model.MCId), nameof(model.isAddress), nameof(model.isInsur) }); try { using (var con = GetConnection()) { await con.ExecuteAsync("sp_update_MCredit_TempProfile", param, commandType : CommandType.StoredProcedure); return(BaseResponse <bool> .Create(true)); } } catch (Exception e) { return(BaseResponse <bool> .Create(false, GetException(e))); } }
public async Task <bool> UpdateDraftProfile(MCredit_TempProfile model) { var param = GetParams(model, ignoreKey: new string[] { nameof(model.CreatedTime), nameof(model.UpdatedTime), nameof(model.CreatedBy), nameof(model.isAddr), nameof(model.isInsur) }); using (var con = GetConnection()) { await con.ExecuteAsync("sp_update_MCredit_TempProfile", param, commandType : CommandType.StoredProcedure); return(true); } }