예제 #1
0
        public ActionResult Update(restuarant rest)
        {
            // update database and return to index
            var crud = new DataAccess();

            crud.UpdateRest(rest);
            return(RedirectToAction("Index", "Restuarant"));
            //return Content(rest.id.ToString() + " " + rest.name + rest.address);
        }
예제 #2
0
 public ActionResult Create(restuarant rest)
 {
     try
     {
         var crud = new DataAccess();
         crud.AddRestuarant(rest.name, rest.address);
         return(RedirectToAction("Index", "Restuarant"));
     }
     catch
     {
         return(RedirectToAction("Index", "Restuarant"));
     }
 }