public void RegisterRoutes(RouteCollection routeCollection) { routeCollection.MapStandardRoute(LoggingSectionConstants.RouteName, new { Controller = LoggingSectionConstants.ControllerName, Action = LoggingSectionConstants.ActionName }); routeCollection.MapStandardRoute(LoggingSectionConstants.ActivityTypesController.List.RouteName, new { Controller = LoggingSectionConstants.ActivityTypesController.ControllerName, Action = LoggingSectionConstants.ActivityTypesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(LoggingSectionConstants.ActivityTypesController.New.RouteName, new { Controller = LoggingSectionConstants.ActivityTypesController.ControllerName, Action = LoggingSectionConstants.ActivityTypesController.New.ActionName }); routeCollection.MapStandardRoute(LoggingSectionConstants.ActivityTypesController.Edit.RouteName, new { Controller = LoggingSectionConstants.ActivityTypesController.ControllerName, Action = LoggingSectionConstants.ActivityTypesController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(LoggingSectionConstants.ActivitiesController.List.RouteName, new { Controller = LoggingSectionConstants.ActivitiesController.ControllerName, Action = LoggingSectionConstants.ActivitiesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(LoggingSectionConstants.LogsController.List.RouteName, new { Controller = LoggingSectionConstants.LogsController.ControllerName, Action = LoggingSectionConstants.LogsController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); }
public void RegisterRoutes(RouteCollection routeCollection) { routeCollection.MapStandardRoute(BillingSectionConstants.RouteName, new { Controller = BillingSectionConstants.ControllerName, Action = BillingSectionConstants.ActionName }); routeCollection.MapStandardRoute(BillingSectionConstants.TransactionDebugsController.List.RouteName, new { Controller = BillingSectionConstants.TransactionDebugsController.ControllerName, Action = BillingSectionConstants.TransactionDebugsController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); }
protected override void OnEndRequest(HttpContextBase context) { var request = context.Request; var response = context.Response; if (!response.StatusCode.Any((int)HttpStatusCode.InternalServerError, (int)HttpStatusCode.NotFound, (int)HttpStatusCode.Forbidden)) { return; } if (request.RawUrl.Contains("favicon.ico")) { return; } string routeName; if (response.StatusCode == (int)HttpStatusCode.InternalServerError) { return; } switch (response.StatusCode) { case (int)HttpStatusCode.InternalServerError: routeName = RootSectionConstants.ErrorsController.GenericError.RouteName; break; case (int)HttpStatusCode.NotFound: routeName = RootSectionConstants.ErrorsController.NotFound.RouteName; break; default: routeName = RootSectionConstants.ErrorsController.AccessDenied.RouteName; break; } var url = RouteUrlProvider.GetUrl(routeName); if (request.RawUrl.StartsWith(url)) { return; } response.Clear(); response.TrySkipIisCustomErrors = true; url = RouteUrlProvider.GetUrl(routeName, RouteParameter.Add("url", request.RawUrl)); response.Redirect(url); }
public void RegisterRoutes(RouteCollection routeCollection) { routeCollection.MapStandardRoute(TracksSectionConstants.RouteName, new { Controller = TracksSectionConstants.ControllerName, Action = TracksSectionConstants.ActionName }); routeCollection.MapStandardRoute(TracksSectionConstants.FundamentalsController.List.RouteName, new { Controller = TracksSectionConstants.FundamentalsController.ControllerName, Action = TracksSectionConstants.FundamentalsController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(TracksSectionConstants.FundamentalsController.New.RouteName, new { Controller = TracksSectionConstants.FundamentalsController.ControllerName, Action = TracksSectionConstants.FundamentalsController.New.ActionName }); routeCollection.MapStandardRoute(TracksSectionConstants.FundamentalsController.Edit.RouteName, new { Controller = TracksSectionConstants.FundamentalsController.ControllerName, Action = TracksSectionConstants.FundamentalsController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(TracksSectionConstants.TrackCommentsController.List.RouteName, new { Controller = TracksSectionConstants.TrackCommentsController.ControllerName, Action = TracksSectionConstants.TrackCommentsController.List.ActionName }, RouteParameter.Add(KnownParameterNames.TrackId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(TracksSectionConstants.TrackCommentsController.Edit.RouteName, new { Controller = TracksSectionConstants.TrackCommentsController.ControllerName, Action = TracksSectionConstants.TrackCommentsController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(TracksSectionConstants.TrackCommentLikesController.List.RouteName, new { Controller = TracksSectionConstants.TrackCommentLikesController.ControllerName, Action = TracksSectionConstants.TrackCommentLikesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.TrackCommentId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(TracksSectionConstants.TrackLikesController.List.RouteName, new { Controller = TracksSectionConstants.TrackLikesController.ControllerName, Action = TracksSectionConstants.TrackLikesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.TrackId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(TracksSectionConstants.TrackSharesController.List.RouteName, new { Controller = TracksSectionConstants.TrackSharesController.ControllerName, Action = TracksSectionConstants.TrackSharesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.TrackId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); }
public virtual ActionResult OpenId(OpenIdLoginModel model) { if (!ModelState.IsValid) { return(View(model)); } Identifier id; if (Identifier.TryParse(model.OpenIdIdentifier, out id)) { try { var openId = new OpenIdRelyingParty(); var returnUrl = new Uri(Url.Action("OpenIdCallback", "Authentication", RouteParameter.Add(ThenAttribute.ParameterName, ViewBag.Then[ThenAttribute.ParameterName]), Request.Url.Scheme), UriKind.Absolute); var request = openId.CreateRequest(id, Realm.AutoDetect, returnUrl); request.AddExtension(new ClaimsRequest { Email = DemandLevel.Require, FullName = DemandLevel.Require, Nickname = DemandLevel.Require }); var fetchRequest = new FetchRequest(); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Name.FullName); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Name.First); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Name.Last); fetchRequest.Attributes.AddRequired(WellKnownAttributes.Contact.Email); request.AddExtension(fetchRequest); return(request.RedirectingResponse.AsActionResult()); } catch (ProtocolException) { ErrorNotification(Resources.Messages_OpenIdConnectionFailure, false); return(View("Login", model)); } } ErrorNotification(Resources.Messages_InvalidOpenIdIdentifier, false); return(View("Login", model)); }
public override ActionResult Edit(TEditableModel editableModel, bool continueEditing) { if (!IsUserizedRequest) { return(AccessDeniedView()); } if (!ModelState.IsValid) { InjectModelDependencies(editableModel); return(View(editableModel)); } var entity = GetEntityById(editableModel.Id)(); if (entity == null) { return(HandleUnknown(editableModel.Id)); } entity = editableModel.ToEntity(entity); var operationResult = UpdateEntityAndReturnOperationResult(entity)(); if (!operationResult.Success) { ModelState.InjectMessages(operationResult); ResourceErrorNotification(CommonConstants.Systematic.NotUpdated); InjectModelDependencies(editableModel); return(View(editableModel)); } ResourceSuccessNotification(CommonConstants.Systematic.Updated); if (continueEditing) { return(RedirectToAction(KnownActionNames.Edit, RouteParameter.Add(KnownParameterNames.Id, entity.Id))); } return(RedirectToAction(KnownActionNames.List, RouteParameter.Add(KnownParameterNames.Page, 1))); }
public override ActionResult List(int page = 1) { if (!IsUserizedRequest) { return(AccessDeniedView()); } var entities = GetAllEntities(); var entityModels = new PagedList <TModel>(entities.Select(e => e.ToModel <TEntity, TModel>()).ToList(), page, _adminAreaSettings.GridPageSize); if (entityModels.TotalItemCount > 0 && entityModels.StartRecordIndex > entityModels.EndRecordIndex) { ResourceErrorNotification(CrudSharedConstants.Systematic.InvalidParameter); return(RedirectToAction(KnownActionNames.List, RouteParameter.Add(KnownParameterNames.Page, 1))); } return(View(entityModels)); }
public static void ExecuteAction(this HttpContextBase httpContext, string controllerName, string actionName, object additionalValues) { if (httpContext == null) { throw new ArgumentNullException("httpContext"); } if (controllerName == null) { throw new ArgumentNullException("controllerName"); } if (actionName == null) { throw new ArgumentNullException("actionName"); } var routeValues = RouteParameter.Add("Controller", controllerName) .Append("Action", actionName); var additionalRouteValues = RouteValueDictionaryConvertor.Convert(additionalValues); if (additionalRouteValues.Keys.Any()) { foreach (var additionalRouteValue in additionalRouteValues) { routeValues.Add(additionalRouteValue.Key, additionalRouteValue.Value); } } var routeData = new RouteData(); routeData.Values.MergeWith(routeValues); var requestContext = new RequestContext(httpContext, routeData); var controller = ControllerBuilder.Current.GetControllerFactory() .CreateController(requestContext, controllerName); controller.Execute(requestContext); }
public void RegisterRoutes(RouteCollection routeCollection) { routeCollection.MapStandardRoute(ConfigurationSectionConstants.RouteName, new { Controller = ConfigurationSectionConstants.ControllerName, Action = ConfigurationSectionConstants.ActionName }); routeCollection.MapStandardRoute(ConfigurationSectionConstants.ConfigurationController.List.RouteName, new { Controller = ConfigurationSectionConstants.ConfigurationController.ControllerName, Action = ConfigurationSectionConstants.ConfigurationController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(ConfigurationSectionConstants.ConfigurationController.New.RouteName, new { Controller = ConfigurationSectionConstants.ConfigurationController.ControllerName, Action = ConfigurationSectionConstants.ConfigurationController.New.ActionName }); routeCollection.MapStandardRoute(ConfigurationSectionConstants.ConfigurationController.Edit.RouteName, new { Controller = ConfigurationSectionConstants.ConfigurationController.ControllerName, Action = ConfigurationSectionConstants.ConfigurationController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); }
public void RegisterRoutes(RouteCollection routeCollection) { routeCollection.MapStandardRoute(PagesSectionConstants.RouteName, new { Controller = PagesSectionConstants.ControllerName, Action = PagesSectionConstants.ActionName }); routeCollection.MapStandardRoute(PagesSectionConstants.GroupsController.List.RouteName, new { Controller = PagesSectionConstants.GroupsController.ControllerName, Action = PagesSectionConstants.GroupsController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(PagesSectionConstants.GroupsController.New.RouteName, new { Controller = PagesSectionConstants.GroupsController.ControllerName, Action = PagesSectionConstants.GroupsController.New.ActionName }); routeCollection.MapStandardRoute(PagesSectionConstants.GroupsController.Edit.RouteName, new { Controller = PagesSectionConstants.GroupsController.ControllerName, Action = PagesSectionConstants.GroupsController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(PagesSectionConstants.ContentManagementController.List.RouteName, new { Controller = PagesSectionConstants.ContentManagementController.ControllerName, Action = PagesSectionConstants.ContentManagementController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(PagesSectionConstants.ContentManagementController.New.RouteName, new { Controller = PagesSectionConstants.ContentManagementController.ControllerName, Action = PagesSectionConstants.ContentManagementController.New.ActionName }); routeCollection.MapStandardRoute(PagesSectionConstants.ContentManagementController.Edit.RouteName, new { Controller = PagesSectionConstants.ContentManagementController.ControllerName, Action = PagesSectionConstants.ContentManagementController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); }
public void RegisterRoutes(RouteCollection routeCollection) { routeCollection.MapStandardRoute(TicketingSectionConstants.RouteName, new { Controller = TicketingSectionConstants.ControllerName, Action = TicketingSectionConstants.ActionName }); routeCollection.MapStandardRoute(TicketingSectionConstants.TicketsController.List.RouteName, new { Controller = TicketingSectionConstants.TicketsController.ControllerName, Action = TicketingSectionConstants.TicketsController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(TicketingSectionConstants.TicketsController.New.RouteName, new { Controller = TicketingSectionConstants.TicketsController.ControllerName, Action = TicketingSectionConstants.TicketsController.New.ActionName }); routeCollection.MapStandardRoute(TicketingSectionConstants.TicketsController.Edit.RouteName, new { Controller = TicketingSectionConstants.TicketsController.ControllerName, Action = TicketingSectionConstants.TicketsController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(TicketingSectionConstants.TicketResponsesController.List.RouteName, new { Controller = TicketingSectionConstants.TicketResponsesController.ControllerName, Action = TicketingSectionConstants.TicketResponsesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32).Append(KnownParameterNames.TicketId, KnownConstraints.Int32)); routeCollection.MapStandardRoute(TicketingSectionConstants.TicketResponsesController.New.RouteName, new { Controller = TicketingSectionConstants.TicketResponsesController.ControllerName, Action = TicketingSectionConstants.TicketResponsesController.New.ActionName }, RouteParameter.Add(KnownParameterNames.TicketId, KnownConstraints.Int32)); routeCollection.MapStandardRoute(TicketingSectionConstants.TicketResponsesController.Edit.RouteName, new { Controller = TicketingSectionConstants.TicketResponsesController.ControllerName, Action = TicketingSectionConstants.TicketResponsesController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); }
public void RegisterRoutes(RouteCollection routeCollection) { routeCollection.MapStandardRoute(LocalizationSectionConstants.RouteName, new { Controller = LocalizationSectionConstants.ControllerName, Action = LocalizationSectionConstants.ActionName }); routeCollection.MapStandardRoute(LocalizationSectionConstants.LanguagesController.List.RouteName, new { Controller = LocalizationSectionConstants.LanguagesController.ControllerName, Action = LocalizationSectionConstants.LanguagesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(LocalizationSectionConstants.LanguagesController.New.RouteName, new { Controller = LocalizationSectionConstants.LanguagesController.ControllerName, Action = LocalizationSectionConstants.LanguagesController.New.ActionName }); routeCollection.MapStandardRoute(LocalizationSectionConstants.LanguagesController.Edit.RouteName, new { Controller = LocalizationSectionConstants.LanguagesController.ControllerName, Action = LocalizationSectionConstants.LanguagesController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(LocalizationSectionConstants.StringResourcesController.List.RouteName, new { Controller = LocalizationSectionConstants.StringResourcesController.ControllerName, Action = LocalizationSectionConstants.StringResourcesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(LocalizationSectionConstants.StringResourcesController.New.RouteName, new { Controller = LocalizationSectionConstants.StringResourcesController.ControllerName, Action = LocalizationSectionConstants.StringResourcesController.New.ActionName }); routeCollection.MapStandardRoute(LocalizationSectionConstants.StringResourcesController.Edit.RouteName, new { Controller = LocalizationSectionConstants.StringResourcesController.ControllerName, Action = LocalizationSectionConstants.StringResourcesController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); }
public void RegisterRoutes(RouteCollection routeCollection) { routeCollection.MapStandardRoute(SecuritySectionConstants.RouteName, new { Controller = SecuritySectionConstants.ControllerName, Action = SecuritySectionConstants.ActionName }); routeCollection.MapStandardRoute(SecuritySectionConstants.BannedIpsController.List.RouteName, new { Controller = SecuritySectionConstants.BannedIpsController.ControllerName, Action = SecuritySectionConstants.BannedIpsController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(SecuritySectionConstants.BannedIpsController.New.RouteName, new { Controller = SecuritySectionConstants.BannedIpsController.ControllerName, Action = SecuritySectionConstants.BannedIpsController.New.ActionName }); routeCollection.MapStandardRoute(SecuritySectionConstants.BannedIpsController.Edit.RouteName, new { Controller = SecuritySectionConstants.BannedIpsController.ControllerName, Action = SecuritySectionConstants.BannedIpsController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(SecuritySectionConstants.PermissionRecordsController.List.RouteName, new { Controller = SecuritySectionConstants.PermissionRecordsController.ControllerName, Action = SecuritySectionConstants.PermissionRecordsController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(SecuritySectionConstants.PermissionRecordsController.New.RouteName, new { Controller = SecuritySectionConstants.PermissionRecordsController.ControllerName, Action = SecuritySectionConstants.PermissionRecordsController.New.ActionName }); routeCollection.MapStandardRoute(SecuritySectionConstants.PermissionRecordsController.Edit.RouteName, new { Controller = SecuritySectionConstants.PermissionRecordsController.ControllerName, Action = SecuritySectionConstants.PermissionRecordsController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); }
public void RegisterRoutes(RouteCollection routeCollection) { routeCollection.MapStandardRoute(MediaSectionConstants.RouteName, new { Controller = MediaSectionConstants.ControllerName, Action = MediaSectionConstants.ActionName }); routeCollection.MapStandardRoute(MediaSectionConstants.DownloadsController.List.RouteName, new { Controller = MediaSectionConstants.DownloadsController.ControllerName, Action = MediaSectionConstants.DownloadsController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(MediaSectionConstants.DownloadsController.New.RouteName, new { Controller = MediaSectionConstants.DownloadsController.ControllerName, Action = MediaSectionConstants.DownloadsController.New.ActionName }); routeCollection.MapStandardRoute(MediaSectionConstants.DownloadsController.Edit.RouteName, new { Controller = MediaSectionConstants.DownloadsController.ControllerName, Action = MediaSectionConstants.DownloadsController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(MediaSectionConstants.DownloadAttributesController.List.RouteName, new { Controller = MediaSectionConstants.DownloadAttributesController.ControllerName, Action = MediaSectionConstants.DownloadAttributesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.DownloadId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(MediaSectionConstants.DownloadAttributesController.New.RouteName, new { Controller = MediaSectionConstants.DownloadAttributesController.ControllerName, Action = MediaSectionConstants.DownloadAttributesController.New.ActionName }, RouteParameter.Add(KnownParameterNames.DownloadId, KnownConstraints.Int32)); routeCollection.MapStandardRoute(MediaSectionConstants.DownloadAttributesController.Edit.RouteName, new { Controller = MediaSectionConstants.DownloadAttributesController.ControllerName, Action = MediaSectionConstants.DownloadAttributesController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(MediaSectionConstants.PicturesController.List.RouteName, new { Controller = MediaSectionConstants.PicturesController.ControllerName, Action = MediaSectionConstants.PicturesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(MediaSectionConstants.PicturesController.New.RouteName, new { Controller = MediaSectionConstants.PicturesController.ControllerName, Action = MediaSectionConstants.PicturesController.New.ActionName }); routeCollection.MapStandardRoute(MediaSectionConstants.PicturesController.Edit.RouteName, new { Controller = MediaSectionConstants.PicturesController.ControllerName, Action = MediaSectionConstants.PicturesController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(MediaSectionConstants.PictureAttributesController.List.RouteName, new { Controller = MediaSectionConstants.PictureAttributesController.ControllerName, Action = MediaSectionConstants.PictureAttributesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.PictureId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(MediaSectionConstants.PictureAttributesController.New.RouteName, new { Controller = MediaSectionConstants.PictureAttributesController.ControllerName, Action = MediaSectionConstants.PictureAttributesController.New.ActionName }, RouteParameter.Add(KnownParameterNames.PictureId, KnownConstraints.Int32)); routeCollection.MapStandardRoute(MediaSectionConstants.PictureAttributesController.Edit.RouteName, new { Controller = MediaSectionConstants.PictureAttributesController.ControllerName, Action = MediaSectionConstants.PictureAttributesController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); }
public ArtistModelGrid(HtmlHelper htmlHelper, bool isSelected = true, bool edit = true, bool id = true, bool isPublished = true, bool isDeleted = true, bool displayOrder = true, bool createdOn = true, bool lastModifiedOn = true, bool ipAddress = true, bool creator = true, bool allowComments = true, bool comments = true, bool likes = true, bool shares = true, bool birthDateOn = true, bool fullName = true, bool alternativeName = true, bool homeTown = true, bool biography = true, bool metadata = true, bool facebookTargetUrl = true, bool avatar = true, bool photoAlbums = true, bool singedTracks = true, bool composedTracks = true, bool arrangedTracks = true, bool songwrittenTracks = true) : base(htmlHelper, isSelected, edit, FundamentalsSecctionConstants.FundamentalsController.Edit.RouteName, id, isPublished, isDeleted, displayOrder, createdOn, lastModifiedOn, ipAddress, creator, allowComments, commentsCount, likesCount, shares) { if (birthDateOn) { Column.For(am => GenericHtmlHelper.EditorFor(trap => am.BirthDate)).Named(htmlHelper.T(ArtistConstants.Fields.BirthDateUtc.Label)); } if (fullName) { Column.For(am => am.FullName).Named(htmlHelper.T(ArtistConstants.Fields.FullName.Label)); } if (alternativeName) { Column.For(am => am.AlternativeName).Named(htmlHelper.T(ArtistConstants.Fields.AlternativeName.Label)); } if (homeTown) { Column.For(am => am.HomeTown).Named(htmlHelper.T(ArtistConstants.Fields.HomeTown.Label)); } if (biography) { Column.For(am => am.Biography).Named(htmlHelper.T(ArtistConstants.Fields.Biography.Label)); } if (metadata) { Column.For(am => GenericHtmlHelper.EditorFor(trap => am.Metadata)).Named(htmlHelper.T(CommonConstants.Fields.Metadata.Label)); } if (photoAlbums) { Column.For(am => htmlHelper.LocalizedRouteLink(am.PhotoAlbumsCount.ToString(), FundamentalsSecctionConstants.PhotoAlbumsController.ListByArtistId.RouteName, RouteParameter.Add(KnownParameterNames.ArtistId, am.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(ArtistConstants.Fields.Albums.Label)); } if (singedTracks) { Column.For(am => htmlHelper.LocalizedRouteLink(am.SingedTracksCount.ToString(), FundamentalsSecctionConstants.FundamentalsController.ListByArtistId.RouteName, RouteParameter.Add(KnownParameterNames.ArtistId, am.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(ArtistConstants.Fields.SingedTracks.Label)); } if (composedTracks) { Column.For(am => htmlHelper.LocalizedRouteLink(am.ComposedTracksCount.ToString(), FundamentalsSecctionConstants.FundamentalsController.ListByArtistId.RouteName, RouteParameter.Add(KnownParameterNames.ArtistId, am.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(ArtistConstants.Fields.ComposedTracks.Label)); } if (arrangedTracks) { Column.For(am => htmlHelper.LocalizedRouteLink(am.ArrangedTracksCount.ToString(), FundamentalsSecctionConstants.FundamentalsController.ListByArtistId.RouteName, RouteParameter.Add(KnownParameterNames.ArtistId, am.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(ArtistConstants.Fields.ArrangedTracks.Label)); } if (songwrittenTracks) { Column.For(am => htmlHelper.LocalizedRouteLink(am.SongwrittenTracksCount.ToString(), FundamentalsSecctionConstants.FundamentalsController.ListByArtistId.RouteName, RouteParameter.Add(KnownParameterNames.ArtistId, am.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(ArtistConstants.Fields.SongwrittenTracks.Label)); } }
public CommentModelGrid(HtmlHelper htmlHelper, bool isSelected = true, bool edit = true, bool id = true, bool isPublished = true, bool isDeleted = true, bool displayOrder = true, bool createdOn = true, bool lastModifiedOn = true, bool ipAddress = true, bool creator = true, bool ownerId = true, bool title = true, bool body = true, bool repliedTo = true, bool replies = true) : base(htmlHelper, isSelected, edit, CommonSectionConstants.CommentsController.Edit.RouteName, id, isPublished, isDeleted, displayOrder, createdOn, lastModifiedOn, ipAddress, creator) { if (ownerId) { Column.For(cm => cm.OwnerId).Named(htmlHelper.T(CommentConstants.Fields.OwnerId.Label)); } if (title) { Column.For(cm => cm.Title).Named(htmlHelper.T(CommentConstants.Fields.Title.Label)); } if (body) { Column.For(cm => cm.Body).Named(htmlHelper.T(CommentConstants.Fields.Body.Label)); } if (repliedTo) { Column.For(cm => htmlHelper.RouteLinkWithId(cm.InReplyToTitle, CommonSectionConstants.CommentsController.Edit.RouteName, cm.InReplyToId, null, new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(CommentConstants.Fields.InReplyTo.Label)); } if (replies) { Column.For(cm => htmlHelper.SmartRouteLink(cm.RepliesCount.ToString(), CommonSectionConstants.CommentsController.ListByParentId.RouteName, RouteParameter.Add(KnownParameterNames.ParentId, cm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(CommentConstants.Fields.Replies.Label)); } }
public void RegisterRoutes(RouteCollection routeCollection) { routeCollection.MapStandardRoute(BloggingSectionConstants.RouteName, new { Controller = BloggingSectionConstants.ControllerName, Action = BloggingSectionConstants.ActionName }); routeCollection.MapStandardRoute(BloggingSectionConstants.BlogsController.List.RouteName, new { Controller = BloggingSectionConstants.BlogsController.ControllerName, Action = BloggingSectionConstants.BlogsController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(BloggingSectionConstants.BlogsController.New.RouteName, new { Controller = BloggingSectionConstants.BlogsController.ControllerName, Action = BloggingSectionConstants.BlogsController.New.ActionName }); routeCollection.MapStandardRoute(BloggingSectionConstants.BlogsController.Edit.RouteName, new { Controller = BloggingSectionConstants.BlogsController.ControllerName, Action = BloggingSectionConstants.BlogsController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(BloggingSectionConstants.TagsController.List.RouteName, new { Controller = BloggingSectionConstants.TagsController.ControllerName, Action = BloggingSectionConstants.TagsController.List.ActionName }, RouteParameter.Add(KnownParameterNames.BlogId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(BloggingSectionConstants.TagsController.New.RouteName, new { Controller = BloggingSectionConstants.TagsController.ControllerName, Action = BloggingSectionConstants.TagsController.New.ActionName }, RouteParameter.Add(KnownParameterNames.BlogId, KnownConstraints.Int32)); routeCollection.MapStandardRoute(BloggingSectionConstants.TagsController.Edit.RouteName, new { Controller = BloggingSectionConstants.TagsController.ControllerName, Action = BloggingSectionConstants.TagsController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(BloggingSectionConstants.PostsController.List.RouteName, new { Controller = BloggingSectionConstants.PostsController.ControllerName, Action = BloggingSectionConstants.PostsController.List.ActionName }, RouteParameter.Add(KnownParameterNames.BlogId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(BloggingSectionConstants.PostsController.New.RouteName, new { Controller = BloggingSectionConstants.PostsController.ControllerName, Action = BloggingSectionConstants.PostsController.New.ActionName }, RouteParameter.Add(KnownParameterNames.BlogId, KnownConstraints.Int32)); routeCollection.MapStandardRoute(BloggingSectionConstants.PostsController.Edit.RouteName, new { Controller = BloggingSectionConstants.PostsController.ControllerName, Action = BloggingSectionConstants.PostsController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(BloggingSectionConstants.PostCommentsController.List.RouteName, new { Controller = BloggingSectionConstants.PostCommentsController.ControllerName, Action = BloggingSectionConstants.PostCommentsController.List.ActionName }, RouteParameter.Add(KnownParameterNames.PostId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(BloggingSectionConstants.PostCommentsController.Edit.RouteName, new { Controller = BloggingSectionConstants.PostCommentsController.ControllerName, Action = BloggingSectionConstants.PostCommentsController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(BloggingSectionConstants.PostCommentLikesController.List.RouteName, new { Controller = BloggingSectionConstants.PostCommentLikesController.ControllerName, Action = BloggingSectionConstants.PostCommentLikesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.PostCommentId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(BloggingSectionConstants.PostLikesController.List.RouteName, new { Controller = BloggingSectionConstants.PostLikesController.ControllerName, Action = BloggingSectionConstants.PostLikesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.PostId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(BloggingSectionConstants.PostSharesController.List.RouteName, new { Controller = BloggingSectionConstants.PostSharesController.ControllerName, Action = BloggingSectionConstants.PostSharesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.PostId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); }
public PhotoAlbumModelGrid(HtmlHelper htmlHelper, bool isSelected = true, bool edit = true, bool id = true, bool isPublished = true, bool isDeleted = true, bool displayOrder = true, bool createdOn = true, bool lastModifiedOn = true, bool ipAddress = true, bool creator = true, bool allowComments = true, bool comments = true, bool likes = true, bool shares = true, bool title = true, bool description = true, bool metadata = true, bool artist = true, bool photos = true) : base(htmlHelper, isSelected, edit, FundamentalsSecctionConstants.PhotoAlbumsController.Edit.RouteName, id, isPublished, isDeleted, displayOrder, createdOn, lastModifiedOn, ipAddress, creator, allowComments, commentsCount, likesCount, shares) { if (title) { Column.For(pam => pam.Title).Named(htmlHelper.T(PhotoAlbumConstants.Fields.Title.Label)); } if (description) { Column.For(pam => pam.Description).Named(htmlHelper.T(PhotoAlbumConstants.Fields.Description.Label)); } if (metadata) { Column.For(pam => GenericHtmlHelper.EditorFor(trap => pam.Metadata)).Named(htmlHelper.T(CommonConstants.Fields.Metadata.Label)); } if (artist) { Column.For(pam => htmlHelper.LocalizedRouteLinkWithId(pam.ArtistFullName, FundamentalsSecctionConstants.FundamentalsController.Edit.RouteName, pam.ArtistId, null, new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(PhotoAlbumConstants.Fields.Artist.Label)); } if (photos) { Column.For(pam => htmlHelper.LocalizedRouteLink(pam.PhotosCount.ToString(), FundamentalsSecctionConstants.PhotosController.ListByPhotoAlbumId.RouteName, RouteParameter.Add(KnownParameterNames.PhotoAlbumId, pam.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(PhotoAlbumConstants.Fields.Photos.Label)); } }
public PollModelGrid(HtmlHelper htmlHelper, bool isSelected = true, bool edit = true, bool id = true, bool isPublished = true, bool isDeleted = true, bool displayOrder = true, bool createdOn = true, bool lastModifiedOn = true, bool ipAddress = true, bool creator = true, bool allowComments = true, bool comments = true, bool likes = true, bool shares = true, bool showOnHomePage = true, bool isMultiSelection = true, bool startDate = true, bool endDate = true, bool systemKeyword = true, bool title = true, bool description = true, bool metadata = true, bool pollAnswers = true) : base(htmlHelper, isSelected, edit, ContentManagementSectionConstants.PollsController.Edit.RouteName, id, isPublished, isDeleted, displayOrder, createdOn, lastModifiedOn, ipAddress, creator, allowComments, commentsCount, likesCount, shares) { if (showOnHomePage) { Column.For(pm => pm.ShowOnHomePage).Named(htmlHelper.T(PollConstants.Fields.ShowOnHomePage.Label)); } if (isMultiSelection) { Column.For(pm => pm.IsMultiSelection).Named(htmlHelper.T(PollConstants.Fields.IsMultiSelection.Label)); } if (startDate) { Column.For(pm => GenericHtmlHelper.EditorFor(trap => pm.StartDate)).Named(htmlHelper.T(PollConstants.Fields.StartDateOnUtc.Label)); } if (endDate) { Column.For(pm => GenericHtmlHelper.EditorFor(trap => pm.EndDate)).Named(htmlHelper.T(PollConstants.Fields.EndDateOnUtc.Label)); } if (systemKeyword) { Column.For(pm => pm.SystematicKeyword).Named(htmlHelper.T(PollConstants.Fields.SystematicKeyword.Label)); } if (title) { Column.For(pm => pm.Title).Named(htmlHelper.T(PollConstants.Fields.Title.Label)); } if (description) { Column.For(pm => pm.Description).Named(htmlHelper.T(PollConstants.Fields.Description.Label)); } if (metadata) { Column.For(pm => GenericHtmlHelper.EditorFor(trap => pm.Metadata)).Named(htmlHelper.T(CommonConstants.Fields.Metadata.Label)); } if (pollAnswers) { Column.For(cm => htmlHelper.SmartRouteLink(cm.PollAnswersCount.ToString(), ContentManagementSectionConstants.PollAnswersController.ListByPollId.RouteName, RouteParameter.Add(KnownParameterNames.PollId, cm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(PollConstants.Fields.PollAnswers.Label)); } }
public ActionResult List(long[] ids, PostAction postAction) { if (!IsUserizedRequest) { return(AccessDeniedView()); } if (postAction == PostAction.Unknown) { ResourceErrorNotification(CrudSharedConstants.Systematic.InvalidParameter); return(RedirectToAction(KnownActionNames.List, RouteParameter.Add(KnownParameterNames.Page, 1))); } if (!ids.Any()) { ResourceErrorNotification(CrudSharedConstants.Systematic.InvalidParameter); return(RedirectToAction(KnownActionNames.List, RouteParameter.Add(KnownParameterNames.Page, 1))); } var isSuccess = false; foreach (var id in ids) { var entity = LoadEntityById(id)(); if (entity == null) { return(HandleUnknown(id)); } ServiceOperationResult operationResult; switch (postAction) { case PostAction.PublishAll: entity.IsPublished = true; operationResult = UpdateEntityAndReturnOperationResult(entity)(); break; case PostAction.UnpublishAll: entity.IsPublished = false; operationResult = UpdateEntityAndReturnOperationResult(entity)(); break; case PostAction.TemporarilyDeleteAll: operationResult = DeleteEntityAndReturnOperationResult(entity)(); break; case PostAction.UnDeleteAll: entity.IsDeleted = false; operationResult = UpdateEntityAndReturnOperationResult(entity)(); break; default: operationResult = DeleteEntityAndReturnOperationResult(entity, false)(); break; } if (!isSuccess) { isSuccess = operationResult.Success; } } if (!isSuccess) { string key; switch (postAction) { case PostAction.PublishAll: case PostAction.UnpublishAll: case PostAction.TemporarilyDeleteAll: case PostAction.UnDeleteAll: key = CommonConstants.Systematic.NotUpdated; break; default: key = CommonConstants.Systematic.NotDeleted; break; } ResourceErrorNotification(key); } else { string key; switch (postAction) { case PostAction.PublishAll: case PostAction.UnpublishAll: case PostAction.TemporarilyDeleteAll: case PostAction.UnDeleteAll: key = CommonConstants.Systematic.Updated; break; default: key = CommonConstants.Systematic.Deleted; break; } ResourceSuccessNotification(key); } return(RedirectToAction(KnownActionNames.List, RouteParameter.Add(KnownParameterNames.Page, 1))); }
public LanguageModelGrid(HtmlHelper htmlHelper, bool isSelected = true, bool id = true, bool isPublished = true, bool isDeleted = true, bool displayOrder = true, bool createdOn = true, bool lastModifiedOn = true, bool isRightToLeft = true, bool name = true, bool isoCode = true, bool stringResources = true) : base(htmlHelper, isSelected, false, null, id, isPublished, isDeleted, displayOrder, createdOn, lastModifiedOn) { if (isRightToLeft) { Column.For(lm => lm.IsRightToLeft).Named(htmlHelper.T(LanguageConstants.Fields.IsRightToLeft.Label)); } if (name) { Column.For(lm => lm.Name).Named(htmlHelper.T(LanguageConstants.Fields.Name.Label)); } if (isoCode) { Column.For(lm => lm.IsoCode).Named(htmlHelper.T(LanguageConstants.Fields.IsoCode.Label)); } if (stringResources) { Column.For(lm => htmlHelper.LocalizedRouteLink(lm.StringResourcesCount.ToString(), SystematicSectionConstants.StringResourcesController.ListByLanguageId.RouteName, RouteParameter.Add(KnownParameterNames.LanguageId, lm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(LanguageConstants.Fields.Resources.Label)); } }
protected CommentableModelGridBase(HtmlHelper htmlHelper, bool isSelected = true, bool edit = true, string editRouteName = null, bool id = true, bool ipAddress = true, bool creator = true, bool isPublished = true, bool isDeleted = true, bool allowComments = true, bool displayOrder = true, bool comments = true, bool likes = true, bool shares = true) : base(htmlHelper, isSelected, edit, editRouteName, id, ipAddress, creator) { if (isPublished) { Column.For(cm => cm.IsPublished).Named(htmlHelper.T(CommentableConstants.Fields.IsPublished.Label)); } if (isDeleted) { Column.For(cm => cm.IsDeleted).Named(htmlHelper.T(CommentableConstants.Fields.IsDeleted.Label)); } if (allowComments) { Column.For(cm => cm.AllowComments).Named(htmlHelper.T(CommentableConstants.Fields.AllowComments.Label)); } if (displayOrder) { Column.For(cm => cm.DisplayOrder).Named(htmlHelper.T(CommentableConstants.Fields.DisplayOrder.Label)); } if (comments) { Column.For(cm => htmlHelper.SmartRouteLink(cm.CommentsCount.ToString(), CommonSectionConstants.CommentsController.ListByOwnerId.RouteName, RouteParameter.Add(KnownParameterNames.OwnerId, cm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(CommentableConstants.Fields.CommentsCount.Label)); } if (likes) { Column.For(cm => htmlHelper.SmartRouteLink(cm.LikesCount.ToString(), CommonSectionConstants.LikesController.ListByOwnerId.RouteName, RouteParameter.Add(KnownParameterNames.OwnerId, cm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(CommentableConstants.Fields.LikesCount.Label)); } if (shares) { Column.For(cm => htmlHelper.SmartRouteLink(cm.SharesCount.ToString(), CommonSectionConstants.SharesController.ListByOwnerId.RouteName, RouteParameter.Add(KnownParameterNames.OwnerId, cm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(CommentableConstants.Fields.SharesCount.Label)); } }
public PollAnswerModelGrid(HtmlHelper htmlHelper, bool isSelected = true, bool edit = true, bool id = true, bool isPublished = true, bool isDeleted = true, bool displayOrder = true, bool createdOn = true, bool lastModifiedOn = true, bool text = true, bool poll = true, bool pollVotingRecords = true) : base(htmlHelper, isSelected, edit, ContentManagementSectionConstants.PollAnswersController.Edit.RouteName, id, isPublished, isDeleted, displayOrder, createdOn, lastModifiedOn) { if (text) { Column.For(pam => pam.Text).Named(htmlHelper.T(PollAnswerConstants.Fields.Text.Label)); } if (poll) { Column.For(pam => htmlHelper.LocalizedRouteLinkWithId(pam.PollTitle, ContentManagementSectionConstants.PollsController.Edit.RouteName, pam.PollId, null, new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(PollAnswerConstants.Fields.Poll.Label)); } if (pollVotingRecords) { Column.For(pam => htmlHelper.SmartRouteLink(pam.PollVotingRecordsCount.ToString(), ContentManagementSectionConstants.PollVotingRecordsController.ListByPollAnswerId.RouteName, RouteParameter.Add(KnownParameterNames.PollAnswerId, pam.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(PollConstants.Fields.PollAnswers.Label)); } }
public TrackModelGrid(HtmlHelper htmlHelper, bool isSelected = true, bool edit = true, bool id = true, bool isPublished = true, bool isDeleted = true, bool displayOrder = true, bool createdOn = true, bool lastModifiedOn = true, bool ipAddress = true, bool creator = true, bool allowComments = true, bool comments = true, bool likes = true, bool shares = true, bool isVideo = true, bool trackNumber = true, bool releasedOn = true, bool title = true, bool description = true, bool metadata = true, bool genre = true, bool publisher = true, bool album = true, bool singers = true, bool composers = true, bool arrangementers = true, bool songwriters = true, bool covers = true, bool downloads = true) : base(htmlHelper, isSelected, edit, FundamentalsSecctionConstants.FundamentalsController.Edit.RouteName, id, isPublished, isDeleted, displayOrder, createdOn, lastModifiedOn, ipAddress, creator, allowComments, commentsCount, likesCount, shares) { if (isVideo) { Column.For(tm => tm.IsVideo).Named(htmlHelper.T(TrackConstants.Fields.IsVideo.Label)); } if (trackNumber) { Column.For(tm => tm.TrackNumber).Named(htmlHelper.T(TrackConstants.Fields.TrackNumber.Label)); } if (releasedOn) { Column.For(tm => GenericHtmlHelper.EditorFor(trap => tm.ReleaseDate)).Named(htmlHelper.T(TrackConstants.Fields.ReleaseDateUtc.Label)); } if (title) { Column.For(tm => tm.Title).Named(htmlHelper.T(TrackConstants.Fields.Title.Label)); } if (description) { Column.For(tm => tm.Description).Named(htmlHelper.T(TrackConstants.Fields.Description.Label)); } if (metadata) { Column.For(tm => GenericHtmlHelper.EditorFor(trap => tm.Metadata)).Named(htmlHelper.T(CommonConstants.Fields.Metadata.Label)); } if (singers) { Column.For(tm => htmlHelper.LocalizedRouteLink(tm.SingersCount.ToString(), FundamentalsSecctionConstants.FundamentalsController.ListByTrackId.RouteName, RouteParameter.Add(KnownParameterNames.TrackId, tm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(TrackConstants.Fields.Singers.Label)); } if (composers) { Column.For(tm => htmlHelper.LocalizedRouteLink(tm.ComposersCount.ToString(), FundamentalsSecctionConstants.FundamentalsController.ListByTrackId.RouteName, RouteParameter.Add(KnownParameterNames.TrackId, tm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(TrackConstants.Fields.Composers.Label)); } if (arrangementers) { Column.For(tm => htmlHelper.LocalizedRouteLink(tm.ArrangementersCount.ToString(), FundamentalsSecctionConstants.FundamentalsController.ListByTrackId.RouteName, RouteParameter.Add(KnownParameterNames.TrackId, tm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(TrackConstants.Fields.Arrangementers.Label)); } if (songwriters) { Column.For(tm => htmlHelper.LocalizedRouteLink(tm.SongwritersCount.ToString(), FundamentalsSecctionConstants.FundamentalsController.ListByTrackId.RouteName, RouteParameter.Add(KnownParameterNames.TrackId, tm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(TrackConstants.Fields.Songwriters.Label)); } if (covers) { Column.For(tm => htmlHelper.LocalizedRouteLink(tm.CoversCount.ToString(), FileManagementSectionConstants.PicturesController.ListByTrackId.RouteName, RouteParameter.Add(KnownParameterNames.TrackId, tm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(TrackConstants.Fields.Covers.Label)); } if (downloads) { Column.For(tm => htmlHelper.LocalizedRouteLink(tm.DownloadsCount.ToString(), FileManagementSectionConstants.DownloadsController.ListByTrackId.RouteName, RouteParameter.Add(KnownParameterNames.TrackId, tm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(TrackConstants.Fields.Downloads.Label)); } }
private static void HandleUnauthorizedRequest(UserizationContext filterContext) { filterContext.Result = new RedirectToRouteResult(AuthenticateSectionConstants.SignController.In.RouteName, RouteParameter.Add("then", filterContext.RequestContext.HttpContext.Request.Url.PathAndQuery)); }
public void RegisterRoutes(RouteCollection routeCollection) { routeCollection.MapStandardRoute(NewsSectionConstants.RouteName, new { Controller = NewsSectionConstants.ControllerName, Action = NewsSectionConstants.ActionName }); routeCollection.MapStandardRoute(NewsSectionConstants.CategoriesController.List.RouteName, new { Controller = NewsSectionConstants.CategoriesController.ControllerName, Action = NewsSectionConstants.CategoriesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(NewsSectionConstants.CategoriesController.New.RouteName, new { Controller = NewsSectionConstants.CategoriesController.ControllerName, Action = NewsSectionConstants.CategoriesController.New.ActionName }); routeCollection.MapStandardRoute(NewsSectionConstants.CategoriesController.Edit.RouteName, new { Controller = NewsSectionConstants.CategoriesController.ControllerName, Action = NewsSectionConstants.CategoriesController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(NewsSectionConstants.ContentManagementController.List.RouteName, new { Controller = NewsSectionConstants.ContentManagementController.ControllerName, Action = NewsSectionConstants.ContentManagementController.List.ActionName }, RouteParameter.Add(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(NewsSectionConstants.ContentManagementController.New.RouteName, new { Controller = NewsSectionConstants.ContentManagementController.ControllerName, Action = NewsSectionConstants.ContentManagementController.New.ActionName }); routeCollection.MapStandardRoute(NewsSectionConstants.ContentManagementController.Edit.RouteName, new { Controller = NewsSectionConstants.ContentManagementController.ControllerName, Action = NewsSectionConstants.ContentManagementController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(NewsSectionConstants.ContentManagementCommentsController.List.RouteName, new { Controller = NewsSectionConstants.ContentManagementCommentsController.ControllerName, Action = NewsSectionConstants.ContentManagementCommentsController.List.ActionName }, RouteParameter.Add(KnownParameterNames.ContentManagementId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(NewsSectionConstants.ContentManagementCommentsController.Edit.RouteName, new { Controller = NewsSectionConstants.ContentManagementCommentsController.ControllerName, Action = NewsSectionConstants.ContentManagementCommentsController.Edit.ActionName }, RouteParameter.Add(KnownParameterNames.Id, KnownConstraints.Int32)); routeCollection.MapStandardRoute(NewsSectionConstants.ContentManagementCommentLikesController.List.RouteName, new { Controller = NewsSectionConstants.ContentManagementCommentLikesController.ControllerName, Action = NewsSectionConstants.ContentManagementCommentLikesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.ContentManagementCommentId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(NewsSectionConstants.ContentManagementLikesController.List.RouteName, new { Controller = NewsSectionConstants.ContentManagementLikesController.ControllerName, Action = NewsSectionConstants.ContentManagementLikesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.ContentManagementId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); routeCollection.MapStandardRoute(NewsSectionConstants.ContentManagementSharesController.List.RouteName, new { Controller = NewsSectionConstants.ContentManagementSharesController.ControllerName, Action = NewsSectionConstants.ContentManagementSharesController.List.ActionName }, RouteParameter.Add(KnownParameterNames.ContentManagementId, KnownConstraints.Int32).Append(KnownParameterNames.Page, KnownConstraints.Int32)); }
public PermissionRecordModelGrid(HtmlHelper htmlHelper, bool isSelected = true, bool edit = true, bool id = true, bool isPublished = true, bool isDeleted = true, bool displayOrder = true, bool createdOn = true, bool lastModifiedOn = true, bool systemName = true, bool name = true, bool category = true, bool roles = true) : base(htmlHelper, isSelected, edit, SecuritySectionConstants.PermissionRecordsController.Edit.RouteName, id, isPublished, isDeleted, displayOrder, createdOn, lastModifiedOn) { if (systemName) { Column.For(prm => prm.SystematicName).Named(htmlHelper.T(PermissionRecordConstants.Fields.SystematicName.Label)); } if (name) { Column.For(prm => prm.Name).Named(htmlHelper.T(PermissionRecordConstants.Fields.Name.Label)); } if (category) { Column.For(prm => prm.Category).Named(htmlHelper.T(PermissionRecordConstants.Fields.Category.Label)); } if (roles) { Column.For(prm => htmlHelper.LocalizedRouteLink(prm.RolesCount.ToString(), SecuritySectionConstants.RolesController.ListByPermissionRecordId.RouteName, RouteParameter.Add(KnownParameterNames.PermissionRecordId, prm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(PermissionRecordConstants.Fields.Roles.Label)); } }
public PublisherModelGrid(HtmlHelper htmlHelper, bool isSelected = true, bool edit = true, bool id = true, bool isPublished = true, bool isDeleted = true, bool displayOrder = true, bool createdOn = true, bool lastModifiedOn = true, bool ipAddress = true, bool creator = true, bool allowComments = true, bool comments = true, bool likes = true, bool shares = true, bool name = true, bool ceo = true, bool registrationNumber = true, bool email = true, bool history = false, bool metadata = true, bool website = true, bool logo = true, bool tracks = true) : base(htmlHelper, isSelected, edit, FundamentalsSecctionConstants.FundamentalsController.Edit.RouteName, id, isPublished, isDeleted, displayOrder, createdOn, lastModifiedOn, ipAddress, creator, allowComments, commentsCount, likesCount, shares) { if (name) { Column.For(pm => pm.Name).Named(htmlHelper.T(PublisherConstants.Fields.Name.Label)); } if (ceo) { Column.For(pm => pm.Ceo).Named(htmlHelper.T(PublisherConstants.Fields.Ceo.Label)); } if (registrationNumber) { Column.For(pm => pm.RegisterationNumber).Named(htmlHelper.T(PublisherConstants.Fields.RegisterationNumber.Label)); } if (email) { Column.For(pm => pm.Email).Named(htmlHelper.T(PublisherConstants.Fields.Email.Label)); } if (history) { Column.For(pm => pm.History).Named(htmlHelper.T(PublisherConstants.Fields.History.Label)); } if (metadata) { Column.For(pm => GenericHtmlHelper.EditorFor(trap => pm.Metadata)).Named(htmlHelper.T(CommonConstants.Fields.Metadata.Label)); } if (website) { Column.For(pm => htmlHelper.LocalizedRouteLinkWithId(pm.WebsiteTargetUrl, MiscellaneousSectionConstants.RedirectorsController.Edit.RouteName, pm.WebsiteId, null, new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(PublisherConstants.Fields.Website.Label)); } if (logo) { Column.For(pm => htmlHelper.LocalizedRouteLinkWithId(pm.LogoFileName, FileManagementSectionConstants.PicturesController.Edit.RouteName, pm.LogoId, null, new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(PublisherConstants.Fields.Logo.Label)); } if (tracks) { Column.For(pm => htmlHelper.LocalizedRouteLink(pm.FundamentalsCount.ToString(), FundamentalsSecctionConstants.FundamentalsController.ListByPublisherId.RouteName, RouteParameter.Add(KnownParameterNames.PublisherId, pm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(PublisherConstants.Fields.Fundamentals.Label)); } }
public BlogModelGrid(HtmlHelper htmlHelper, bool isSelected = true, bool edit = true, bool id = true, bool isPublished = true, bool isDeleted = true, bool displayOrder = true, bool createdOn = true, bool lastModifiedOn = true, bool isActive = true, bool name = true, bool author = true, bool tags = true, bool posts = true) : base(htmlHelper, isSelected, edit, ContentManagementSectionConstants.BlogsController.Edit.RouteName, id, isPublished, isDeleted, displayOrder, createdOn, lastModifiedOn) { if (isActive) { Column.For(bm => bm.IsActive).Named(htmlHelper.T(BlogConstants.Fields.IsActive.Label)); } if (name) { Column.For(bm => bm.Name).Named(htmlHelper.T(BlogConstants.Fields.Name.Label)); } if (author) { Column.For(bm => htmlHelper.LocalizedRouteLinkWithId(bm.UserFullName, SecuritySectionConstants.UsersController.Edit.RouteName, bm.UserId, null, new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(BlogConstants.Fields.User.Label)); } if (tags) { Column.For(bm => htmlHelper.LocalizedRouteLink(bm.TagsCount.ToString(), ContentManagementSectionConstants.TagsController.ListByBlogId.RouteName, RouteParameter.Add(KnownParameterNames.BlogId, bm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(BlogConstants.Fields.Tags.Label)); } if (posts) { Column.For(bm => htmlHelper.LocalizedRouteLink(bm.PostsCount.ToString(), ContentManagementSectionConstants.PostsController.ListByBlogId.RouteName, RouteParameter.Add(KnownParameterNames.BlogId, bm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(BlogConstants.Fields.Posts.Label)); } }
public GroupModelGrid(HtmlHelper htmlHelper, bool isSelected = true, bool edit = true, bool id = true, bool isPublished = true, bool isDeleted = true, bool displayOrder = true, bool createdOn = true, bool lastModifiedOn = true, bool title = true, bool metadata = true, bool parent = true, bool childs = true, bool pages = true) : base(htmlHelper, isSelected, edit, ContentManagementSectionConstants.GroupsController.Edit.RouteName, id, isPublished, isDeleted, displayOrder, createdOn, lastModifiedOn) { if (title) { Column.For(gm => gm.Title).Named(htmlHelper.T(GroupConstants.Fields.Title.Label)); } if (metadata) { Column.For(gm => GenericHtmlHelper.EditorFor(trap => gm.Metadata)).Named(htmlHelper.T(CommonConstants.Fields.Metadata.Label)); } if (parent) { Column.For(gm => htmlHelper.LocalizedRouteLinkWithId(gm.ParentTitle, ContentManagementSectionConstants.GroupsController.Edit.RouteName, gm.ParentId, null, new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(GroupConstants.Fields.Parent.Label)); } if (childs) { Column.For(cm => htmlHelper.LocalizedRouteLink(cm.ChildsCount.ToString(), ContentManagementSectionConstants.CategoriesController.ListByParentId.RouteName, RouteParameter.Add(KnownParameterNames.ParentId, cm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(GroupConstants.Fields.Childs.Label)); } if (pages) { Column.For(cm => htmlHelper.LocalizedRouteLink(cm.ContentManagementCount.ToString(), ContentManagementSectionConstants.ContentManagementController.ListByGroupId.RouteName, RouteParameter.Add(KnownParameterNames.GroupId, cm.Id), new { @class = "btn secondary" }, null, null, false, null)).Named(htmlHelper.T(GroupConstants.Fields.ContentManagement.Label)); } }