Ejemplo n.º 1
0
        /// <summary>
        /// Danh sách sidebar
        /// </summary>
        /// <param name="actionName">Tên action</param>
        /// <param name="controllerName">Tên controller</param>
        /// <param name="openTab">Mở tab lớn khi có chọn con</param>
        /// <returns></returns>
        public PartialViewResult Sidebar(string actionName = "Index", string controllerName = "Home", string openTab = "")
        {
            //All menuFunction
            //var list = CacheLayer.Get<List<MenuFunction>>(ConstField.AllListMenuFunctionCache);
            //if(list==null)
            //{
            //    list = _MenuFunctionService.GetAllActive().ToList();
            //    CacheLayer.Add(ConstField.AllListMenuFunctionCache, list, ConstField.TimeCache);
            //}
            // Current User
            var user = GetCurrentUser.GetUser();

            // get all Role menu buy User
            var model = new List <MenuFunction>();

            if (user != null)
            {
                model = _MenuFunctionService.GetAllMenuByPermisstion(user.Id, user.Admin).Distinct().ToList();
            }

            var pageModel = new PageNameModel
            {
                ControllerName = controllerName,
                ActionName     = actionName,
                OpenMenu       = openTab
            };

            ViewBag.PageModel = pageModel;
            return(PartialView(model));
        }
Ejemplo n.º 2
0
 public void doSplit()
 {
     try {
         Document sourceDocument = new Document(_settings.SourcePdfFilePath);
         int      n = 0;
         sourceDocument.Pages.ToList().ForEach(
             sourcePage => {
             n++;
             PageNameModel pageSettings = _settings.PageNameList.FirstOrDefault(x => x.Id == n);
             if (pageSettings?.Name?.Trim().Length > 0)
             {
                 Document destinationDocument = new Document();
                 destinationDocument.Pages.Add(sourcePage);
                 destinationDocument.Save($"{_settings.OutputFilesPath}{pageSettings.Name}");
             }
         });
     } catch (Exception ex) {
         ExceptionsService.displayError(ex);
     }
 }