Example #1
0
 public ActionResult Edit(TempAdvise tempadvise)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tempadvise).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(tempadvise);
 }
Example #2
0
        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);
        }