Esempio n. 1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(DeskQuote).State = EntityState.Modified;

            try
            {
                DeskQuote.Total = DeskQuoteCalculations.getPrice(DeskQuote.Depth, DeskQuote.Width, DeskQuote.Material, DeskQuote.Rush, DeskQuote.Drawers);
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DeskQuoteExists(DeskQuote.ID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Details", new { id = DeskQuote.ID }));
        }