コード例 #1
0
 public object GetPreviewForm(Guid FormId)
 {
     using (DynamicFormService dynamicFormService = new DynamicFormService())
     {
         try
         {
             EngineFormModel engineForm = dynamicFormService.PreviewForm(FormId, base.userName);
             engineForm.SetUrls(string.Empty, string.Empty, new HttpRequestWrapper(base.MyRequest), base.PortalSettings.DefaultPortalAlias, FormTokenUtility.GetFormToken(HttpContext.Current.Session.SessionID, engineForm?.FormModel?.ContentHtml?.DynamicFormID ?? Guid.Empty, engineForm?.FormModel?.IsEncrypted ?? false));
             return(new
             {
                 Model = engineForm,
                 Result = true,
             });
         }
         catch (Exception ex)
         {
             return(new
             {
                 MessageList = new List <PostMethodMessage>()
                 {
                     new PostMethodMessage(ex.ToString(), DisplayMessageType.error)
                 },
                 Result = false
             });
         }
     }
 }