Exemplo n.º 1
0
        public ActionResult Index()
        {
            allRestaurantInfo restaurants = new allRestaurantInfo();

            restaurants.categoryList = categrories.GetAllValues();

            return(View(restaurants));
        }
Exemplo n.º 2
0
        public ActionResult ShowAllRestaurants(int?page)
        {
            allRestaurantInfo rest = new allRestaurantInfo();

            rest.restaurants  = restaurants.GetAllValues();
            rest.categoryList = categoryList.GetAllValues();
            rest.areaList     = areafullList.GetAllValues();

            return(View(rest));
        }
Exemplo n.º 3
0
        public ActionResult showRestaurantByArea(int Id)
        {
            string areaname = areafullList.GetSingle(Id).AreaName;

            allRestaurantInfo rest = new allRestaurantInfo();

            rest.branches     = restaurantBranch.GetByLocation(areaname);
            rest.categoryList = categoryList.GetAllValues();
            rest.areaList     = areafullList.GetAllValues();

            //ViewBag.areaName = areaname;

            return(View(rest));
        }
Exemplo n.º 4
0
        public ActionResult Index(int Id)
        {
            ViewBag.restID            = Id;
            ViewBag.restName          = restaurants.GetSingle(Id).restaurantName;
            ViewBag.restLogo          = Url.Content(restaurants.GetSingle(Id).restaurantLogo);
            ViewBag.details           = restaurants.GetSingle(Id).restaurantDetails;
            ViewBag.restContactNumber = restaurants.GetSingle(Id).ContactNumber;
            ViewBag.restRating        = restaurants.GetSingle(Id).avarageRating;
            ViewBag.restWebsite       = restaurants.GetSingle(Id).Website;

            IEnumerable <Restaurant_user_Review> reviewList     = review.GetByRestaurant(Id);
            List <RestaurantReviewFullModel>     reviewFullList = new List <RestaurantReviewFullModel>();

            foreach (Restaurant_user_Review re in reviewList)
            {
                RestaurantReviewFullModel r = new RestaurantReviewFullModel();
                r.Id              = re.Id;
                r.Content         = re.ReviewContent;
                r.UserId          = re.userID;
                r.UserName        = users.GetSingle(re.userID).fullName;
                r.UserPic         = users.GetSingle(re.userID).profilePicture;
                r.restID          = re.restID;
                r.ReviewGivenDate = re.ReviewDate;

                reviewFullList.Add(r);
            }

            allRestaurantInfo restaurantInfo = new allRestaurantInfo();

            restaurantInfo.foodItems    = restaurantItems.GetByRestaurant(Id);
            restaurantInfo.foodCategory = restaurantCategory.GetByRestaurant(Id);
            restaurantInfo.branches     = restaurantBranch.GetByRestaurant(Id);
            restaurantInfo.posts        = restaurantPosts.GetByRestaurant(Id);
            restaurantInfo.reviews      = reviewFullList;

            restaurantInfo.categoryList = categoryList.GetAllValues();

            ViewBag.userID   = Session["UserID"];
            ViewBag.userName = Session["UserName"];
            ViewBag.logged   = Session["loggedOn"];

            return(View(restaurantInfo));
        }