public ActionResult Edit(TempAdvise tempadvise) { if (ModelState.IsValid) { db.Entry(tempadvise).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(tempadvise); }
public ActionResult Create(TempAdvise tempadvise) { tempadvise.contact = tempadvise.contact == null ? new HotelInfoHelp().getUId() : tempadvise.contact; tempadvise.SubmitTime = DateTime.Now; if (ModelState.IsValid) { db.TempAdvises.Add(tempadvise); if(db.SaveChanges()>0) return View("Success"); else return View("Faiture"); } return View(tempadvise); }