예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            RestaurantBranch restaurantBranch = db.RestaurantBranches.Find(id);

            db.RestaurantBranches.Remove(restaurantBranch);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public RestaurantBranch GetRestaurantBranch()
        {
            var restaurantBranch = new RestaurantBranch();

            SetLocation();
            restaurantBranch.Id           = Id;
            restaurantBranch.Location     = Location;
            restaurantBranch.Name         = Name;
            restaurantBranch.Phone        = Phone;
            restaurantBranch.IdRestaurant = IdRestaurant;
            restaurantBranch.IdLocation   = IdLocation;
            return(restaurantBranch);
        }
예제 #3
0
        // GET: RestaurantBranches/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RestaurantBranch restaurantBranch = db.RestaurantBranches.Find(id);

            if (restaurantBranch == null)
            {
                return(HttpNotFound());
            }
            return(View(restaurantBranch));
        }
 public RestaurantBranchViewModel(RestaurantBranch rb)
 {
     Id           = rb.Id;
     IdRestaurant = rb.IdRestaurant;
     IdLocation   = rb.IdLocation;
     Name         = rb.Name;
     Phone        = rb.Phone;
     if (rb.Location != null)
     {
         Location  = rb.Location;
         Latitude  = rb.Location.Latitude;
         Longitude = rb.Location.Longitude;
     }
 }