public ActionResult CreateConfirmed(Employee emp) { if (ModelState.IsValid) { db.Employees.Add(emp); db.SaveChanges(); return(RedirectToAction("Details", new { id = emp.PersonnelNumber })); } return(RedirectToAction("Table")); }
public ActionResult CreateConfirmed(MoneyReceipt receipt) { try { if (ModelState.IsValid) { db.MoneyReceipts.Add(receipt); db.SaveChanges(); return(RedirectToAction("Details", new { id = receipt.ReceiptID })); } return(View("Error")); } catch (Exception) { return(View("Error")); } }
public ActionResult CreateConfirmed(CustomerEnt customer) { try { if (ModelState.IsValid) { db.CustomerEnts.Add(customer); db.SaveChanges(); return(RedirectToAction("Details", new { id = customer.ClientID })); } return(View("Error")); } catch (Exception) { return(View("Error")); } }
public ActionResult Create(Order order) { try { //if (ModelState.IsValid) //{ db.Orders.Add(order); db.SaveChanges(); return(RedirectToAction("Details", new { id = order.OrderID })); //} //return View("Error"); } catch (Exception) { return(View("Error")); } }
public ActionResult CreateConfirmed(Product product) { try { if (ModelState.IsValid) { db.Products.Add(product); db.SaveChanges(); return(RedirectToAction("Details", new { id = product.ProductID })); } return(View("Error")); } catch (Exception) { return(View("Error")); } }
public ActionResult CreateConfirmed(Supplier supplier) { try { if (ModelState.IsValid) { supplier.AddtoTable(db, supplier); db.SaveChanges(); return(RedirectToAction("Details", new { id = supplier.SupplierPAN })); } return(View("Error")); } catch (Exception) { return(View("Error")); } }