示例#1
0
        public async Task <IActionResult> Index(incParams incp, filter f, pclsfilter pclsf)
        {
            try
            {
                var dp = new dictParams()
                {
                    gr = new grdictParams()
                    {
                        f = f, incp = incp
                    },
                    pcls = new pclsdictParams()
                    {
                        indents = db.indent, f = pclsf, pclsinfo = await db.getPClass(pclsf.pclassPcls)
                    },
                    vtype = viewtype.pclass
                };

                if (pclsf.ispofsPcls)
                {
                    dp.pcls.indents = (from c in db.indents where c.gr_id == pclsf.pofsPcls select c).ToArray();
                }
                ViewBag.dp = dp;
                return(View(dp.pcls.pclsinfo));
            }
            catch (Exception ex)
            {
                ApplicationLogging.CreateLogger <flexesController>().LogError(new EventId(0), ex, ex.Message);
                return(BadRequest("Зверніться до розробника"));
            }
        }
示例#2
0
        public async Task <IActionResult> GetView(short id)
        {
            try
            {
                var pcls = await db.getPClass(id);

                if (pcls == null)
                {
                    return(NotFound(null));
                }
                var html = await view.RenderViewToStringAsync <pclass_info>("Views/flexes/Index.cshtml", pcls);

                return(Ok(new pclsview()
                {
                    html = html
                }));
            }
            catch (Exception ex)
            {
                ApplicationLogging.CreateLogger <pclsController>().LogError(new EventId(0), ex, ex.Message);
                return(BadRequest("Зверніться до розробника"));
            }
        }