C# Класс CTCClassSchedule.Common.Helpers

Показать файл Открыть проект

Открытые методы

Метод Описание
BuildCourseID ( string CourseNumber, string CourseSubject, bool IsCommonCourse ) : string

ConstructDaysList ( string day_su, string day_m, string day_t, string day_w, string day_th, string day_f, string day_s ) : IList
ConstructModalityList ( string f_oncampus, string f_online, string f_hybrid ) : IList
DetermineRegistrationQuarter ( string quarter, YearQuarter currentQuarter, System.Web.Routing.RouteData routeData ) : YearQuarter

Allows user to enter "current" in URL in place of quarter

ExtractCommonFootnotes ( IEnumerable sectionBlock ) : IList

ExtractCommonFootnotes ( IList sectionBlock ) : IList

FormatWithSearchTerm ( string searchTerm, string text ) : string

Applies keyword markup to all instances of the searchTerm found in the provided text

GetCourseOutcome ( ICourseID courseId ) : dynamic

Gets the course outcome information by scraping the Bellevue College course outcomes website

GetFutureQuarters ( OdsRepository repository ) : IList

Gets the YearQuarter for the current, and future 2 quarters.

GetSectionsWithSeats ( string currentYrq, IList
sections, ClassScheduleDb db ) : IList

Common method to retrieve SectionWithSeats records

GetYearQuarterListForMenus ( OdsRepository repository ) : IList

Gets the YearQuarter for the current, and previous 3 quarters. This drives the dynamic YRQ navigation bar

GroupSectionsIntoBlocks ( IList sections, ClassScheduleDb db ) : IList

Groups a list of Sections by course, into descriptive SectionBlocks

ParseCommonHeadingLinkedSections ( List linkedSections ) : IList

StripHtml ( string withHtml, string whitelistPattern = null ) : string

SubjectWithCommonCourseFlag ( Course course ) : string
SubjectWithCommonCourseFlag ( CourseID course ) : string
SubjectWithCommonCourseFlag ( SectionWithSeats sec ) : string
addFacets ( string timestart, string timeend, string day_su, string day_m, string day_t, string day_w, string day_th, string day_f, string day_s, string f_oncampus, string f_online, string f_hybrid, string avail, string latestart, string numcredits ) : IList

returns an IList that contains all of the facet information passed into the app by the user clicking on the faceted search left pane facets accepted: flex, time, days, availability

getBodyClasses ( System.Web.HttpContextBase Context ) : string
getBookstoreBooksLink ( IList linkedSections ) : string
getCourseIdFromString ( string courseId ) : CourseID
getFacetInfo ( string fieldID, string fieldTitle, string fieldValue ) : GeneralFacetInfo

getFriendlyDayRange ( string dayString ) : string
getFriendlyTime ( System.DateTime theDate ) : string

Returns a friendly time in sentance form given a datetime. This value is create by subtracting the input datetime from the current datetime. example: 6/8/2011 07:23:123 -> about 4 hours ago

getLinkParams ( System.Web.HttpRequestBase httpRequest ) : object>.IDictionary

Gets the current http get/post params and assigns them to an IDictionary This is mainly used to set a Viewbag variable so these can be passed into action links in the views.

getProfileURL ( string SID ) : String
getShortNameFormat ( string fullName ) : string

Take a full name and converts it to a short format, with the last name and first initial of the first name (e.g. ANDREW CRASWELL -> CRASWELL A).

isAdmin ( System.Web.HttpContextBase Context ) : bool

isEditor ( System.Web.HttpContextBase Context ) : bool

Приватные методы

Метод Описание
SubjectWithCommonCourseFlag ( string subject, bool isCommonCourse ) : string
getHourAndMinuteFromString ( string time, int &hour, int &minute, DefaultTimeResult defaultResultMode = DefaultTimeResult.StartTime ) : void

Takes a string that represents a time (ie "6:45pm") and outputs the parsed hour and minute integers based on a 24 hour clock. If a time cannot be parsed, the output defaults to either 12am or 11:59pm depending on the time default parameter passed

getYRQValueForBookstoreURL ( YearQuarter yrq ) : string

Описание методов

BuildCourseID() публичный статический Метод

public static BuildCourseID ( string CourseNumber, string CourseSubject, bool IsCommonCourse ) : string
CourseNumber string
CourseSubject string
IsCommonCourse bool
Результат string

ConstructDaysList() публичный статический Метод

public static ConstructDaysList ( string day_su, string day_m, string day_t, string day_w, string day_th, string day_f, string day_s ) : IList
day_su string
day_m string
day_t string
day_w string
day_th string
day_f string
day_s string
Результат IList

ConstructModalityList() публичный статический Метод

public static ConstructModalityList ( string f_oncampus, string f_online, string f_hybrid ) : IList
f_oncampus string
f_online string
f_hybrid string
Результат IList

DetermineRegistrationQuarter() публичный статический Метод

Allows user to enter "current" in URL in place of quarter
public static DetermineRegistrationQuarter ( string quarter, YearQuarter currentQuarter, System.Web.Routing.RouteData routeData ) : YearQuarter
quarter string
currentQuarter YearQuarter
routeData System.Web.Routing.RouteData
Результат YearQuarter

ExtractCommonFootnotes() публичный статический Метод

public static ExtractCommonFootnotes ( IEnumerable sectionBlock ) : IList
sectionBlock IEnumerable
Результат IList

ExtractCommonFootnotes() публичный статический Метод

