public ActionResult Edit([Bind(Include = "UserId,UserName,Password,RoleName,EmployeeId,IsActive,Employee")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Edit([Bind(Include = "SuppliersId,SuppliersName,CellNo,Address,AddBy,IsActive")] Supplier supplier) { if (ModelState.IsValid) { db.Entry(supplier).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(supplier)); }
public ActionResult Edit([Bind(Include = "CustomerId,CustomerName,Address,CellNo,AddedBy")] Customer customer) { if (ModelState.IsValid) { db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customer)); }
public ActionResult Edit([Bind(Include = "ProductID,ProductName,Quantity,ImageUrl,AddedBy,InActive")] Stock stock) { if (ModelState.IsValid) { db.Entry(stock).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(stock)); }
public ActionResult Edit([Bind(Include = "EmployeeId,EmployeeName,Email,CellNo,Address,Salary,AddedBy,IsActive")] Employee employee) { if (ModelState.IsValid) { db.Entry(employee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(employee)); }
public ActionResult Edit([Bind(Include = "OrderId,OrderDate,ProductId,CustomerId,AddedBy,Quantity,UnitPrice")] Order order) { if (ModelState.IsValid) { db.Entry(order).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CustomerId = new SelectList(db.Customers, "CustomerId", "CustomerName", order.CustomerId); ViewBag.ProductId = new SelectList(db.Stocks, "ProductID", "ProductName", order.ProductId); return(View(order)); }
public ActionResult Edit([Bind(Include = "Id,PurchaseDate,ProductId,Quantity,UnitPrice,Total,SuppliersId,AddedBy")] Purchase purchase) { if (ModelState.IsValid) { db.Entry(purchase).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProductId = new SelectList(db.Stocks, "ProductID", "ProductName", purchase.ProductId); ViewBag.SuppliersId = new SelectList(db.Suppliers, "SuppliersId", "SuppliersName", purchase.SuppliersId); return(View(purchase)); }