public ActionResult Edit([Bind(Include = "CategoryID,CategoryName,Description")] Category category) { if (ModelState.IsValid) { db.Entry(category).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(category)); }
public ActionResult Edit([Bind(Include = "CustomerID,Firstname,Lastname,MailAdress,StreetAdress,City,ZipCode,CompanyName,CompanyPhoneNumber,CompanyWebSite")] CorporateCustomer corporateCustomer) { if (ModelState.IsValid) { db.Entry(corporateCustomer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(corporateCustomer)); }
public ActionResult Edit([Bind(Include = "ShippingCompanyID,ShippingCompanyName,ShippingCost")] ShippingCompany shippingCompany) { if (ModelState.IsValid) { db.Entry(shippingCompany).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(shippingCompany)); }
public ActionResult Edit([Bind(Include = "CustomerID,Firstname,Lastname,MailAdress,StreetAdress,City,ZipCode,MobileNumber")] PrivateCustomer privateCustomer) { if (ModelState.IsValid) { db.Entry(privateCustomer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(privateCustomer)); }
public ActionResult Edit([Bind(Include = "ManufacturerID,ManufacturerName")] Manufacturer manufacturer) { if (ModelState.IsValid) { db.Entry(manufacturer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(manufacturer)); }
public ActionResult Edit([Bind(Include = "OrderID,ProductID,ProductQuantity")] ProductOrder productOrder) { if (ModelState.IsValid) { db.Entry(productOrder).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.OrderID = new SelectList(db.Orders, "OrderID", "OrderID", productOrder.OrderID);//changed second parameter from orderstatus to orderid ViewBag.ProductID = new SelectList(db.Products, "ProductID", "ProductName", productOrder.ProductID); return(View(productOrder)); }
public ActionResult Edit([Bind(Include = "OrderID,OrderStatus,ShippingDate,TotalPrice,CustomerID,ShippingCompanyID")] Order order) { if (ModelState.IsValid) { db.Entry(order).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CustomerID = new SelectList(db.Customers, "CustomerID", "Firstname", order.CustomerID); ViewBag.ShippingCompanyID = new SelectList(db.ShippingCompanies, "ShippingCompanyID", "ShippingCompanyName", order.ShippingCompanyID); return(View(order)); }
public ActionResult Edit([Bind(Include = "ProductID,DiscountPercentage,Stock,UnitPrice,ProductName,CategoryID,ManufacturerID")] Product product) { if (ModelState.IsValid) { db.Entry(product).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CategoryID = new SelectList(db.Categories, "CategoryID", "CategoryName", product.CategoryID); ViewBag.ManufacturerID = new SelectList(db.Manufacturers, "ManufacturerID", "ManufacturerName", product.ManufacturerID); return(View(product)); }