Example #1
0
        // GET: Cabinet/menu/List
        public ActionResult Detail(int id)
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }

            if (id < 1)
            {
                return(HttpNotFound());
            }
            var operation = new LoadCategoriesOperation();

            operation.ExcecuteTransaction();

            var operation2 = new LoadProductOperation(id);

            operation2.ExcecuteTransaction();
            if (operation2._product == null)
            {
                return(HttpNotFound());
            }

            ViewBag.IsSave = false;
            return(View(new ProductModel {
                Categories = operation._categories, Product = operation2._product
            }));
        }
Example #2
0
        public ActionResult Login()
        {
            if (SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Index", "Main"));
            }

            return(View(new LoginModel()));
        }
Example #3
0
        public ActionResult Login()
        {
            if (SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("List", "Service"));
            }

            return(View(new LoginModel()));
        }
Example #4
0
        // GET: Cabinet/Page/List
        public ActionResult List()
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }

            return(View());
        }
Example #5
0
        // GET: Cabinet/Game/List
        public ActionResult List()
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }

            var operation = new LoadGamesOperation();

            operation.ExcecuteTransaction();
            return(View(operation._games));
        }
Example #6
0
        public ActionResult List(CategoryModel model)
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }

            var operation = new LoadAllProductsOperation(model.Id);

            operation.ExcecuteTransaction();
            return(PartialView("Partial/_listOfProductsPartial", operation._products));
        }
Example #7
0
        public ActionResult Add(Doctor model, HttpPostedFileBase image)
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }

            AddDoctorOperation op = new AddDoctorOperation(model, image);

            op.ExcecuteTransaction();

            return(RedirectToAction("List"));
        }
Example #8
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());
        }
Example #9
0
        public ActionResult ChangeState(int Id, bool IsModerated)
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }

            var op = new EditCommentsOperation(Id, IsModerated);

            op.ExcecuteTransaction();

            return(Json("success"));
        }
Example #10
0
        public ActionResult Add()
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }

            ViewBag.IsSave = false;
            var operation = new LoadCategoriesOperation();

            operation.ExcecuteTransaction();
            return(View(operation._categories));
        }
Example #11
0
        public ActionResult Delete(int[] ids)
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }
            DeleteDoctorsOperation op = new DeleteDoctorsOperation(ids);

            op.ExcecuteTransaction();

            var operation = new LoadAllDoctorsOperation();

            operation.ExcecuteTransaction();

            return(PartialView("Partial/_listOfDoctorsPartial", operation._doctors));
        }
Example #12
0
        public ActionResult Detail(Comment model, HttpPostedFileBase image)
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }
            var op = new UpdateCommentOperation(model, image);

            op.ExcecuteTransaction();
            if (op._comment == null)
            {
                return(HttpNotFound());
            }

            return(View(op._comment));
        }
Example #13
0
        public ActionResult Delete(ImageDeleteModel image)
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }

            if (image.Id < 1)
            {
                return(HttpNotFound());
            }
            var operation = new DeleteImageOperation(image.Id);

            operation.ExcecuteTransaction();
            return(Json(new { IsSuccess = operation.Success }));
        }
Example #14
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));
        }
Example #15
0
        public ActionResult Detail(PageDescription model, HttpPostedFileBase[] images)
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }
            UpdatePagesDescOperation op = new UpdatePagesDescOperation(model.Id, model.Description, model.Title, model.VideoURL, images);

            op.ExcecuteTransaction();
            if (op._pageDescription == null)
            {
                return(HttpNotFound());
            }

            return(View(op._pageDescription));
        }
Example #16
0
        // GET: Cabinet/Menu/List
        public ActionResult List()
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }

            var operation = new LoadCategoriesOperation();

            operation.ExcecuteTransaction();
            var operation2 = new LoadAllProductsOperation(0);

            operation2.ExcecuteTransaction();
            return(View(new MenuListModel {
                Categories = operation._categories, Products = operation2._products
            }));
        }
Example #17
0
        // GET: Cabinet/Main
        public ActionResult Index()
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }

            var operation = new LoadPagesDescOperation("home", "index");

            operation.ExcecuteTransaction();
            if (operation._pageDescription == null)
            {
                return(HttpNotFound());
            }

            return(View(operation._pageDescription));
        }
Example #18
0
        public ActionResult Add(Product model, HttpPostedFileBase image)
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }

            AddProductOperation op = new AddProductOperation(model.CategoryId, model.Description, model.Title, model.Price, model.IsHot, image);

            op.ExcecuteTransaction();

            var operation = new LoadCategoriesOperation();

            operation.ExcecuteTransaction();

            ViewBag.IsSave = true;
            return(View(operation._categories));
        }
Example #19
0
        public ActionResult Detail(Game model)
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }
            var op = new UpdateGameOperation(model.Id, model.Name, model.Price, model.Description);

            op.ExcecuteTransaction();
            if (op._game == null)
            {
                return(HttpNotFound());
            }
            ViewBag.IsSave = true;

            return(View(new GameModel {
                Game = op._game
            }));
        }
Example #20
0
        public ActionResult Detail(int id)
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }

            if (id < 1)
            {
                return(HttpNotFound());
            }

            var operation2 = new LoadCommentOperation(id);

            operation2.ExcecuteTransaction();
            if (operation2._comment == null)
            {
                return(HttpNotFound());
            }

            return(View(operation2._comment));
        }
Example #21
0
        public ActionResult Detail(Product model, HttpPostedFileBase image)
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }
            UpdateProductOperation op = new UpdateProductOperation(model.Id, model.CategoryId, model.Description, model.Title, model.Price, model.IsHot, image);

            op.ExcecuteTransaction();
            if (op._product == null)
            {
                return(HttpNotFound());
            }
            var operation = new LoadCategoriesOperation();

            operation.ExcecuteTransaction();
            ViewBag.IsSave = true;

            return(View(new ProductModel {
                Categories = operation._categories, Product = op._product
            }));
        }
Example #22
0
        // GET: Cabinet/menu/List
        public ActionResult Detail(int id)
        {
            if (!SessionHelpers.IsAuthentificated())
            {
                return(RedirectToAction("Login", "Authorize"));
            }

            if (id < 1)
            {
                return(HttpNotFound());
            }
            var operation = new LoadGameOperation(id);

            operation.ExcecuteTransaction();
            if (operation._game == null)
            {
                return(HttpNotFound());
            }

            ViewBag.IsSave = false;
            return(View(new GameModel {
                Game = operation._game
            }));
        }