private void HandleDelete(IEnumerable <RoleMedia> RoleMediaDetails) { selectedItem = BaseMapper.GetObjectFromContext((MediaDetail)selectedItem); Role role = null; Return obj = BaseMapper.GenerateReturn(); foreach (RoleMedia RoleMediaDetail in RoleMediaDetails) { obj = RolesMediasMapper.DeletePermanently(RoleMediaDetail); role = RoleMediaDetail.Role; } if (!obj.IsError) { IEnumerable <UserMedia> userMediaDetails = selectedItem.Media.UsersMedias.Where(i => i.User.IsInRole(role)); foreach (UserMedia userMediaDetail in userMediaDetails) { UsersMediasMapper.DeletePermanently(userMediaDetail); } Bind(); } if (obj.IsError) { BasePage.DisplayErrorMessage("Error deleting association", obj.Error); } else { BasePage.DisplaySuccessMessage("Successfully deleted association"); Bind(); } }
private void HandleDelete(IEnumerable <UserMedia> selectedUserMediaDetails) { selectedItem = BaseMapper.GetObjectFromContext((MediaDetail)selectedItem); Return obj = BaseMapper.GenerateReturn(); foreach (UserMedia selectedUserMediaDetail in selectedUserMediaDetails) { UserMedia item = BaseMapper.GetObjectFromContext(selectedUserMediaDetail); selectedItem.Media.UsersMedias.Remove(selectedUserMediaDetail); obj = UsersMediasMapper.DeletePermanently(selectedUserMediaDetail); if (obj.IsError) { break; } } if (obj.IsError) { BasePage.DisplayErrorMessage("Error deleting association", obj.Error); } else { BasePage.DisplaySuccessMessage("Successfully deleted association"); Bind(); } }
public void SaveUseMainLayout(long mediaDetailId, string html) { if (FrameworkSettings.CurrentUser == null) { var returnObj = BaseMapper.GenerateReturn("You must be logged in"); WriteJSON(returnObj.ToJson()); return; } var mediaDetail = (MediaDetail)MediaDetailsMapper.GetByID(mediaDetailId); var history = (MediaDetail)MediaDetailsMapper.CreateHistory(mediaDetail, false); mediaDetail.History.Add(history); if (!FrameworkSettings.CurrentUser.HasPermission(PermissionsEnum.Save)) { var returnObj = BaseMapper.GenerateReturn("You do not have permissions to perform this operation"); WriteJSON(returnObj.ToJson()); return; } if (mediaDetail != null) { mediaDetail.UseMediaTypeLayouts = false; html = Uri.UnescapeDataString(html); //html = MediaDetailsMapper.ConvertUrlsToShortCodes(html); html = html.Replace(URIHelper.BaseUrl, "{BaseUrl}"); mediaDetail.MainLayout = html; var returnObj = MediaDetailsMapper.Update(mediaDetail); WriteJSON(returnObj.ToJson()); } else { WriteJSON(new Return() { Error = new Elmah.Error() { Message = $"MediaDetail with the ID '{mediaDetailId}' was not found" } }.ToJson()); } }
private void HandleDeletePermanently(Media item) { if (!FrameworkSettings.CurrentUser.HasPermission(PermissionsEnum.Delete)) { throw new Exception("You do not have the appropriate permissions to delete items permanently"); } if (item == null) { return; } MediaDetail detail = (MediaDetail)GetAtleastOneByMedia(item); Media parentMedia = null; if (item.ParentMediaID != null) { parentMedia = MediasMapper.GetByID((long)item.ParentMediaID); } Return returnObj = BaseMapper.GenerateReturn("No action performed"); if (detail == null) { if (item.ChildMedias.Count == 0) { returnObj = MediasMapper.DeletePermanently(item); } } else { item = BaseMapper.GetObjectFromContext(item); if ((item.MediaDetails.Count == 1) && (item.ChildMedias.Count > 0)) { throw new Exception("You cannot delete this item because it has child items"); } detail = BaseMapper.GetObjectFromContext(detail); returnObj = MediaDetailsMapper.DeletePermanently(detail); if (!returnObj.IsError) { ContextHelper.ClearAllMemoryCache(); detail.RemoveFromCache(); } } }
public void AddMessage(string key, string message) { if (!_deployMessages.Keys.Contains(key)) { var obj = new List <Return>(); obj.Add(BaseMapper.GenerateReturn(message)); _deployMessages.Add(key, obj); } else { if (!_deployMessages[key].Any(i => i.Error.Exception.Message == message)) { _deployMessages[key].Add(BaseMapper.GenerateReturn(message)); } } }
protected void Save_OnClick(object sender, EventArgs e) { if (selectedItem == null) { selectedItem = ScheduledTasksMapper.CreateObject(); } else { selectedItem = BaseMapper.GetObjectFromContext <ScheduledTask>(selectedItem); } UpdateObjectFromFields(); Return returnObj = BaseMapper.GenerateReturn(""); if (selectedItem.ID == 0) { returnObj = ScheduledTasksMapper.Insert(selectedItem); } else { returnObj = ScheduledTasksMapper.Update(selectedItem); } if (returnObj.IsError) { DisplayErrorMessage("Error Saving Item", returnObj.Error); } else { DisplaySuccessMessage("Successfully Saved Item"); /*var rootDetails = BaseMapper.GetObjectFromContext((MediaDetail)FrameworkBaseMedia.RootMediaDetail); * rootDetails.VirtualPath = URIHelper.GetBaseUrlWithScheduledTask(selectedItem);*/ /*returnObj = MediaDetailsMapper.Update(rootDetails); * * if (!returnObj.IsError) * MediaDetailsMapper.StartUpdateVirtualPathForAllChildren(rootDetails); * else * DisplaySuccessMessage("Error updating root media item");*/ } }
protected void Page_Init(object sender, EventArgs e) { DynamicContent.Controls.Add(this.ParseControl(MediaDetailsMapper.ParseWithTemplate(CurrentMediaDetail))); Return returnObj = BaseMapper.GenerateReturn(); if (Request["requestVirtualPath"] == null) { returnObj = BaseMapper.GenerateReturn("You must specify a valid 'requestVirtualPath' query string parameter", ""); DisplayErrorMessage("Error", returnObj.Error); return; } string requestVirtualPath = Request["requestVirtualPath"]; var ex = new Exception("Page Not found: ( " + requestVirtualPath + " )"); ErrorHelper.LogException(ex); }
public void FieldSettingsSubmissionHandler() { var returnObj = BaseMapper.GenerateReturn("No action performed"); if (HttpContext.Current.Request.Form["fieldId"] == null) { returnObj = BaseMapper.GenerateReturn("'fieldId' is missing"); WriteJSON(returnObj.ToJson()); } if (!long.TryParse(HttpContext.Current.Request.Form["fieldId"], out long fieldId)) { returnObj = BaseMapper.GenerateReturn("Invalid 'fieldId'"); WriteJSON(returnObj.ToJson()); } var field = FieldsMapper.GetByID(fieldId); if (field == null) { returnObj = BaseMapper.GenerateReturn($"Cannot find field with id '{fieldId}'"); WriteJSON(returnObj.ToJson()); } var FormDictionary = new Dictionary <string, string>(); foreach (string key in HttpContext.Current.Request.Form.Keys) { FormDictionary.Add(key, HttpContext.Current.Request.Form[key]); } FormDictionary.Add("DateLastModified", StringHelper.FormatDateTime(DateTime.Now)); var jsonEntry = new JavaScriptSerializer().Serialize(FormDictionary); field.FieldSettings = jsonEntry; returnObj = FieldsMapper.Update(field); WriteJSON(returnObj.ToJson()); }
protected void DeleteDbBackUp_Click(object sender, EventArgs e) { var deleteButton = sender as LinkButton; if (!string.IsNullOrEmpty(deleteButton.CommandArgument) && File.Exists(deleteButton.CommandArgument)) { var returnObj = BaseMapper.GenerateReturn(); try { File.Delete(deleteButton.CommandArgument); BindDbBackUpsList(); DisplaySuccessMessage($"Successfully deleted file: ( {deleteButton.CommandArgument} )"); } catch (Exception ex) { ErrorHelper.LogException(ex); returnObj.Error = ErrorHelper.CreateError(ex); DisplayErrorMessage(returnObj.Error.Message, returnObj.Error); } } }
protected void RestoreBackUp_Click(object sender, EventArgs e) { if (!canAccessSection) { DisplayAccessError(); return; } var restoreButton = sender as LinkButton; if (!string.IsNullOrEmpty(restoreButton.CommandArgument) && File.Exists(restoreButton.CommandArgument)) { var returnObj = BaseMapper.GenerateReturn(); try { BackupNow_OnClick(sender, e); returnObj = BackupHelper.RestoreDatabase(restoreButton.CommandArgument); if (returnObj.IsError) { DisplayErrorMessage("Error restoring", returnObj.Error); } else { DisplaySuccessMessage($"Successfully restored file: ( {restoreButton.CommandArgument} )"); } } catch (Exception ex) { ErrorHelper.LogException(ex); returnObj.Error = ErrorHelper.CreateError(ex); DisplayErrorMessage(returnObj.Error.Message, returnObj.Error); } } }
//private void ChangeLinksForAllMediaDetails(string oldAbsoluteUrl, string newAbsoluteUrl) //{ // if (string.IsNullOrEmpty(oldAbsoluteUrl) || oldAbsoluteUrl == newAbsoluteUrl) // return; // var oldTemplateVarUrl = ParserHelper.ParseData(oldAbsoluteUrl, this.TemplateVars, true); // var newTemplateVarUrl = ParserHelper.ParseData(newAbsoluteUrl, this.TemplateVars, true); // var foundItems = MediaDetailsMapper.GetDataModel().MediaDetails.Where(i => i.MainContent.Contains(oldTemplateVarUrl) || i.ShortDescription.Contains(oldTemplateVarUrl)); // if (foundItems.Any()) // { // foreach (var item in foundItems) // { // item.ShortDescription = item.ShortDescription.Replace(oldTemplateVarUrl, newTemplateVarUrl); // item.MainContent = item.MainContent.Replace(oldTemplateVarUrl, newTemplateVarUrl); // } // var numberOfItemsEffected = MediaDetailsMapper.GetDataModel().SaveChanges(); // } //} protected void Save_OnClick(object sender, EventArgs e) { if (CanAccessItem != null && CanAccessItem.IsError) { DisplayErrorMessage("Error saving item", CanAccessItem.Error); return; } if (!CurrentUser.HasPermission(PermissionsEnum.Publish)) { DisplayErrorMessage("Error saving item", ErrorHelper.CreateError(new Exception("You do not have the appropriate permissions to save items"))); return; } string commandArgument = ((LinkButton)sender).CommandArgument; bool isDraft = false; if (commandArgument == "CreateDraft") { isDraft = true; } IMediaDetail history = CreateHistory(isDraft); Return returnObj = BaseMapper.GenerateReturn(); if ((history != null) && (history.IsDraft)) { history.CopyFrom(selectedItem); UpdateObjectFromFields(history); history.IsDraft = isDraft; returnObj = SaveHistory(history); if (returnObj.IsError) { DisplayErrorMessage("Error Saving Item", returnObj.Error); } else { DisplaySuccessMessage("Successfully Saved Item as Draft"); UpdateFieldsFromObject(); } RedirectToAdminUrl(selectedItem, history.HistoryVersionNumber); return; } var tmpSelectedItem = BaseMapper.GetObjectFromContext((MediaDetail)selectedItem); if (tmpSelectedItem != null) { selectedItem = tmpSelectedItem; } if (parentMediaItem != null) { parentMediaItem = BaseMapper.GetObjectFromContext(parentMediaItem); } else { parentMediaItem = selectedItem?.Media?.ParentMedia; } if (selectedItem == null) { selectedItem = MediaDetailsMapper.CreateObject(mediaTypeId, selectedMediaItem, parentMediaItem); } var oldLinkTitle = selectedItem.LinkTitle; var oldVirtualPath = selectedItem.VirtualPath; var canRender = selectedItem.CanRender; var oldAbsoluteUrl = selectedItem.AbsoluteUrl; var oldPostPublishDate = selectedItem.PublishDate; UpdateObjectFromFields(selectedItem); var validate = selectedItem.Validate(); if (validate.IsError) { DisplayErrorMessage("Error saving item", validate.Error); return; } if ((oldPostPublishDate != selectedItem.PublishDate) && !CurrentUser.HasPermission(PermissionsEnum.Publish)) { DisplayErrorMessage("Error saving item", ErrorHelper.CreateError(new Exception("You do not have the appropriate permissions to publish items"))); return; } if (selectedItem.ID == 0) { selectedItem.CreatedByUserID = CurrentUser.ID; if ((parentMediaItem != null) && (selectedItem.Media.ID == 0)) { selectedItem.Media.OrderIndex = parentMediaItem.ChildMedias.Count(i => i.ID != 0); } returnObj = MediaDetailsMapper.Insert(selectedItem); if (!returnObj.IsError) { ContextHelper.Clear(ContextType.Cache); FileCacheHelper.ClearAllCache(); } else { DisplayErrorMessage("Error", returnObj.Error); } } else { if (!isDraft) { if (history != null) { returnObj = SaveHistory(history); } //selectedItem.Media.ReorderChildren(); if (!returnObj.IsError) { returnObj = MediaDetailsMapper.Update(selectedItem); } } } if (returnObj.IsError) { DisplayErrorMessage("Error Saving Item", returnObj.Error); } else { if (history != null) { selectedItem.History.Add((MediaDetail)history); Return historyReturnObj = MediaDetailsMapper.Update(selectedItem); } selectedItem.RemoveFromCache(); FileCacheHelper.DeleteGenerateNavCache(); if (oldVirtualPath != selectedItem.VirtualPath || canRender != selectedItem.CanRender || oldLinkTitle != selectedItem.LinkTitle) { ContextHelper.Clear(ContextType.Cache); //FileCacheHelper.ClearCacheDir("generatenav"); //FileCacheHelper.ClearAllCache(); selectedItem.ClearAutoCalculatedVirtualPathCache(); if (commandArgument == "SaveAndPublish") { PublishNow_OnClick(sender, e); //RedirectToMediaDetail(mediaTypeEnum, selectedItem.MediaID, selectedItem.Media.ParentMediaID); } else { RedirectToAdminUrl(selectedItem.MediaTypeID, selectedItem.MediaID, selectedItem.Media.ParentMediaID); } //ChangeLinksForAllMediaDetails(oldAbsoluteUrl, selectedItem.AbsoluteUrl); } DisplaySuccessMessage("Successfully Saved Item"); ExecuteRawJS("ReloadPreviewPanel()"); if (!selectedItem.IsHistory) { SelectedMediaDetail = selectedItem; SelectedMedia = MediasMapper.GetByID(selectedItem.MediaID); } if (((Request["selectedMediaId"] == null) || (Request["selectedMediaId"].ToString() == "0")) && (commandArgument != "SaveAndPublish")) { RedirectToAdminUrl(selectedItem.MediaTypeID, selectedItem.MediaID, selectedItem.Media.ParentMediaID); } else { if (commandArgument == "SaveAndPublish") { PublishNow_OnClick(sender, e); //RedirectToMediaDetail(mediaTypeEnum, selectedItem.MediaID, selectedItem.Media.ParentMediaID); } UpdateFieldsFromObject(); /*else * Response.Redirect(Request.Url.AbsoluteUri);*/ //UpdateFieldsFromObject(); //RedirectToMediaDetail(mediaTypeEnum, selectedItem.MediaID, selectedItem.Media.ParentMediaID); } } }
protected void Page_Init(object sender, EventArgs e) { long id; long parentId; long.TryParse(Request["historyVersion"], out historyVersion); long.TryParse(Request["mediaTypeId"], out mediaTypeId); if (long.TryParse(Request["selectedMediaId"], out id)) { selectedMediaItem = MediasMapper.GetByID(id); SelectedMedia = selectedMediaItem; if (selectedMediaItem != null) { selectedItem = MediaDetailsMapper.GetByMedia(selectedMediaItem, CurrentLanguage); if (historyVersion > 0) { selectedItem = BaseMapper.GetObjectFromContext((MediaDetail)selectedItem); historyVersionItem = BaseMapper.GetObjectFromContext((MediaDetail)MediaDetailsMapper.GetByMedia(selectedMediaItem, CurrentLanguage, historyVersion)); } if ((selectedItem != null) && (historyVersionItem != null)) { tmpSelectedItem = BaseMapper.GetObjectFromContext((MediaDetail)selectedItem); selectedItem = historyVersionItem; } } } if (long.TryParse(Request["parentMediaId"], out parentId)) { parentMediaItem = MediasMapper.GetByID(parentId); } if (selectedItem == null) { if (parentMediaItem != null) { SelectedMedia = parentMediaItem; } /*if (parentMediaItem == null) * return;*/ selectedItem = MediaDetailsMapper.CreateObject(mediaTypeId, selectedMediaItem, parentMediaItem); } Return canAccessReturnObj = BaseMapper.GenerateReturn(); if (selectedItem.ID != 0) { canAccessReturnObj = MediaDetailsMapper.CanAccessMediaDetail(selectedItem, CurrentUser); if (canAccessReturnObj.IsError) { DisplayErrorMessage("Cannot edit item", canAccessReturnObj.Error); CanAccessItem = canAccessReturnObj; return; } else { KeyValuePair <IMediaDetail, User> checkedOutItem = IsCheckedOut(selectedItem); if (checkedOutItem.Key == null) { CheckOut(selectedItem); } else { if (checkedOutItem.Value.ID != CurrentUser.ID) { Return returnObj = BaseMapper.GenerateReturn("Cannot edit item", "The item has been checked out by user: ( " + checkedOutItem.Value.UserName + " )"); CanAccessItem = returnObj; DisplayErrorMessage("Error", returnObj.Error); return; } } } } SelectedMediaDetail = selectedItem; SelectedMedia = selectedMediaItem; if (selectedMediaItem == null) { SelectedMedia = parentMediaItem; } if (selectedItem.ID == 0) { Save.Text = "Create"; SaveAndPublish.Text = "Create And Publish"; LoadLatestDraft.Visible = false; CreateDraft.Visible = false; var mediaType = MediaTypesMapper.GetByID(selectedItem.MediaTypeID); if (mediaType == null) { return; } selectedItem.MainLayout = mediaType.MainLayout; selectedItem.SummaryLayout = mediaType.SummaryLayout; selectedItem.FeaturedLayout = mediaType.FeaturedLayout; selectedItem.UseMediaTypeLayouts = mediaType.UseMediaTypeLayouts; var liveMediaDetail = selectedItem.Media?.GetLiveMediaDetail(); if (liveMediaDetail != null) { selectedItem.CopyFrom(liveMediaDetail); var fieldsNotInMediaType = liveMediaDetail.Fields.Where(i => i.MediaTypeFieldID == null); if (fieldsNotInMediaType != null) { foreach (var field in fieldsNotInMediaType) { var newField = new MediaDetailField(); newField.CopyFrom(field); if (field.FieldAssociations.Count > 0) { newField.FieldValue = ""; } else { newField.FieldValue = field.FieldValue; } newField.DateCreated = DateTime.Now; newField.DateLastModified = DateTime.Now; selectedItem.Fields.Add(newField); } } var fieldsThatCanBeCopied = liveMediaDetail.Fields.Where(i => !i.FieldAssociations.Any()); foreach (var field in fieldsThatCanBeCopied) { var foundField = selectedItem.Fields.FirstOrDefault(i => i.FieldCode == field.FieldCode); if (foundField != null) { foundField.CopyFrom(field); } } } } else { Save.Text = "Save Page"; SaveAndPublish.Text = "Save And Publish"; } if ((historyVersion > 0) && (historyVersionItem != null) && (!historyVersionItem.IsDraft)) { //SavePanel.Visible = false; } else { var draftItems = selectedItem.History.Where(i => i.IsDraft); if (draftItems.Count() > 0) { LoadLatestDraft.Visible = true; CreateDraft.Visible = false; } SaveAndPublish.Visible = true; SavePanel.Visible = true; HistoryPanel.Visible = false; } if (historyVersion > 0) { SavePanel.Visible = true; if (!selectedItem.IsDraft) { Save.Visible = false; } CreateDraft.Visible = false; PublishNow.Visible = false; PublishLive.Visible = true; HistoryPanel.Visible = true; HistoryVersionNumber.Text = historyVersion.ToString(); } if (CurrentUser.IsInRole(RoleEnum.Developer)) { EditMediaType.NavigateUrl = "~/Admin/Views/PageHandlers/MediaTypes/Detail.aspx?id=" + SelectedMediaDetail.MediaTypeID; EditMediaType.Visible = true; } Panel.SetObject(SelectedMediaDetail); if (Request.QueryString["masterFilePath"] != null) { PreviewPanel.Visible = false; RemovePreviewPanelScript.Visible = true; } else { PreviewPanel.Visible = true; RemovePreviewPanelScript.Visible = false; } UpdateSectionTitles(); }
protected void Signup_Click(object sender, EventArgs e) { var returnObj = BaseMapper.GenerateReturn(); var foundUser = UsersMapper.GetByEmailAddress(EmailAddress.Text); if (foundUser == null) { var user = new User(); user.FirstName = FirstName.Text; user.LastName = LastName.Text; user.UserName = user.EmailAddress = EmailAddress.Text; user.SetPassword(Password.Text); user.AfterLoginStartPage = ""; user.AuthenticationType = AuthType.Forms.ToString(); user.ResetCode = ""; if (!IsValid(user)) { returnObj = BaseMapper.GenerateReturn("Please make sure you fill out the required fields correctly"); } else { var role = RolesMapper.GetByEnum(RoleEnum.Member); if (role != null) { user.Roles.Add(role); var dashboard = MediaDetailsMapper.GetByMediaType(MediaTypeEnum.Dashboard).FirstOrDefault(); /*var level = dashboard.ChildMediaDetails.FirstOrDefault(i=>i.MediaType.Name == MediaTypeEnum.Level.ToString()); * * if (level != null) * { * user.UnlockMedia(level.Media); * }*/ returnObj = UsersMapper.Insert(user); if (!returnObj.IsError) { FormsAuthentication.SetAuthCookie(user.UserName, false); FrameworkSettings.CurrentUser = user; SendAutoResponderEmail(user); //SendNotificationEmails(user); if (BasePage.CurrentMediaDetail.ChildMediaDetails.Any()) { var firstPageUrl = BasePage.CurrentMediaDetail.ChildMediaDetails.ElementAt(0).AbsoluteUrl; Response.Redirect(firstPageUrl); } } } } } else { returnObj = BaseMapper.GenerateReturn("A user with the same email address already exists in the system."); } if (returnObj.IsError) { ErrorPanel.Visible = true; ServerMessage.Text = returnObj.Error.Exception.Message; } }
public Return FieldFrontEndFormSubmissionHandler(long fieldId) { var returnObj = BaseMapper.GenerateReturn("No action performed"); if (HttpContext.Current.Request.Form["fieldId"] == null) { returnObj = BaseMapper.GenerateReturn("'fieldId' is missing"); return(returnObj); } var field = (MediaDetailField)FieldsMapper.GetByID(fieldId); if (field == null) { returnObj = BaseMapper.GenerateReturn($"Cannot find field with id '{fieldId}'"); return(returnObj); } var FormDictionary = new Dictionary <string, string>(); foreach (string key in HttpContext.Current.Request.Form.Keys) { var value = HttpContext.Current.Request.Form[key]; if (value.Contains(",")) { value = "\"" + value + "\""; } FormDictionary.Add(key, value); } FormDictionary.Add("DateSubmitted", StringHelper.FormatDateTime(DateTime.Now)); var currentEntries = StringHelper.JsonToObject <Newtonsoft.Json.Linq.JArray>(field.FrontEndSubmissions); var files = new Dictionary <string, List <string> >(); var fileIndex = 0; foreach (string key in HttpContext.Current.Request.Files) { var postedFile = HttpContext.Current.Request.Files[fileIndex]; var uploadFolder = MediaDetailField.GetUploadFolder(field); if (!uploadFolder.Exists) { uploadFolder.Create(); } var fieldName = postedFile.FileName.ToLower().Replace(" ", "-"); var uploadFilePath = uploadFolder.FullName + key + "_" + fieldName; postedFile.SaveAs(uploadFilePath); var relativePath = URIHelper.ConvertAbsPathToAbsUrl(uploadFilePath); if (files.ContainsKey(key)) { files[key].Add(relativePath); } else { files.Add(key, new List <string>() { relativePath }); } fileIndex++; } var jObjectUploadFiles = JObject.Parse(StringHelper.ObjectToJson(files)); var jsonEntry = new JavaScriptSerializer().Serialize(FormDictionary); var jObject = JObject.Parse(jsonEntry); jObject.Merge(jObjectUploadFiles); if (currentEntries == null) { currentEntries = new JArray(); currentEntries.Add(jObject); } else { currentEntries.Add(jObject); } field.FrontEndSubmissions = currentEntries.ToString(Formatting.None); returnObj = FieldsMapper.Update(field); var formFieldSettings = StringHelper.JsonToObject <FormFieldSettings>(field.FieldSettings); if (formFieldSettings != null && !string.IsNullOrEmpty(formFieldSettings.EmailTemplateMediaID) && long.TryParse(formFieldSettings.EmailTemplateMediaID, out long i)) { var media = MediasMapper.GetByID(long.Parse(formFieldSettings.EmailTemplateMediaID)); if (media != null) { var layout = MediaDetailsMapper.ParseSpecialTags(media.GetLiveMediaDetail()); var parsedLayout = ParserHelper.ParseData(layout, jObject); EmailHelper.Send(AppSettings.SystemEmailAddress, EmailHelper.GetMailAddressesFromString(formFieldSettings.EmailAddress), formFieldSettings.Subject, parsedLayout, (AppSettings.AttemptSMTPMailer)? EmailHelper.EmailMode.Both : EmailHelper.EmailMode.Direct); } } return(returnObj); }
public Return Validate() { var returnOnj = BaseMapper.GenerateReturn(); return(returnOnj); }