public async Task <IActionResult> PutApplications(int id, Applications applications) { if (id != applications.Id) { return(BadRequest()); } _context.Entry(applications).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ApplicationsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <string> AddApplication(Applications Application) { if (db != null) { await db.Applications.AddAsync(Application); await db.SaveChangesAsync(); return(Application.ApplicationNumber); } return(string.Empty); }
public async Task RegisterAsync(PointOfSale pointOfSale, ChangeComposition composition) { using var context = new PointOfSaleContext(_configuration); await context.Transactions.AddAsync(new Transactions { ValueToPay = pointOfSale.ValueToPay, TotalValue = pointOfSale.TotalValue, Change = composition.TotalChange, ChangeMessage = composition.ResponseMessage }); await context.SaveChangesAsync(); }