public async Task <IActionResult> GetBatch(long id) { var batch = await _batchService.GetBatch(id); if (batch != null) { return(Ok(batch)); } return(StatusCode(500, "Unable to retrieve batch.")); }
public async Task <IActionResult> Get(int id) { try { BatchDto batch = await BatchService.GetBatch(id); return(Ok(batch)); } catch (Exception ex) { Log.Error($"Error geting batch with ID \"{id}\"."); throw; } }
public bool SendNomination(List <string> transactionIDs) { bool sendToTest = Convert.ToBoolean(ConfigurationManager.AppSettings["SendToTest"]); bool results = false; var identity = (ClaimsPrincipal)Thread.CurrentPrincipal; string company = identity.Claims.Where(c => c.Type == "CompanyId") .Select(c => c.Value).SingleOrDefault(); int companyID = String.IsNullOrEmpty(company) ? 0:int.Parse(company); List <bool> tempBool = new List <bool>(); foreach (var transactionID in transactionIDs) { BatchDTO batch = batchService.GetBatch(Guid.Parse(transactionID)); if (batch == null || batch.StatusID != (int)NomStatus.Draft || batch.DateBeg.Date < DateTime.Now.Date || batch.DateEnd.Date < DateTime.Now.Date) { tempBool.Add(false); } else { bool result; if (batchService.ValidateNomination(Guid.Parse(transactionID), batch.pipeDUNSNo)) { result = pntNominationService.SendNominationTransaction(new Guid(transactionID), companyID, sendToTest); } else { result = false; } tempBool.Add(result); } } if ((tempBool.Where(a => a == false).Count()) == 0) { results = true; } return(results); }
public IActionResult GetBatch() { var result = _service.GetBatch(); return(File(result.MemStream, result.ContentType, result.FileName)); }
public Batch GetBatch(long batchId) { return(_batchService.GetBatch(batchId)); }
public IHttpActionResult GetBatch() { return(Ok(new { results = batchService.GetBatch() })); }