public static ExtractCommonFootnotes ( IList sectionBlock ) : IList
sectionBlock IList
Результат IList

FormatWithSearchTerm() публичный статический Метод

Applies keyword markup to all instances of the searchTerm found in the provided text
public static FormatWithSearchTerm ( string searchTerm, string text ) : string
searchTerm string
text string
Результат string

GetCourseOutcome() публичный статический Метод

Gets the course outcome information by scraping the Bellevue College course outcomes website
public static GetCourseOutcome ( ICourseID courseId ) : dynamic
courseId ICourseID
Результат dynamic

GetFutureQuarters() публичный статический Метод

Gets the YearQuarter for the current, and future 2 quarters.
public static GetFutureQuarters ( OdsRepository repository ) : IList
repository OdsRepository
Результат IList

GetSectionsWithSeats() публичный статический Метод

Common method to retrieve SectionWithSeats records
public static GetSectionsWithSeats ( string currentYrq, IList
sections, ClassScheduleDb db ) : IList
currentYrq string
sections IList
db CTCClassSchedule.Models.ClassScheduleDb
Результат IList

GetYearQuarterListForMenus() публичный статический Метод

Gets the YearQuarter for the current, and previous 3 quarters. This drives the dynamic YRQ navigation bar
public static GetYearQuarterListForMenus ( OdsRepository repository ) : IList
repository OdsRepository
Результат IList

GroupSectionsIntoBlocks() публичный статический Метод

Groups a list of Sections by course, into descriptive SectionBlocks
public static GroupSectionsIntoBlocks ( IList sections, ClassScheduleDb db ) : IList
sections IList List of sections to group
db CTCClassSchedule.Models.ClassScheduleDb
Результат IList

ParseCommonHeadingLinkedSections() публичный статический Метод

public static ParseCommonHeadingLinkedSections ( List linkedSections ) : IList
linkedSections List
Результат IList

StripHtml() публичный статический Метод

public static StripHtml ( string withHtml, string whitelistPattern = null ) : string
withHtml string
whitelistPattern string
Результат string

SubjectWithCommonCourseFlag() публичный статический Метод

public static SubjectWithCommonCourseFlag ( Course course ) : string
course Course
Результат string

SubjectWithCommonCourseFlag() публичный статический Метод

public static SubjectWithCommonCourseFlag ( CourseID course ) : string
course CourseID
Результат string

SubjectWithCommonCourseFlag() публичный статический Метод

public static SubjectWithCommonCourseFlag ( SectionWithSeats sec ) : string
sec CTCClassSchedule.Models.SectionWithSeats
Результат string

addFacets() публичный статический Метод

returns an IList that contains all of the facet information passed into the app by the user clicking on the faceted search left pane facets accepted: flex, time, days, availability
public static addFacets ( string timestart, string timeend, string day_su, string day_m, string day_t, string day_w, string day_th, string day_f, string day_s, string f_oncampus, string f_online, string f_hybrid, string avail, string latestart, string numcredits ) : IList
timestart string
timeend string
day_su string
day_m string
day_t string
day_w string
day_th string
day_f string
day_s string
f_oncampus string
f_online string
f_hybrid string
avail string
latestart string
numcredits string
Результат IList

getBodyClasses() публичный статический Метод

public static getBodyClasses ( System.Web.HttpContextBase Context ) : string
Context System.Web.HttpContextBase
Результат string

getBookstoreBooksLink() публичный статический Метод

public static getBookstoreBooksLink ( IList linkedSections ) : string
linkedSections IList
Результат string

getCourseIdFromString() публичный статический Метод

public static getCourseIdFromString ( string courseId ) : CourseID
courseId string
Результат CourseID

getFacetInfo() публичный статический Метод

public static getFacetInfo ( string fieldID, string fieldTitle, string fieldValue ) : GeneralFacetInfo
fieldID string
fieldTitle string
fieldValue string
Результат GeneralFacetInfo

getFriendlyDayRange() публичный статический Метод

public static getFriendlyDayRange ( string dayString ) : string
dayString string
Результат string

getFriendlyTime() публичный статический Метод

Returns a friendly time in sentance form given a datetime. This value is create by subtracting the input datetime from the current datetime. example: 6/8/2011 07:23:123 -> about 4 hours ago
public static getFriendlyTime ( System.DateTime theDate ) : string
theDate System.DateTime
Результат string

getLinkParams() публичный статический Метод

Gets the current http get/post params and assigns them to an IDictionary This is mainly used to set a Viewbag variable so these can be passed into action links in the views.
public static getLinkParams ( System.Web.HttpRequestBase httpRequest ) : object>.IDictionary
httpRequest System.Web.HttpRequestBase
Результат object>.IDictionary

getProfileURL() публичный статический Метод

public static getProfileURL ( string SID ) : String
SID string
Результат String

getShortNameFormat() публичный статический Метод

Take a full name and converts it to a short format, with the last name and first initial of the first name (e.g. ANDREW CRASWELL -> CRASWELL A).
public static getShortNameFormat ( string fullName ) : string
fullName string The full name to be converted.
Результат string

isAdmin() публичный статический Метод

public static isAdmin ( System.Web.HttpContextBase Context ) : bool
Context System.Web.HttpContextBase
Результат bool

isEditor() публичный статический Метод

public static isEditor ( System.Web.HttpContextBase Context ) : bool
Context System.Web.HttpContextBase
Результат bool