Пример #1
0
 /// <summary>
 /// 保存报表模板表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="rptTempEntity">报表实体</param>
 /// <param name="moduleEntity">模块实体</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, RptTempEntity rptTempEntity, ModuleEntity moduleEntity)
 {
     try
     {
         service.SaveForm(keyValue, rptTempEntity, moduleEntity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #2
0
        public ActionResult SaveForm(string keyValue, string tempJson)
        {
            dynamic       RptTempJson   = tempJson.ToJson();
            RptTempEntity rptTempEntity = new RptTempEntity();
            ModuleEntity  moduleEntity  = new ModuleEntity();

            rptTempEntity.EnCode       = RptTempJson.EnCode;
            rptTempEntity.Description  = RptTempJson.Description;
            rptTempEntity.TempType     = RptTempJson.TempType;
            rptTempEntity.FullName     = RptTempJson.FullName;
            rptTempEntity.TempCategory = RptTempJson.TempCategory;
            StringBuilder rptJson = new StringBuilder();

            rptJson.Append("{");
            rptJson.AppendFormat("    \"title\":\"{0}\",", RptTempJson.title);//标题
            rptJson.AppendFormat("    \"sqlString\":\"{0}\",", RptTempJson.sqlString);
            rptJson.AppendFormat("    \"ParentId\":\"{0}\",", RptTempJson.ParentId);
            rptJson.AppendFormat("    \"Icon\":\"{0}\",", RptTempJson.Icon);
            rptJson.AppendFormat("    \"Description\":\"{0}\",", RptTempJson.Description);
            rptJson.AppendFormat("    \"listSqlString\":\"{0}\"", RptTempJson.listSqlString);
            rptJson.Append(" }"); rptJson.Replace("\n", "");
            rptTempEntity.ParamJson = rptJson.ToString();
            string parentId = RptTempJson.ParentId;

            if (!string.IsNullOrEmpty(parentId))
            {
                moduleEntity.Create();
                moduleEntity.ParentId    = parentId;
                moduleEntity.Icon        = RptTempJson.Icon;
                moduleEntity.Description = RptTempJson.Description;
                moduleEntity.IsMenu      = 1;
                moduleEntity.FullName    = rptTempEntity.FullName;
                moduleEntity.EnCode      = rptTempEntity.EnCode;
                moduleEntity.EnabledMark = 1;
                moduleEntity.Target      = "iframe";
                moduleEntity.SortCode    = modulebll.GetSortCode();
            }
            rptTempBLL.SaveForm(keyValue, rptTempEntity, moduleEntity);
            return(Success("操作成功。"));
        }