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,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,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,UserAddressId,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.UserAddressId = new SelectList(db.Addresses, "Id", "Title", order.UserAddressId); return(View(order)); }