Beispiel #1
0
 public static string SaveFormData(string instanceId, string formData)
 {
     if (!string.IsNullOrEmpty(formData))
     {
         var instanceMode = formData.ToModeBase <FormInstanceModel>();
         if (instanceMode == null)
         {
             return(string.Empty);
         }
         var instanceBll = new FormInstanceBLL();
         instanceMode = instanceBll.InsertOrUpdateFormInstance(instanceMode);
         return(instanceMode.FormData);
     }
     return(string.Empty);
 }
Beispiel #2
0
        public static ArrayList ShowInstance(string instanceId, string templateId)
        {
            var values = new ArrayList();

            if (!string.IsNullOrEmpty(instanceId))
            {
                var instanceBll  = new FormInstanceBLL();
                var instanceMode = instanceBll.GetFormInstance(instanceId.ToInt64());
                values.Add(instanceMode.FormTemplateModel.ToJason());
                values.Add(instanceMode.FormData);
            }
            else
            {
                var instanceBll  = new FormTemplateBLL();
                var instanceMode = instanceBll.GetFormTemplate(templateId.ToInt64());
                values.Add(instanceMode.ToJason());
            }
            return(values);
        }
Beispiel #3
0
 public void ProcessRequest(HttpContext context)
 {
     if ("post".Equals(context.Request.HttpMethod.ToLower()))
     {
         using (var reader = new StreamReader(context.Request.InputStream))
         {
             string instanceJson = HttpUtility.UrlDecode(reader.ReadToEnd());
             if (!string.IsNullOrEmpty(instanceJson))
             {
                 var instanceMode = instanceJson.ToModeBase <FormInstanceModel>();
                 if (instanceMode == null)
                 {
                     return;
                 }
                 var instanceBll = new FormInstanceBLL();
                 instanceMode = instanceBll.InsertOrUpdateFormInstance(instanceMode);
             }
         }
     }
 }