public Task <List <Team> > GetByClubGenderAndAgeGroup(int clubID, AgeGroups ageGroup, Genders gender) { return(this .SessionQuery() .Where(x => x.Club.ID == clubID && x.GenderID == gender && x.AgeGroupID == ageGroup) .ToListAsync()); }
public static Competition Create(CompetitionHeader header, Season season, CompetitionOrganisers organiser, CompetitionScopes scope, CompetitionFormats format, AgeGroups ageGroup, Genders gender, int associationID, string name, DateTime startDate, DateTime?endDate) { var data = new Competition { Season = season, CompetitionOrganiserID = organiser, CompetitionScopeID = scope, CompetitionFormatID = format, AgeGroupID = ageGroup, GenderID = gender, AssociationID = associationID, Name = name, StartDate = startDate, EndDate = endDate }; if (header != null) { data.CompetitionHeaderID = header.ID; } return(data); }
private void ParseAgeGroups(Parser parser) { parser.lineno++; if (parser.curr.indent == 0) { return; } var startindent = parser.curr.indent; while (parser.curr.indent == startindent) { var agegroup = new AgeGroup(); if (parser.curr.kw != Parser.RegKeywords.None) { throw parser.GetException("unexpected line"); } agegroup.SmallGroup = parser.GetLine(); var m = parser.agerange.Match(agegroup.SmallGroup); if (!m.Success) { parser.lineno--; throw parser.GetException("expected age range like 0-12"); } agegroup.StartAge = m.Groups["start"].Value.ToInt(); agegroup.EndAge = m.Groups["end"].Value.ToInt(); if (parser.curr.indent <= startindent) { throw parser.GetException("expected either indented SmallGroup or Fee"); } var ind = parser.curr.indent; while (parser.curr.indent == ind) { switch (parser.curr.kw) { case Parser.RegKeywords.SmallGroup: agegroup.SmallGroup = parser.GetString(agegroup.SmallGroup); break; case Parser.RegKeywords.Fee: agegroup.Fee = parser.GetDecimal(); break; default: throw parser.GetException("unexpected line"); } } AgeGroups.Add(agegroup); } }
public StatisticsDetails ( bool didRegisterOnline, bool isAccreditationPrinted, int hourOfRegistration, AgeGroups ageGroup, WorkStatuses workStatus ) { DidRegisterOnline = didRegisterOnline; IsAccreditationPrinted = isAccreditationPrinted; HourOfRegistration = hourOfRegistration; AgeGroup = ageGroup; WorkStatus = workStatus; }
public AgeGroups GetAgeGroupFromNum(int age) { AgeGroups result = 0; switch (age) { case 1: result = AgeGroups.Felnőtt; break; case 2: result = AgeGroups.Ifi; break; case 3: result = AgeGroups.Serdülő; break; case 4: result = AgeGroups.Gyermek; break; case 5: result = AgeGroups.Delfin; break; case 6: result = AgeGroups.Béka; break; default: break; } return(result); }
public void ReadXml(XmlReader reader) { var xd = XDocument.Load(reader); if (xd.Root == null) { return; } foreach (var e in xd.Root.Elements()) { var name = e.Name.ToString(); switch (name) { case "Confirmation": Subject = e.Element("Subject")?.Value; Body = e.Element("Body")?.Value; break; case "Reminder": ReminderSubject = e.Element("Subject")?.Value; ReminderBody = e.Element("Body")?.Value; break; case "SupportEmail": SupportSubject = e.Element("Subject")?.Value; SupportBody = e.Element("Body")?.Value; break; case "SenderEmail": SenderSubject = e.Element("Subject")?.Value; SenderBody = e.Element("Body")?.Value; break; case "Instructions": InstructionLogin = e.Element("Login")?.Value; InstructionSelect = e.Element("Select")?.Value; InstructionFind = e.Element("Find")?.Value; InstructionOptions = e.Element("Options")?.Value; InstructionSpecial = e.Element("Special")?.Value; InstructionSubmit = e.Element("Submit")?.Value; InstructionSorry = e.Element("Sorry")?.Value; ThankYouMessage = e.Element("Thanks")?.Value; Terms = e.Element("Terms")?.Value; break; case "Fees": Fee = e.Element("Fee").ToDecimal(); Deposit = e.Element("Deposit").ToDecimal(); ExtraFee = e.Element("ExtraFee").ToDecimal(); MaximumFee = e.Element("MaximumFee").ToDecimal(); ApplyMaxToOtherFees = e.Element("ApplyMaxToOtherFees").ToBool(); ExtraValueFeeName = e.Element("ExtraValueFeeName")?.Value; AccountingCode = e.Element("AccountingCode")?.Value; PushpayFundName = e.Element("PushpayFundName")?.Value; IncludeOtherFeesWithDeposit = e.Element("IncludeOtherFeesWithDeposit").ToBool(); OtherFeesAddedToOrgFee = e.Element("OtherFeesAddedToOrgFee").ToBool(); AskDonation = e.Element("AskDonation").ToBool(); DonationLabel = e.Element("DonationLabel")?.Value; DonationFundId = e.Element("DonationFundId").ToInt2(); break; case "AgeGroups": if (AgeGroups == null) { AgeGroups = new List <AgeGroup>(); } foreach (var ee in e.Elements("Group")) { AgeGroups.Add(new AgeGroup { StartAge = ee.Attribute("StartAge").ToInt2() ?? 0, EndAge = ee.Attribute("EndAge").ToInt2() ?? 0, Fee = ee.Attribute("Fee").ToDecimal(), SmallGroup = ee.Value }); } break; case "OrgFees": if (OrgFees == null) { OrgFees = new List <OrgFee>(); } foreach (var ee in e.Elements("Fee")) { OrgFees.Add(new OrgFee { OrgId = ee.Attribute("OrgId").ToInt2(), Fee = ee.Attribute("Fee").ToDecimal() }); } break; case "Options": ConfirmationTrackingCode = e.Element("ConfirmationTrackingCode")?.Value; ValidateOrgs = e.Element("ValidateOrgs")?.Value; Shell = e.Element("Shell")?.Value; ShellBs = e.Element("ShellBs")?.Value; FinishRegistrationButton = e.Element("FinishRegistrationButton")?.Value; SpecialScript = e.Element("SpecialScript")?.Value; OnEnrollScript = e.Element("OnEnrollScript")?.Value; GroupToJoin = e.Element("GroupToJoin")?.Value; TimeOut = e.Element("TimeOut").ToInt2(); AllowOnlyOne = e.Element("AllowOnlyOne").ToBool(); TargetExtraValues = e.Element("TargetExtraValues").ToBool(); AllowReRegister = e.Element("AllowReRegister").ToBool(); AllowSaveProgress = e.Element("AllowSaveProgress").ToBool(); MemberOnly = e.Element("MemberOnly").ToBool(); AddAsProspect = e.Element("AddAsProspect").ToBool(); DisallowAnonymous = e.Element("DisallowAnonymous").ToBool(); break; case "NotRequired": NoReqBirthYear = e.Element("NoReqBirthYear").ToBool(); NotReqDOB = e.Element("NotReqDOB").ToBool(); NotReqAddr = e.Element("NotReqAddr").ToBool(); NotReqZip = e.Element("NotReqZip").ToBool(); NotReqPhone = e.Element("NotReqPhone").ToBool(); NotReqGender = e.Element("NotReqGender").ToBool(); NotReqMarital = e.Element("NotReqMarital").ToBool(); NotReqCampus = e.Element("NotReqCampus").ToBool(); ShowDOBOnFind = e.Element("ShowDOBOnFind").ToBool(); ShowPhoneOnFind = e.Element("ShowPhoneOnFind").ToBool(); break; case "TimeSlots": TimeSlots = TimeSlots.ReadXml(e); if (TimeSlots.TimeSlotLockDays.HasValue) { TimeSlotLockDays = TimeSlots.TimeSlotLockDays; } break; case "AskItems": foreach (var ele in e.Elements()) { AskItems.Add(Ask.ReadXml(ele)); } break; } } SetUniqueIds("AskDropdown"); SetUniqueIds("AskExtraQuestions"); SetUniqueIds("AskCheckboxes"); SetUniqueIds("AskText"); SetUniqueIds("AskMenu"); }
public static AgeGroup AgeGroupById(string ageGroupId) { return(AgeGroups.Where(x => x.AgeGroupID == ageGroupId).Single()); }
public async Task <IActionResult> Index(string keywords, string bookPublisher, BookCategories category, AgeGroups ageGroup, string yearFrom, string yearTo, string sortField, int page = 1) { var user = await _userManager.GetUserAsync(User); var books = _context.Books .Include(b => b.Answers) .Include(b => b.BookRatings) .AsQueryable(); CurrentPage = page == 0 ? 1 : page; var publishers = books.Select(b => b.Publisher); if (!string.IsNullOrEmpty(keywords)) { books = books.Where(b => b.Title.ToUpper().Contains(keywords.ToUpper()) || b.BookAuthor.ToUpper().Contains(keywords.ToUpper()) || b.Isbn1.ToUpper().Contains(keywords.ToUpper()) || b.Publisher.ToUpper().Contains(keywords.ToUpper()) || b.Isbn2.ToUpper().Contains(keywords.ToUpper())); } if (!string.IsNullOrEmpty(bookPublisher)) { books = books.Where(b => b.Publisher == bookPublisher); } if (category != 0) { books = books.Where(b => b.BookCategory == category); } if (ageGroup != 0) { books = books.Where(b => b.AgeGroup == ageGroup); } if (!string.IsNullOrEmpty(yearFrom) && int.TryParse(yearFrom, out int n)) { books = books.Where(b => int.Parse(b.YearPublished) >= n); } if (!string.IsNullOrEmpty(yearTo) && int.TryParse(yearTo, out int m)) { books = books.Where(b => int.Parse(b.YearPublished) <= m); } switch (sortField) { case "latest": books = books.OrderByDescending(b => b.DateAdded); break; case "rating": books = books.OrderByDescending(b => b.AverageRating); break; case "views": books = books.OrderByDescending(b => b.Answers.Count); break; case "class": books = books.OrderBy(b => b.Grade); break; case "year": books = books.OrderBy(b => b.YearPublished); break; case "title": books = books.OrderBy(b => b.Title); break; case "author": books = books.OrderBy(b => b.BookAuthor); break; default: books = books.OrderByDescending(b => b.DateAdded); break; } Count = books.Count(); if (CurrentPage > TotalPages) { CurrentPage = TotalPages; } var indexVm = new IndexBookViewModel() { Books = await books.Skip((CurrentPage - 1) *PageSize) .Take(PageSize) .ToListAsync(), Publishers = new SelectList(await publishers.Distinct().ToListAsync()), CurrentPage = CurrentPage, Count = Count, PageSize = PageSize, TotalPages = TotalPages, EnablePrevious = EnablePrevious, EnableNext = EnableNext }; if (User.Identity.IsAuthenticated) { var booksIds = _context.MarkedBooks .Where(mb => mb.UserId == user.Id) .Select(mb => mb.BookId).ToList(); indexVm.BooksIds = booksIds; } return(View(indexVm)); }
public Task <Team> GetByNameGenderAndAgeGroup(string name, AgeGroups ageGroup, Genders gender) { return(this .SessionQuery() .SingleOrDefaultAsync(x => x.Name == name && x.GenderID == gender && x.AgeGroupID == ageGroup)); }