//public ActionResult Index()
        //{
        //    C_TempletApp templetApp = new C_TempletApp();
        //    C_TempletEntity model = templetApp.GetMain();
        //    string htmls = Server.HtmlDecode(model.F_Content);
        //    return Content(htmls);
        //}
        public ActionResult Index(string name)
        {
            C_TempletApp    templetApp   = new C_TempletApp();
            C_TempletEntity model        = new C_TempletEntity();
            C_ModulesApp    modulesApp   = new C_ModulesApp();
            C_ModulesEntity moduleentity = new C_ModulesEntity();

            if (string.IsNullOrEmpty(name))
            {
                model        = templetApp.GetMain();
                moduleentity = modulesApp.GetMain();
            }
            else
            {
                model        = templetApp.GetModelByActionName(name);
                moduleentity = modulesApp.GetFormByActionName(name);
            }
            string htmls = Server.HtmlDecode(model.F_Content);

            if (moduleentity != null)
            {
                TempHelp temphelp = new TempHelp();
                htmls = temphelp.GetHtmlPages(htmls, moduleentity.F_Id);
            }

            return(Content(htmls));
        }
Beispiel #2
0
        public C_TempletEntity GetFormByName(string Name)
        {
            C_TempletEntity model = new C_TempletEntity();

            model = service.FindEntity(m => m.F_FullName == Name && m.F_DeleteMark != true);
            return(model);
        }
Beispiel #3
0
        /// <summary>
        /// 根据名称获取模板
        /// </summary>
        /// <returns></returns>
        public C_TempletEntity GetModelByActionName(string actionName)
        {
            C_TempletEntity templet   = new C_TempletEntity();
            C_ModulesApp    moduleApp = new C_ModulesApp();
            C_ModulesEntity module    = moduleApp.GetModelByActionName(actionName);

            if (module != null)
            {
                templet = service.FindEntity(m => m.F_Id == module.F_TempletId);
            }
            return(templet);
        }
Beispiel #4
0
        /// <summary>
        /// 获取默认模板
        /// </summary>
        /// <returns></returns>
        public C_TempletEntity GetMain()
        {
            C_TempletEntity templet   = new C_TempletEntity();
            C_ModulesApp    moduleApp = new C_ModulesApp();
            C_ModulesEntity module    = moduleApp.GetMain();

            if (module != null)
            {
                templet = service.FindEntity(m => m.F_Id == module.F_TempletId);
            }
            return(templet);
        }
Beispiel #5
0
 public void SubmitForm(C_TempletEntity moduleEntity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         moduleEntity.Modify(keyValue);
         service.Update(moduleEntity);
     }
     else
     {
         moduleEntity.Create();
         service.Insert(moduleEntity);
     }
 }
Beispiel #6
0
        /// <summary>
        /// 根据模板名称获取模板信息
        /// </summary>
        /// <returns></returns>
        private string GetHtmlsByTempletName(string name, string Id)
        {
            string          strs       = "";
            C_TempletApp    templetapp = new C_TempletApp();
            C_TempletEntity templet    = templetapp.GetFormByName(name);

            if (templet != null)
            {
                string   templets = System.Web.HttpUtility.HtmlDecode(templet.F_Content);
                TempHelp temphelp = new TempHelp();
                strs = temphelp.GetHtmlPages(templets, Id);
            }
            return(strs);
        }
Beispiel #7
0
        public void GetStaticPage(string keyValue)
        {
            C_ModulesEntity module  = GetModuleByContentID(keyValue);
            C_ContentEntity content = GetForm(keyValue);

            if (module != null)
            {
                C_TempletApp    templetapp = new C_TempletApp();
                C_TempletEntity templet    = templetapp.GetForm(module.F_CTempletId);
                if (templet != null)
                {
                    string   templets = System.Web.HttpUtility.HtmlDecode(templet.F_Content);
                    TempHelp temphelp = new TempHelp();
                    temphelp.GenHtmlPage(templets, keyValue);
                }
            }
        }
Beispiel #8
0
 public ActionResult SubmitForm(C_TempletEntity moduleEntity, string keyValue)
 {
     //moduleEntity.F_Content = Server.HtmlEncode(moduleEntity.F_Content);
     templetApp.SubmitForm(moduleEntity, keyValue);
     return(Success("操作成功。"));
 }