public ActionResult Edit([Bind(Include = "ProductId,ProductName,ProductDetails,ProductStatus,ProductUpdate,ProductQty,ProductSold,ProductsOldPrice,SupplierId,CategoryId")] Product product) { if (ModelState.IsValid) { try { db.Entry(product).State = EntityState.Modified; db.SaveChanges(); } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { System.Console.WriteLine("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage); } } } return(RedirectToAction("Index")); } ViewBag.CategoryId = new SelectList(db.Categories, "CategoryId", "CategoryName", product.CategoryId); ViewBag.SupplierId = new SelectList(db.Suppliers, "SupplierId", "CompanyName", product.SupplierId); return(View(product)); }
public ActionResult Edit([Bind(Include = "CategoryId,CategoryName,CategoryDetails")] Category category) { if (ModelState.IsValid) { db.Entry(category).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(category)); }
public ActionResult Edit([Bind(Include = "Id,RoleName,RoleDescription")] Role role) { if (ModelState.IsValid) { db.Entry(role).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(role)); }
public ActionResult Edit([Bind(Include = "ContactId,CompanyName,ContactName,Address,Region,PostalCode,Phone,ContactsTitle,Fax,Status")] Contact contact) { if (ModelState.IsValid) { db.Entry(contact).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(contact)); }
public ActionResult Edit([Bind(Include = "SupplierId,CompanyName,ContactName,ContactTitle,Address,Phone,Fax,HomePage")] Supplier supplier) { if (ModelState.IsValid) { db.Entry(supplier).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(supplier)); }
public ActionResult Edit([Bind(Include = "PromotionId,PromotionName,PromotionDetails,PromotionDiscount,PromotionStatus,PromotionOpen,PromotionClose")] Promotion promotion) { if (ModelState.IsValid) { db.Entry(promotion).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(promotion)); }
public ActionResult Edit([Bind(Include = "BranchId,BranchName,BranchDetails,EmployeeCode")] Branch branch) { if (ModelState.IsValid) { db.Entry(branch).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeCode = new SelectList(db.Employees, "EmployeeCode", "EmployeePass", branch.EmployeeCode); return(View(branch)); }
public ActionResult Edit([Bind(Include = "DeliveryId,DeliveryTitle,DeliveryDetails,DeliveryQuestion,EmployeeCode")] Delivery delivery) { if (ModelState.IsValid) { db.Entry(delivery).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeCode = new SelectList(db.Employees, "EmployeeCode", "FirstName", delivery.EmployeeCode); return(View(delivery)); }
public ActionResult Edit([Bind(Include = "AboutId,AboutUs,AboutImg,AboutDetails,EmployeeCode")] About about) { if (ModelState.IsValid) { db.Entry(about).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeCode = new SelectList(db.Employees, "EmployeeCode", "LastName", about.EmployeeCode); return(View(about)); }
public ActionResult Edit([Bind(Include = "PromotionId,ProductId,Gift")] Product_Promotion product_Promotion) { if (ModelState.IsValid) { db.Entry(product_Promotion).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProductId = new SelectList(db.Products, "ProductId", "ProductName", product_Promotion.ProductId); ViewBag.ProductId = new SelectList(db.Promotions, "PromotionId", "PromotionName", product_Promotion.ProductId); return(View(product_Promotion)); }
public ActionResult Edit([Bind(Include = "NewsId,NewTitles,NewsDetails,NewsBy,NewsDate,EmployeeCode")] News news) { if (ModelState.IsValid) { try { db.Entry(news).State = EntityState.Modified; db.SaveChanges(); } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { System.Console.WriteLine("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage); } } } return(RedirectToAction("Index")); } ViewBag.EmployeeCode = new SelectList(db.Employees, "EmployeeCode", "FirstName", news.EmployeeCode); return(View(news)); }
public ActionResult Edit([Bind(Include = "EmployeeCode,EmployeePass,LastName,FirstName,Title,TitleOfCourtesy,BirthDate,HireDate,Address,PostalCode,HomePhone,Extension,Notes,RoleId")] Employee employee) { if (ModelState.IsValid) { try { db.Entry(employee).State = EntityState.Modified; db.SaveChanges(); } catch (DbEntityValidationException dbEx) { foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { System.Console.WriteLine("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage); } } } return(RedirectToAction("Index")); } ViewBag.RoleId = new SelectList(db.Roles, "Id", "RoleName", employee.RoleId); return(View(employee)); }