private List <string> GetBreadCrumbs(MessageSection parent, bool withParent) { var breadcrumb = new List <string>(); if (parent != null && !withParent) { parent = parent.Parent; } while (parent != null && parent.MessageSectionID > 0) { if (parent.SysName == MessageSections.Forum) { parent = null; } else { breadcrumb.Add(_helper.ActionLink <MessageController>( c => c.Section(parent.MessageSectionID, 1), parent.Name).ToString()); parent = parent.Parent; } } breadcrumb.Add(Forum); breadcrumb.Reverse(); return(breadcrumb); }
bool CheckCannotAddMessageToClub(MessageSection section) { return(section != null && section.IsGraduateClubOrChildren && !User.InRole(Role.ForumAdmin | Role.Trainer | Role.Employee | Role.ContentManager) && !StudentInGroupRepository.GetAll(x => x.Student_ID == User.Student_ID && !CourseTC.SemSrt.Contains(x.Group.Course_TC) && BerthTypes.AllPaidForCourses.Contains(x.BerthType_TC)).Any()); }
public static string MessageSectionLink(this HtmlHelper helper, MessageSection messageSection) { if (!messageSection.IsGraduateClub || helper.InRole(Role.GraduateClubAccess)) { return(helper.ActionLink <MessageController>( sc => sc.Section(messageSection.MessageSectionID, 1), messageSection.Name).ToString()); } return(messageSection.Name); }