Пример #1
0
        // GET: Category
        public ActionResult Index()
        {
            //After Category CRUD operations Remove Category Cache
            CatagoryCacheHelper.RemoveCategoryListFromCache();

            return(View(CatagoryCacheHelper.GetCategoriesFromCache()));//Get Category With Cache Operations
            //return View(_categoryService.GetAllCategories().ToList());//without cache
        }
Пример #2
0
        // GET: Note
        public ActionResult Index()
        {
            //Remove Category Cache
            CatagoryCacheHelper.RemoveCategoryListFromCache();

            var notes = _noteService.GetAllNotes(includeProperties: "Category,User");

            return(View(notes.ToList()));
        }
Пример #3
0
        //Get All Category for left side menu
        public ActionResult GetAllCategories()
        {
            //IQueryable<Category> categories = _categoryService.GetAllCategories().AsQueryable();
            //ViewBag.GetAllCategoriesForPartialView = categories;

            ViewBag.GetAllCategoriesForPartialView = CatagoryCacheHelper.GetCategoriesFromCache();

            return(PartialView("GetAllCategories"));
        }
Пример #4
0
 public ActionResult NoteDetails(Note note)
 {
     if (ModelState.IsValid)
     {
         _noteService.UpdateNote(note);
         return(RedirectToAction("NoteDetails", note.NoteId));
     }
     ViewBag.CategoryId = new SelectList(CatagoryCacheHelper.GetCategoriesFromCache(), "CategoryId", "Title");
     ViewBag.UserId     = new SelectList(_userService.GetAllUser(), "UserId", "Name");
     return(View(note));
 }
Пример #5
0
        public ActionResult NoteDetails(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Note note = _noteService.GetNoteByIdInclude((long)id);

            if (note == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CategoryId = new SelectList(CatagoryCacheHelper.GetCategoriesFromCache(), "CategoryId", "Title");
            ViewBag.UserId     = new SelectList(_userService.GetAllUser(), "UserId", "Name");
            return(View(note));
        }
Пример #6
0
 // GET: Note/Create
 public ActionResult Create()
 {
     ViewBag.CategoryId = new SelectList(CatagoryCacheHelper.GetCategoriesFromCache(), "CategoryId", "Title");
     ViewBag.UserId     = new SelectList(_userService.GetAllUser(), "UserId", "Name");
     return(View());
 }