Beispiel #1
0
        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());
        }
Beispiel #2
0
        public async Task <string> AddApplication(Applications Application)
        {
            if (db != null)
            {
                await db.Applications.AddAsync(Application);

                await db.SaveChangesAsync();

                return(Application.ApplicationNumber);
            }

            return(string.Empty);
        }
Beispiel #3
0
        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();
        }