public async Task <GetResult> Get([FromBody] GetRequest request) { var user = await _authManager.GetUserAsync(); var dynamicInfo = StlDynamic.GetDynamicInfo(_settingsManager, request.Value, request.Page, user, Request.Path + Request.QueryString); var ifInfo = TranslateUtils.JsonDeserialize <DynamicIfInfo>(dynamicInfo.Settings); var isSuccess = false; var html = string.Empty; if (ifInfo != null) { if (StringUtils.EqualsIgnoreCase(ifInfo.Type, StlIf.TypeIsUserLoggin)) { isSuccess = _authManager.IsUser; } var template = isSuccess ? dynamicInfo.YesTemplate : dynamicInfo.NoTemplate; html = await StlDynamic.ParseDynamicAsync(_parseManager, dynamicInfo, template); } return(new GetResult { Value = isSuccess, Html = html }); }
public async Task <SubmitResult> Submit([FromBody] SubmitRequest request) { var user = await _authManager.GetUserAsync(); var dynamicInfo = StlDynamic.GetDynamicInfo(_settingsManager, request.Value, request.Page, user, Request.Path + Request.QueryString); var template = dynamicInfo.YesTemplate; return(new SubmitResult { Value = true, Html = await StlDynamic.ParseDynamicAsync(_parseManager, dynamicInfo, template) }); }
public async Task <string> ParseDynamicAsync(Dynamic dynamic, string template) { return(await StlDynamic.ParseDynamicAsync(this, dynamic, template)); }