コード例 #1
0
        public JsonResult SaveDesign(int id, string fields, string logo, string title, string secTitle, int tenantId)
        {
            TalEvalReportTemplate template;

            if (id == 0)
            {
                template             = new TalEvalReportTemplate();
                template.CreateTime  = DateTime.Now;
                template.Creater     = CurrentAdmin.AdminId;
                template.IsDelete    = 0;
                template.PublishFlag = 0;
                template.TenantId    = tenantId;
            }
            else
            {
                template = _templateManager.GetById(id);
            }
            template.FrontDataItems.Clear();
            template.FrontDataItems.AddRange(fields.Split(','));
            template.LogoUrl     = logo;
            template.ReportTitle = title;
            template.SecondTitle = secTitle;
            if (id == 0)
            {
                _templateManager.Add(template);
            }
            else
            {
                _templateManager.Update(template);
            }

            return(Json(new { result = 1, reportId = template._id, content = RetechWing.LanguageResources.Exam.Exampaper.SaveSuccess }, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public ActionResult DesignReport(int tenantId = 0, int reportId = 0)
        {
            var template = new TalEvalReportTemplate();

            if (tenantId != 0)
            {
                var tenant = _tenantManager.GetTenantById(tenantId);
                ViewBag.tenant = tenant;
            }
            else
            {
                template = _templateManager.GetById(reportId);
                var tenant = _tenantManager.GetTenantById(template.TenantId);
                ViewBag.tenant = tenant;
            }
            return(View(template));
        }