public SqlScoreInfo(PogiDbContext context, ITourInfo tourInfo, IHandicap handicap, IDateTime dateTime) { _context = context; _tourInfo = tourInfo; _handicap = handicap; _dateTime = dateTime; }
public ScoresController(PogiDbContext context, IScoreInfo scoreInfo, SignInManager <ApplicationUser> signInManager, UserManager <ApplicationUser> userManager, IMemberData memberData, ICourseData courseData, ICourseDetail courseDetail, IHandicap handicap, ITourInfo tourInfo, ITourDay tourDayInfo, ITeeTimeInfo teeTimeInfo, IHttpContextAccessor httpContextAccessor, IActivity activity, IDateTime dateTime) { _context = context; _scoreInfo = scoreInfo; _signInManager = signInManager; _userManager = userManager; _memberData = memberData; _courseData = courseData; _courseDetail = courseDetail; _handicap = handicap; _tourInfo = tourInfo; _tourDayInfo = tourDayInfo; _teeTimeInfo = teeTimeInfo; _httpContextAccessor = httpContextAccessor; _activity = activity; _dateTime = dateTime; }
private static bool GetSingleTourInfo(HtmlNode tourInfoNode, out ITourInfo tourInfo) { var name = XmlParse.GetStringNodeValue(tourInfoNode, "name", ""); var xpath = XmlParse.GetStringNodeValue(tourInfoNode, "xpath", ""); IList<ITourInfoConverter> tourInfoPreConventersForAll = new List<ITourInfoConverter>(); var convertersForAll = XmlParse.GetStringListNodeValue(tourInfoNode, "allfields/preconverters/converter"); if (convertersForAll != null) { foreach (var converter in convertersForAll) { tourInfoPreConventersForAll.Add(new TourInfoConverter(converter)); } } IList<ITourInfoConverter> tourInfoPreHtmlConventersForAll = new List<ITourInfoConverter>(); convertersForAll = XmlParse.GetStringListNodeValue(tourInfoNode, "allfields/prehtmlconverters/converter"); if (convertersForAll != null) { foreach (var converter in convertersForAll) { tourInfoPreHtmlConventersForAll.Add(new TourInfoConverter(converter)); } } IList<ITourInfoConverter> tourInfoPostConventersForAll = new List<ITourInfoConverter>(); convertersForAll = XmlParse.GetStringListNodeValue(tourInfoNode, "allfields/postconverters/converter"); if (convertersForAll != null) { foreach (var converter in convertersForAll) { tourInfoPostConventersForAll.Add(new TourInfoConverter(converter)); } } IList<ITourInfoField> fields = new List<ITourInfoField>(); var fieldNodes = tourInfoNode.SelectNodes("fields/field"); if (fieldNodes != null) { foreach (var fieldNode in fieldNodes) { var field = new TourInfoField(); field.Name = XmlParse.GetStringNodeValue(fieldNode, "name", ""); field.XPath = XmlParse.GetStringNodeValue(fieldNode, "xpath", ""); field.Regex = XmlParse.GetStringNodeValue(fieldNode, "regex", ""); var preconverters = XmlParse.GetStringListNodeValue(fieldNode, "preconverters/converter"); var tourInfoPreConventers = new List<ITourInfoConverter>(); if (preconverters != null) { foreach (var converter in preconverters) { tourInfoPreConventers.Add(new TourInfoConverter(converter)); } } var preHtmlconverters = XmlParse.GetStringListNodeValue(fieldNode, "prehtmlconverters/converter"); var tourInfoPreHtmlConverters = new List<ITourInfoConverter>(); if (preHtmlconverters != null) { foreach (var converter in preHtmlconverters) { tourInfoPreHtmlConverters.Add(new TourInfoConverter(converter)); } } var postconverters = XmlParse.GetStringListNodeValue(fieldNode, "postconverters/converter"); var tourInfoPostConventers = new List<ITourInfoConverter>(); if (postconverters != null) { foreach (var converter in postconverters) { tourInfoPostConventers.Add(new TourInfoConverter(converter)); } } field.PreHtmlConverters = tourInfoPreHtmlConverters; field.PreConverters = tourInfoPreConventers; field.PostConverters = tourInfoPostConventers; fields.Add(field); } } tourInfo = new TourInfo() { Name = name, XPath = xpath, PreConvertersForAllFields = tourInfoPreConventersForAll, PreHtmlConvertersForAllFields=tourInfoPreHtmlConventersForAll, PostConvertersForAllFields = tourInfoPostConventersForAll, Fields = fields }; return true; }