コード例 #1
0
        // GET: Comments
        public ActionResult Index()
        {
            var op = new LoadCommentsOperation(1, ConstV.ItemsPerPage);

            op.ExcecuteTransaction();
            ViewBag.Comments = op._comments;
            return(View());
        }
コード例 #2
0
        // GET: Cabinet/Menu/List
        public ActionResult List()
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }

            var operation = new LoadCommentsOperation(1, ConstV.ItemsPerPageAdmin, true);

            operation.ExcecuteTransaction();
            ViewBag.Comments = operation._comments;
            return(View());
        }
コード例 #3
0
        public ActionResult Load(int page)
        {
            if (page < 1)
            {
                return(Json(new { noElements = true }));
            }
            var operation = new LoadCommentsOperation(page, ConstV.ItemsPerPage);

            operation.ExcecuteTransaction();
            if (operation._comments == null || operation._comments.Count == 0)
            {
                return(Json(new { noElements = true }));
            }
            return(PartialView("Comments/_listOfComments", operation._comments));
        }
コード例 #4
0
        public ActionResult Delete(int[] ids)
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }
            var op = new DeleteCommentsOperation(ids);

            op.ExcecuteTransaction();

            var operation = new LoadCommentsOperation(1, ConstV.ItemsPerPageAdmin, true);

            operation.ExcecuteTransaction();

            return(PartialView("Partial/_listOfCommentsPartial", operation._comments));
        }
コード例 #5
0
        public ActionResult Index()
        {
            var op = new LoadAllDoctorsOperation();

            op.ExcecuteTransaction();
            ViewBag.Doctors = op._doctors;
            var op2 = new LoadAllProductsOperation();

            op2.ExcecuteTransaction();
            ViewBag.Products = op2._products;
            var op3 = new LoadCommentsOperation(1, 4);

            op3.ExcecuteTransaction();
            ViewBag.Comments       = op3._comments;
            ViewBag.NavMenuEnabled = true;
            return(View(/*op._pageDescription*/));
        }