public async Task <IActionResult> Edit(int id, [Bind("InvoiceID,FullName,Address,Location,City,ProductName,Qty,Price")] TexInvoice texInvoice) { if (id != texInvoice.InvoiceID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(texInvoice); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TexInvoiceExists(texInvoice.InvoiceID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(texInvoice)); }
public async Task <IActionResult> Create([Bind("InvoiceID,FullName,Address,Location,City,ProductName,Qty,Price")] TexInvoice texInvoice) { if (ModelState.IsValid) { _context.Add(texInvoice); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(texInvoice)); }