Esempio n. 1
0
 public GetFormResponseModel GetForm()
 {
     if (!base.EngineSharedModel.CurrentApplicationPageID.HasValue)
     {
         return(null);
     }
     using (ApplicationPageEngine applicationPageEngine = new ApplicationPageEngine(base.EngineSharedModel))
     {
         if (applicationPageEngine.CheckUserAccessByApplicationID(base.EngineSharedModel.CurrentApplicationPageID.Value, ElementBase.e_AccessType.AllowView))
         {
             var             result = this.GetContentHtmlByPage(base.EngineSharedModel.CurrentApplicationPageID.Value);
             EngineFormModel formVM = new EngineFormModel(result.FormModel, base.EngineSharedModel.CurrentApplicationPageID.Value);
             return(new GetFormResponseModel(formVM, result.ListMessageModel, result.RedirectUrlModel));
         }
         else
         {
             return(new GetFormResponseModel(null, new List <MessageModel>()
             {
                 new MessageModel(DisplayMessageType.error, "عدم دسترسی به فرم")
             }, null));
         }
     }
 }
Esempio n. 2
0
        public EngineFormModel PreviewForm(Guid formID, string userName)
        {
            sysBpmsDynamicForm dynamicForm = this.GetInfo(formID);

            EngineSharedModel engineSharedModel = dynamicForm.ApplicationPageID.HasValue ?
                                                  new EngineSharedModel(dynamicForm.ApplicationPageID.Value, new List <QueryModel>(), userName, string.Empty) :
                                                  new EngineSharedModel(Guid.Empty, dynamicForm.ProcessId, new List <QueryModel>(), userName, string.Empty);

            FormModel formModel = new FormModel();
            //convert form xml code to json object
            JObject obj = JObject.Parse(dynamicForm.DesignJson);
            HtmlElementHelperModel htmlElementHelperModel = HtmlElementHelper.MakeModel(engineSharedModel, base.UnitOfWork, HtmlElementHelperModel.e_FormAction.Preview, dynamicForm);

            //if json object has a control with type = CONTENT
            if (obj != null && obj["type"].ToString() == "CONTENT")
            {
                formModel = new FormModel(obj, htmlElementHelperModel, null, null, dynamicForm, false);
            }
            EngineFormModel engineForm = dynamicForm.ApplicationPageID.HasValue ?
                                         new EngineFormModel(formModel, dynamicForm.ApplicationPageID) :
                                         new EngineFormModel(formModel, Guid.Empty, Guid.Empty, dynamicForm.ProcessId);

            return(engineForm);
        }
 public GetTaskFormResponseModel(EngineFormModel engineFormModel, List <MessageModel> listMessageModel, RedirectUrlModel redirectUrlModel)
 {
     this.EngineFormModel  = engineFormModel;
     this.ListMessageModel = listMessageModel;
     this.RedirectUrlModel = redirectUrlModel;
 }