示例#1
0
        public async Task <IActionResult> Edit(long id)
        {
            try
            {
                adminTempStatu = Convert.ToBoolean(HttpContext.Session.GetString("AdminStatu"));

                if (adminTempStatu)
                {
                    EntryRestfulService service = new EntryRestfulService();
                    Entry data = await service.GetEntryAsync(id);

                    CategoryRestfulService categoryService = new CategoryRestfulService();
                    List <Category>        CategoryList    = await categoryService.ListCategoryAsync();

                    ViewBag.Categories = CategoryList;

                    return(View(data));
                }
                else
                {
                    return(Redirect("/Admin/Index"));
                }
            }
            catch (Exception)
            {
                return(Redirect("/Admin/Index"));
            }
        }
示例#2
0
        public async Task <IActionResult> Detail(long id)
        {
            EntryRestfulService service = new EntryRestfulService();
            Entry data = await service.GetEntryAsync(id);

            return(View(data));
        }