Esempio n. 1
0
        public async Task <IActionResult> Create()
        {
            try
            {
                ViewData["listMenu"] = await _menuManager.Get_List_Child();

                ViewData["listAllMenu"] = await _menuManager.Get_List_Menu();

                var values = Enum.GetValues(typeof(PermissionEnum));
                List <LookupModel> data = new List <LookupModel>();
                foreach (var item in values)
                {
                    data.Add(new LookupModel()
                    {
                        Title = Extensions.GetEnumDescription((PermissionEnum)item),
                        Value = item.ToString()
                    });
                }
                ViewData["listPermission"] = data;
                return(View("Create"));
            }
            catch (Exception ex)
            {
                return(Json(new { Result = false, Message = ex.Message }));
            }
        }
Esempio n. 2
0
        public async Task <IActionResult> Create()
        {
            try
            {
                ViewData["listMenu"] = await _menuManager.Get_List_Menu();

                return(PartialView("_Create"));
            }
            catch (Exception ex)
            {
                return(Json(new { Result = false, Message = ex.Message }));
            }
        }