Exemplo n.º 1
0
        public ActionResult Create()
        {
            categoryLogics = new CategoryLogics();
            var data = categoryLogics.GetCategories();

            return(View(data));
        }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            blogLogics     = new BlogLogics();
            categoryLogics = new CategoryLogics();

            var data = categoryLogics.GetCategories();

            if (data == null || data.Count == 0)
            {
                return(RedirectToAction("Index", "Category"));
            }
            var obj = blogLogics.GetBlogs();

            return(View(obj));
        }
Exemplo n.º 3
0
        public ActionResult Edit(int?Id)
        {
            blogLogics     = new BlogLogics();
            categoryLogics = new CategoryLogics();
            if (Id == null)
            {
                return(View("Error"));
            }

            var data         = blogLogics.GetBlog(Id);
            var CategoryList = categoryLogics.GetCategories();

            if (data == null)
            {
                ViewBag.Msg = "No Blog found with this Blog-Id";
                return(View("Error"));
            }

            ViewBag.Blog_Id          = data.Id;
            ViewBag.Blog_Headline    = data.Blog_Headline;
            ViewBag.Blog_Description = data.Blog_Description;

            return(View(CategoryList));
        }
Exemplo n.º 4
0
        public ActionResult Index()
        {
            var data = categoryLogics.GetCategories();

            return(View(data));
        }