public ActionResult Edit([Bind(Include = "Id,StatusName")] OrderStatus orderStatus) { if (ModelState.IsValid) { db.Entry(orderStatus).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(orderStatus); }
public async Task <ActionResult> Edit(Menyu edit) { if (ModelState.IsValid) { db.Entry(edit).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(PartialView(edit)); }
public ActionResult Edit(Tarif edit) { if (ModelState.IsValid) { edit.IsActive = Convert.ToBoolean(edit.Activ); db.Entry(edit).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(PartialView(edit)); }
public ActionResult Edit([Bind(Include = "Id,ContentText,Activ")] AboutDb aboutDb) { if (ModelState.IsValid) { aboutDb.IsActive = Convert.ToBoolean(aboutDb.Activ); aboutDb.CreateDate = DateTime.Now; db.Entry(aboutDb).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aboutDb)); }
public async Task <ActionResult> Edit(Currency edit) { if (ModelState.IsValid) { edit.IsActive = Convert.ToBoolean(edit.Activ); db.Entry(edit).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } else { return(PartialView()); } }
public ActionResult Edit(Setting edit) { if (ModelState.IsValid) { if (edit.TitleImage != null && edit.TitleImage.ContentLength > 0) { var imgName = ProsesImageFile.FileName(edit.TitleImage); var ImagePath = ProsesImageFile.ImagePath(imgName, "/Image/Settings"); edit.TitleImage.SaveAs(ImagePath); edit.TitleImagePath = "/Image/Settings/" + imgName; } db.Entry(edit).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } else { return(RedirectToAction("Index")); } }
public async Task <ActionResult> Edit(FaqDb EditFaq) { try { if (ModelState.IsValid) { EditFaq.FaqCreateDate = DateTime.Now; EditFaq.IsActive = Convert.ToBoolean(EditFaq.Activ); db.Entry(EditFaq).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } else { return(View(EditFaq)); } } catch (Exception) { return(HttpNotFound()); } }