Пример #1
0
 public ActionResult Edit([Bind(Include = "Id,Name,IdRestaurant,IdLocation,Phone,Latitude,Longitude")] RestaurantBranchViewModel restaurantBranch)
 {
     if (ModelState.IsValid)
     {
         db.Entry(restaurantBranch.GetRestaurantBranch()).State          = EntityState.Modified;
         db.Entry(restaurantBranch.GetRestaurantBranch().Location).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(restaurantBranch));
 }
Пример #2
0
        public ActionResult Create([Bind(Include = "Id,Name,IdRestaurant,IdLocation,Phone,Latitude,Longitude")] RestaurantBranchViewModel restaurantBranch)
        {
            if (ModelState.IsValid)
            {
                db.RestaurantBranches.Add(restaurantBranch.GetRestaurantBranch());
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(restaurantBranch));
        }