예제 #1
0
 public PostFormResponseModel PostForm(string controlId)
 {
     using (ApplicationPageEngine applicationPageEngine = new ApplicationPageEngine(base.EngineSharedModel))
     {
         if (applicationPageEngine.CheckUserAccessByApplicationID(base.EngineSharedModel.CurrentApplicationPageID.Value, ElementBase.e_AccessType.AllowView))
         {
             var result = this.SaveContentHtmlByPage(base.EngineSharedModel.CurrentApplicationPageID.Value, controlId);
             if (!result.ResultOperation.IsSuccess)
             {
                 return(new PostFormResponseModel(result.ListMessageModel, result.ResultOperation.GetErrors(), false, false, result.RedirectUrlModel));
             }
             else
             {
                 if (result.IsSubmit)
                 {
                     return(new PostFormResponseModel(result.ListMessageModel, SharedLang.Get("Success.Text"), true, result.IsSubmit, result.RedirectUrlModel, result.ListDownloadModel));
                 }
                 else
                 {
                     return(new PostFormResponseModel(result.ListMessageModel, SharedLang.Get("Success.Text"), true, result.IsSubmit, result.RedirectUrlModel, result.ListDownloadModel));
                 }
             }
         }
         else
         {
             return(new PostFormResponseModel(new List <MessageModel>()
             {
             }, LangUtility.Get("PostFormNotAccess.Text", "Engine"), false, false, null));
         }
     }
 }
예제 #2
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));
         }
     }
 }