Пример #1
0
    public void SaveInfo()
    {
        if (DataTemplateID.IsNull())
        {
            objDataTemplate = new Sys_DataTemplate();

            objDataTemplate.DataTemplateTypeID = DataTemplateTypeID;

            objDataTemplate.TemplateContent = txtTemplateContent.Text;
            objDataTemplate.TemplateCode    = txtTemplateCode.Text;
            objDataTemplate.TemplateName    = txtTemplateName.Text;
            objDataTemplate.Remark          = txtRemark.Text;
            objDataTemplateRule.InsertDataTemplate(objDataTemplate);
            MessageDialog("添加成功", "../../ServiceLayer/DataTemplate/DataTemplateList.aspx?DataTemplateTypeID=" + DataTemplateTypeID.ToString());
        }
        else
        {
            objDataTemplate = objDataTemplateRule.Sys_DataTemplate.First(p => p.DataTemplateID == DataTemplateID);
            objDataTemplate.TemplateContent = txtTemplateContent.Text;
            objDataTemplate.TemplateCode    = txtTemplateCode.Text;
            objDataTemplate.TemplateName    = txtTemplateName.Text;
            objDataTemplate.Remark          = txtRemark.Text;
            objDataTemplateRule.SaveChanges();
            MessageDialog("保存成功", "../../ServiceLayer/DataTemplate/DataTemplateList.aspx?DataTemplateTypeID=" + DataTemplateTypeID.ToString());
        }
    }
Пример #2
0
 public override void RenderPage()
 {
     if (DataTemplateID.IsNoNull())
     {
         objDataTemplate = objDataTemplateRule.Sys_DataTemplate.First(p => p.DataTemplateID == DataTemplateID);
         Page.DataBind();
     }
 }
Пример #3
0
 public void InsertDataTemplate(Sys_DataTemplate objDataTemplate)
 {
     objDataTemplate.TemplateCode.CheckIsNull("请输入数据模板代码", LogModuleType.ParameterLog);
     objDataTemplate.TemplateName.CheckIsNull("请输入数据模板名称", LogModuleType.ParameterLog);
     objDataTemplate.TemplateContent.CheckIsNull("请输入数据模板内容", LogModuleType.ParameterLog);
     this.CurrentEntities.AddTosys_datatemplate(objDataTemplate);
     this.CurrentEntities.SaveChanges();
 }
Пример #4
0
        public string GetDataTemplate(string dataTemplateTypeCode, string templateCode)
        {
            Sys_DataTemplate sys_DataTemplate = this.CurrentEntities.sys_datatemplate.FirstOrDefault((Sys_DataTemplate s) => s.TemplateCode == templateCode && s.Sys_DataTemplateType.DataTemplateTypeCode == dataTemplateTypeCode);

            if (sys_DataTemplate.IsNull())
            {
                SysAssert.ArgumentAssert <LogModuleType>(string.Concat(new string[]
                {
                    "未设置数据模板",
                    dataTemplateTypeCode,
                    "-",
                    templateCode,
                    "值"
                }), LogModuleType.Framework);
            }
            return(sys_DataTemplate.TemplateContent);
        }