// GET: Reviewer/Details/5
        public ActionResult Details(int id)
        {
            var bl = new Dubuche.BL.ReviewerCRUD();
            var x  = bl.DisplayRestaurantReviewersById(id);

            return(View(x));
        }
        // GET: Reviewer/Create
        public ActionResult Create()
        {
            var bl       = new Dubuche.BL.ReviewerCRUD();
            var restCrud = new Dubuche.BL.RestaurantCRUD();

            ViewBag.Rests = restCrud.GetAllRestaurants();
            return(View());
        }
        // GET: Reviewer/Edit/5
        public ActionResult Edit(int id)
        {
            var bl       = new Dubuche.BL.ReviewerCRUD();
            var x        = bl.DisplayRestaurantReviewersById(id);
            var restCrud = new Dubuche.BL.RestaurantCRUD();

            ViewBag.Rests = restCrud.GetAllRestaurants();
            return(View(x));
        }
 public ActionResult Edit(int id, Reviewer reviewer2)
 {
     try
     {
         // TODO: Add update logic here
         var bl = new Dubuche.BL.ReviewerCRUD();
         bl.UpdateReviewers(reviewer2);
         return(RedirectToAction("Index"));
     }
     catch
     {
         log = LogManager.GetLogger("mistakes");
         return(View());
     }
 }
        public ActionResult Create(Reviewer reviewer)
        {
            try
            {
                // TODO: Add insert logic here
                var bl = new Dubuche.BL.ReviewerCRUD();
                bl.CreateReviewer(reviewer);

                return(RedirectToAction("Index"));
            }
            catch
            {
                log = LogManager.GetLogger("mistakes");
                return(View());
            }
        }
 public ActionResult Delete(int id, Reviewer reviewer)
 {
     try
     {
         // TODO: Add delete logic here
         var bl = new Dubuche.BL.ReviewerCRUD();
         bl.DeleteReviewerById(id);
         return(RedirectToAction("Index"));
     }
     catch (Exception e)
     {
         log = LogManager.GetLogger("mistakes");
         log.Error($"[Reviewer Controller] [Delete] Exception thrown: {e.Message}");
         return(RedirectToAction("Index"));
     }
 }
        // GET: Reviewer/Delete/5
        public ActionResult Delete(int id)
        {
            var bl = new Dubuche.BL.ReviewerCRUD();

            return(View(bl.DisplayRestaurantReviewersById(id)));
        }
        // GET: Reviewer
        public ActionResult Index()
        {
            var bl = new Dubuche.BL.ReviewerCRUD();

            return(View(bl.AllReviewers()));
        }