/// <summary>
        /// Страница с бланки на документи
        /// </summary>
        /// <returns></returns>
        public IActionResult Index()
        {
            HtmlTemplateFilterVM model = new HtmlTemplateFilterVM()
            {
                HtmlTemplateTypeId = -1
            };

            SetViewbag();
            ViewBag.breadcrumbs = commonService.Breadcrumbs_HtmlTemplate().DeleteOrDisableLast();
            return(View(model));
        }
        public IActionResult Index(string filterJson)
        {
            HtmlTemplateFilterVM model = null;

            if (!string.IsNullOrEmpty(filterJson))
            {
                var dateTimeConverter = new IsoDateTimeConverter()
                {
                    DateTimeFormat = FormattingConstant.NormalDateFormat
                };
                model = JsonConvert.DeserializeObject <HtmlTemplateFilterVM>(filterJson, dateTimeConverter);
            }
            SetViewbag();
            ViewBag.breadcrumbs = commonService.Breadcrumbs_HtmlTemplate().DeleteOrDisableLast();
            return(View(model));
        }
        void SetViewbagLink(int htmlTemplateTypeId)
        {
            var htmlTemplateFilterVM = new HtmlTemplateFilterVM();

            htmlTemplateFilterVM.HtmlTemplateTypeId = htmlTemplateTypeId;
            ViewBag.htmlTemplateTypeId = htmlTemplateTypeId;
            var dateTimeConverter = new IsoDateTimeConverter()
            {
                DateTimeFormat = FormattingConstant.NormalDateFormat
            };

            ViewBag.filterJson = JsonConvert.SerializeObject(htmlTemplateFilterVM, dateTimeConverter);

            ViewBag.CourtTypeId_ddl = nomService.GetDropDownList <CourtType>();
            ViewBag.CaseGroupId_ddl = nomService.GetDropDownList <CaseGroup>();
            ViewBag.SourceType_ddl  = SourceTypeSelectVM.GetDDL_SourceType();
        }
示例#4
0
 /// <summary>
 /// Извличане на списък
 /// </summary>
 /// <returns></returns>
 public IQueryable <HtmlTemplateVM> HtmlTemplate_Select(HtmlTemplateFilterVM filterData)
 {
     return(repo.AllReadonly <HtmlTemplate>()
            .Include(x => x.HtmlTemplateType)
            .Where(x => x.HtmlTemplateTypeId == filterData.HtmlTemplateTypeId || filterData.HtmlTemplateTypeId <= 0)
            .Select(x => new HtmlTemplateVM()
     {
         Id = x.Id,
         HtmlTemplateTypeLabel = (x.HtmlTemplateType != null) ? x.HtmlTemplateType.Label : string.Empty,
         Alias = x.Alias,
         Label = x.Label,
         Description = x.Description,
         Content = x.Content,
         FileName = x.FileName,
         ContentType = x.ContentType,
         IsCreate = x.IsCreate
     })
            .AsQueryable());
 }
        public IActionResult ListData(IDataTablesRequest request, HtmlTemplateFilterVM filterData)
        {
            var data = service.HtmlTemplate_Select(filterData);

            return(request.GetResponse(data));
        }