public async Task <IActionResult> GetAllDeveloperByPhase(string caseNumber, string phaseNo) { var req = new DeveloperByPhaseRequest { CaseNumber = caseNumber, PhaseNo = phaseNo }; var result = await _personnelManager.GetAllDeveloperByPhaseAsync(req); return(Ok(result)); }
public async Task <DeveloperByPhaseResponse> GetAllDeveloperByPhaseAsync(DeveloperByPhaseRequest req) { using (var conn = new SqlConnection(_connectionSettings.DefaultConnection)) { var result = new DeveloperByPhaseResponse(); const string storeproc = @"[dbo].[uspDeveloperByPhaseGetList_New]"; await conn.OpenAsync(); var dynParm = new { req.CaseNumber, req.PhaseNo }; var rawResult = await conn.QueryAsync <DeveloperDTO>(storeproc, dynParm, null, null, CommandType.StoredProcedure); result.Data = rawResult.ToList(); return(result); } }
public async Task <DeveloperByPhaseResponse> GetAllDeveloperByPhaseAsync(DeveloperByPhaseRequest req) { var result = new DeveloperByPhaseResponse(); if (req == null) { result.HasError = true; result.ErrorMsgs.Add(new Common.DTO.ErrorDTO { ErrorMsg = "Invalid Request" }); return(result); } if (string.IsNullOrWhiteSpace(req.CaseNumber) || string.IsNullOrWhiteSpace(req.PhaseNo)) { result.HasError = true; result.ErrorMsgs.Add(new Common.DTO.ErrorDTO { ErrorMsg = "Invalid Request Parameters" }); return(result); } result = await _repos.GetAllDeveloperByPhaseAsync(req); return(result); }