Beispiel #1
0
 public TodaysItems(Client clsClientIn)
 {
     clsDaysOpen     = new DaysOpen(CCFBGlobal.connectionString);
     clsServiceItems = new ServiceItems(CCFBGlobal.connectionString);
     clsClient       = clsClientIn;
     setForToday();
 }
 public Activity(string name, DateTime openingHour, DateTime closingHour, DaysOpen daysOpen,
                 int minParticipants, int maxParticipants, Price studentPrice, Price adultPrice,
                 string address, EnergyNeeded energyNeeded, string materialNeeded, Transport transport,
                 Duration duration, Temperature temperature, Category category)
 {
     Name = name;
     OpeningHour = openingHour;
     ClosingHour = closingHour;
     DaysOpen = daysOpen;
     MinimumParticipants = minParticipants;
     MaximumParticipants = maxParticipants;
     StudentPrice = studentPrice;
     AdultPrice = adultPrice;
     Address = address;
     EnergyNeeded = energyNeeded;
     MaterialNeeded = materialNeeded;
     Transport = transport;
     Duration = duration;
     Temperature = temperature;
     Category = category;
 }
Beispiel #3
0
 public ActivityData(string name, DateTime openingHour, DateTime closingHour, DaysOpen daysOpen,
                     int minParticipants, int maxParticipants, Price studentPrice, Price adultPrice,
                     string address, EnergyNeeded energyNeeded, string materialNeeded, Transport transport,
                     ActivityDuration duration, Temperature temperature, Category category)
 {
     Name                = name;
     OpeningHour         = openingHour;
     ClosingHour         = closingHour;
     DaysOpen            = daysOpen;
     MinimumParticipants = minParticipants;
     MaximumParticipants = maxParticipants;
     StudentPrice        = studentPrice;
     AdultPrice          = adultPrice;
     Address             = address;
     EnergyNeeded        = energyNeeded;
     MaterialNeeded      = materialNeeded;
     Transport           = transport;
     Duration            = duration;
     Temperature         = temperature;
     Category            = category;
 }
