private void PrintResultBySave(SaveResult result, string pageName) { var infoType = InfoType.Info; if (!result.Equals(SaveResult.Ok) && !result.Equals(SaveResult.NoChanges)) { infoType = InfoType.Alert; } switch (result) { case SaveResult.SectionUpdate: Response.RedirectLC(ActionHelper.GetViewPagePath(this.ResolveUrlLC("Default.aspx"), pageName), this); break; case SaveResult.OkPageRename: case SaveResult.Ok: PrintInfoMessage(WikiResource.msgSaveSucess, infoType); if (Action.Equals(ActionOnPage.AddNew) || Action.Equals(ActionOnPage.Edit)) { Response.RedirectLC(ActionHelper.GetViewPagePath(this.ResolveUrlLC("Default.aspx"), pageName), this); } else if (Action.Equals(ActionOnPage.AddNewFile)) { Response.RedirectLC(ActionHelper.GetEditFilePath(this.ResolveUrlLC("Default.aspx"), pageName), this); } break; case SaveResult.FileEmpty: PrintInfoMessage(WikiResource.msgFileEmpty, infoType); break; case SaveResult.FileSizeExceeded: PrintInfoMessage(FileSizeComment.GetFileSizeExceptionString(FileUploader.MaxUploadSize), infoType); break; case SaveResult.NoChanges: PrintInfoMessage(WikiResource.msgNoChanges, infoType); break; case SaveResult.PageNameIsEmpty: PrintInfoMessage(WikiResource.msgPageNameEmpty, infoType); break; case SaveResult.PageNameIsIncorrect: PrintInfoMessage(WikiResource.msgPageNameIncorrect, infoType); break; case SaveResult.SamePageExists: PrintInfoMessage(WikiResource.msgSamePageExists, infoType); break; case SaveResult.UserIdIsEmpty: PrintInfoMessage(WikiResource.msgInternalError, infoType); break; case SaveResult.OldVersion: PrintInfoMessage(WikiResource.msgOldVersion, infoType); break; case SaveResult.Error: PrintInfoMessage(WikiResource.msgMarkupError, InfoType.Alert); break; case SaveResult.PageTextIsEmpty: PrintInfoMessage(WikiResource.msgPageTextEmpty, infoType); break; } }
private void PrintResultBySave(SaveResult result, string pageName) { var infoType = InfoType.Info; var authorId = SecurityContext.CurrentAccount.ID.ToString(); if (!result.Equals(SaveResult.Ok) && !result.Equals(SaveResult.NoChanges)) { infoType = InfoType.Alert; } switch (result) { case SaveResult.SectionUpdate: //WikiNotifyClient.SendNoticeAsync( // authorId, // Common.Constants.EditPage, // pageName, // null, // GetListOfTagValForNotify(pageName, "edit wiki page", null)); Response.RedirectLC(ActionHelper.GetViewPagePath(this.ResolveUrlLC("Default.aspx"), pageName), this); break; case SaveResult.OkPageRename: case SaveResult.Ok: PrintInfoMessage(WikiResource.msgSaveSucess, infoType); if (Action.Equals(ActionOnPage.AddNew)) { //WikiNotifyClient.SendNoticeAsync( // authorId, // Common.Constants.NewPage, // null, // null, // GetListOfTagValForNotify(pageName)); //WikiActivityPublisher.AddPage(Wiki.GetPage(pageName)); Response.RedirectLC(ActionHelper.GetEditPagePath(this.ResolveUrlLC("Default.aspx"), pageName), this); } else if (Action.Equals(ActionOnPage.AddNewFile)) { //WikiActivityPublisher.AddFile(Wiki.GetFile(pageName)); Response.RedirectLC(ActionHelper.GetEditFilePath(this.ResolveUrlLC("Default.aspx"), pageName), this); } //else if (!IsFile) //{ // bool isNewPage = !WikiActivityPublisher.EditPage(Wiki.GetPage(pageName)); // if (isNewPage) // { // WikiNotifyClient.SendNoticeAsync( // authorId, // Common.Constants.NewPage, // null, // null, // GetListOfTagValForNotify(pageName)); // } // else // { // WikiNotifyClient.SendNoticeAsync( // authorId, // Common.Constants.EditPage, // pageName, // null, // GetListOfTagValForNotify(pageName, "edit wiki page", null)); // } //} break; case SaveResult.FileEmpty: PrintInfoMessage(WikiResource.msgFileEmpty, infoType); break; case SaveResult.FileSizeExceeded: PrintInfoMessage(WikiResource.msgFileSizeExceeded, infoType); break; case SaveResult.NoChanges: PrintInfoMessage(WikiResource.msgNoChanges, infoType); break; case SaveResult.PageNameIsEmpty: PrintInfoMessage(WikiResource.msgPageNameEmpty, infoType); break; case SaveResult.PageNameIsIncorrect: PrintInfoMessage(WikiResource.msgPageNameIncorrect, infoType); break; case SaveResult.SamePageExists: PrintInfoMessage(WikiResource.msgSamePageExists, infoType); break; case SaveResult.UserIdIsEmpty: PrintInfoMessage(WikiResource.msgInternalError, infoType); break; case SaveResult.OldVersion: PrintInfoMessage(WikiResource.msgOldVersion, infoType); break; case SaveResult.Error: PrintInfoMessage(WikiResource.msgMarkupError, InfoType.Alert); break; } }
private void PrintResultBySave(SaveResult result, string pageName) { var infoType = InfoType.Info; if (!result.Equals(SaveResult.Ok) && !result.Equals(SaveResult.NoChanges)) { infoType = InfoType.Alert; } switch (result) { case SaveResult.SectionUpdate: Response.RedirectLC(ActionHelper.GetViewPagePath(this.ResolveUrlLC("Default.aspx"), pageName), this); break; case SaveResult.OkPageRename: case SaveResult.Ok: PrintInfoMessage(WikiResource.msgSaveSucess, infoType); if (Action.Equals(ActionOnPage.AddNew)) { Response.RedirectLC(ActionHelper.GetEditPagePath(this.ResolveUrlLC("Default.aspx"), pageName), this); } else if (Action.Equals(ActionOnPage.AddNewFile)) { Response.RedirectLC(ActionHelper.GetEditFilePath(this.ResolveUrlLC("Default.aspx"), pageName), this); } break; case SaveResult.FileEmpty: PrintInfoMessage(WikiResource.msgFileEmpty, infoType); break; case SaveResult.FileSizeExceeded: PrintInfoMessage(FileSizeComment.GetFileSizeExceptionString(FileUploader.MaxUploadSize), infoType); break; case SaveResult.NoChanges: PrintInfoMessage(WikiResource.msgNoChanges, infoType); break; case SaveResult.PageNameIsEmpty: PrintInfoMessage(WikiResource.msgPageNameEmpty, infoType); break; case SaveResult.PageNameIsIncorrect: PrintInfoMessage(WikiResource.msgPageNameIncorrect, infoType); break; case SaveResult.SamePageExists: PrintInfoMessage(WikiResource.msgSamePageExists, infoType); break; case SaveResult.UserIdIsEmpty: PrintInfoMessage(WikiResource.msgInternalError, infoType); break; case SaveResult.OldVersion: PrintInfoMessage(WikiResource.msgOldVersion, infoType); break; case SaveResult.Error: PrintInfoMessage(WikiResource.msgMarkupError, InfoType.Alert); break; } }