public async Task <APIResult> SaveDisForStaff(StaffDisParamDto param) { try { string disStaffXml = CommonHelper.Serializer(typeof(List <StaffDisListDto>), param.DisList); string spName = @"up_RMMT_STA_SaveDisForStaff_C"; DynamicParameters dp = new DynamicParameters(); dp.Add("@UserId", param.InUserId, DbType.Int32); dp.Add("@DisStaffXML", disStaffXml, DbType.Xml); dp.Add("@DisStaffParam", "/ArrayOfStaffDisListDto/StaffDisListDto", DbType.String); dp.Add("@YearMonth", param.YearMonth, DbType.String); dp.Add("@BusType", param.BusType, DbType.String); using (var conn = new SqlConnection(DapperContext.Current.SqlConnection)) { conn.Open(); using (var tran = conn.BeginTransaction(System.Data.IsolationLevel.ReadCommitted)) { await conn.ExecuteAsync(spName, dp, tran, null, CommandType.StoredProcedure); tran.Commit(); } return(new APIResult { Body = "", ResultCode = ResultType.Success, Msg = "" }); } } catch (Exception ex) { return(new APIResult { Body = "", ResultCode = ResultType.Failure, Msg = ex.Message }); } }
public async Task <APIResult> SaveDisForStaff([FromBody] StaffDisParamDto param) { return(await _perMngService.SaveDisForStaff(param)); }