Beispiel #4
0
        public DayCareModel ExtractDayCareDetailList(string url)
        {
            var model = new DayCareModel();

            model.FacilityInformation = new FacilityInfo();
            model.DaysOpen            = new DaysOpen();
            model.LicenseeInformation = new LicenseeInfo();
            model.LicenseInformation  = new LicenseInfo();
            model.ServicesOffered     = new ServicesOffered();
            HtmlDocument       doc = web.Load(url);
            HtmlNodeCollection dayCareCenterNodes = doc.DocumentNode.SelectNodes("//div[@class='col-lg-6 profile']");

            foreach (HtmlNode table in dayCareCenterNodes)
            {
                var rows  = table.SelectNodes("tr");
                var title = rows[0].InnerHtml.Replace("\r", "").Replace(" ", "").Replace("\n", "");
                if (title.IndexOf("FacilityInformation") > 0)
                {
                    var facilityInformation = new FacilityInfo();
                    facilityInformation.Name = rows[1].SelectNodes("td")[1].FirstChild.InnerText;
                    var addressFont = rows[2].SelectNodes("td")[1].SelectNodes("font");


                    facilityInformation.Street = addressFont[0].InnerText.Replace("\r", "").Replace("\n", "").Replace(" ", "").Trim();

                    var address = addressFont[3].InnerText;
                    facilityInformation.City = address.Split(',')[0].Trim();
                    var stateAndZip = address.Split(',')[1].Replace(" ", ",");

                    facilityInformation.State   = stateAndZip.Split(',')[0].Trim();
                    facilityInformation.ZipCode = stateAndZip.Split(',')[1].Trim();
                    //if(facilityInformation.ZipCode.Length>5)
                    //{
                    //    facilityInformation.ZipCode = facilityInformation.ZipCode.Substring(0, 5);
                    //}
                    facilityInformation.ZipOrder = Convert.ToInt32(facilityInformation.ZipCode);

                    facilityInformation.County        = rows[3].SelectNodes("td")[1].SelectSingleNode("font").InnerText;
                    facilityInformation.Phone         = rows[4].SelectNodes("td")[1].SelectSingleNode("font").InnerText;
                    facilityInformation.LicenseStatus = rows[4].SelectNodes("td")[3].SelectSingleNode("font").InnerText;
                    facilityInformation.Status        = "";
                    model.FacilityInformation         = facilityInformation;
                }
                if (title.IndexOf("LicenseeInfo") > 0)
                {
                    var licenseeInfo = new LicenseeInfo();
                    licenseeInfo.Name         = rows[1].SelectNodes("td")[1].FirstChild.InnerText;
                    licenseeInfo.Address      = rows[2].SelectNodes("td")[1].FirstChild.InnerText.Replace(" ", "");
                    licenseeInfo.Phone        = rows[3].SelectNodes("td")[1].FirstChild.InnerText.Replace("\r", "").Replace("\n", "").TrimEnd().TrimStart();
                    model.LicenseeInformation = licenseeInfo;
                }

                if (title.IndexOf("LicenseInfo") > 0)
                {
                    var licenseInfo = new LicenseInfo();
                    licenseInfo.Number       = rows[2].SelectNodes("td")[0].SelectSingleNode("div").SelectSingleNode("font").InnerText;
                    licenseInfo.FacilityType = rows[2].SelectNodes("td")[1].SelectSingleNode("div").SelectSingleNode("font").InnerText.Replace("\r", "").Replace("\n", "").TrimEnd().TrimStart();
                    licenseInfo.Capacity     = rows[2].SelectNodes("td")[2].SelectSingleNode("div").SelectSingleNode("font").InnerText;

                    licenseInfo.EffectiveDate     = rows[2].SelectNodes("td")[3].SelectSingleNode("div").SelectSingleNode("font").InnerText;
                    licenseInfo.ExpirationDate    = rows[2].SelectNodes("td")[4].SelectSingleNode("div").SelectSingleNode("font").InnerText;
                    licenseInfo.PeriodOfOperation = rows[2].SelectNodes("td")[5].SelectSingleNode("div").SelectSingleNode("font").InnerText;
                    model.LicenseInformation      = licenseInfo;
                }
                if (title.IndexOf("DaysOpen") > 0)
                {
                    var daysOpen = new DaysOpen();
                    daysOpen.Sunday    = rows[2].SelectNodes("td")[0].SelectSingleNode("div").SelectSingleNode("font").InnerText;
                    daysOpen.Monday    = rows[2].SelectNodes("td")[1].SelectSingleNode("div").SelectSingleNode("font").InnerText;
                    daysOpen.Tuesday   = rows[2].SelectNodes("td")[2].SelectSingleNode("div").SelectSingleNode("font").InnerText;
                    daysOpen.Wednesday = rows[2].SelectNodes("td")[3].SelectSingleNode("div").SelectSingleNode("font").InnerText;
                    daysOpen.Thursday  = rows[2].SelectNodes("td")[4].SelectSingleNode("div").SelectSingleNode("font").InnerText;
                    daysOpen.Friday    = rows[2].SelectNodes("td")[5].SelectSingleNode("div").SelectSingleNode("font").InnerText;
                    daysOpen.Saturday  = rows[2].SelectNodes("td")[6].SelectSingleNode("div").SelectSingleNode("font").InnerText;
                    model.DaysOpen     = daysOpen;
                }
                if (title.IndexOf("ServicesOffered") > 0)
                {
                    var servicesOffered = new ServicesOffered();
                    servicesOffered.FullDayProgram = rows[1].SelectNodes("td")[1].SelectSingleNode("font").InnerText;
                    servicesOffered.Provides       = rows[2].SelectNodes("td")[1].SelectSingleNode("font").InnerText.Replace("\r", "").Replace("\n", "").TrimEnd().TrimStart();
                    model.ServicesOffered          = servicesOffered;
                }
            }
            return(model);
        }