public async Task <IActionResult> GetExpensesByDepartment(string code) { if (!await _permissionService.CanAccessDepartment(User.Identity.Name, code)) { return(Forbid()); } using (var conn = _dbService.GetConnection()) { return(Ok(await conn.QueryAsync <ExpenseSummary>("usp_getTotalExpensesByDepartment", new { OrgR = code }, commandType: CommandType.StoredProcedure))); } }
public async Task <IActionResult> GetAsync(string org) { if (!await _permissionService.CanAccessDepartment(User.Identity.Name, org)) { return(Forbid()); } using (var conn = _dbService.GetConnection()) { return(Ok(await conn.QueryAsync <ProjectModel>("usp_getProjectsByDept", new { OrgR = org }, commandType: CommandType.StoredProcedure))); } }
public async Task <IActionResult> Get(string org, string grouping, bool showAssociated = true, bool showUnassociated = true) { if (!await _permissionService.CanAccessDepartment(User.Identity.Name, org)) { return(Forbid()); } using (var conn = _dbService.GetConnection()) { return(Ok(await conn.QueryAsync <ExpenseModel>("usp_getExpenseRecordGrouping", new { Grouping = grouping, OrgR = org, Associated = showAssociated, Unassociated = showUnassociated }, commandType: CommandType.StoredProcedure))); } }