public ActionResult Edit([Bind(Include = "ID,ParentID,Name,IsActive,CreateDate,CreateUserID,UpdateDate,UpdateUserID")] 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,Name,LastName,Email,Telephone,Password,TCKN,IsActive,IsAdmin,CreateDate,CreateUserID,UpdateDate,UpdateUserID")] User user) { if (ModelState.IsValid) { db.Entry(user).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public ActionResult Edit([Bind(Include = "ID,Name,CategoryID,Brand,Model,ImageUrl,Description,Price,Tax,Discount,Stock,IsActive,CreateDate,CreateUserID,UpdateDate,UpdateUserID")] Product product) { if (ModelState.IsValid) { db.Entry(product).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CategoryID = new SelectList(db.Categories, "ID", "Name", product.CategoryID); return(View(product)); }
public ActionResult Edit([Bind(Include = "ID,UserID,UserAdressID,StatusID,TotalProductPrice,TotalTaxPrice,TotalDiscount,TotalPrice,CreateDate,CreateUserID,UpdateDate,UpdateUserID")] Order order) { if (ModelState.IsValid) { db.Entry(order).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.StatusID = new SelectList(db.Statuses, "ID", "Name", order.StatusID); ViewBag.UserID = new SelectList(db.Users, "ID", "Name", order.UserID); ViewBag.UserAdressID = new SelectList(db.UserAdress, "ID", "Title", order.UserAdressID); return(View(order)); }