private void GetExistingCalendar() { int Id = Convert.ToInt32(Request.QueryString["Id"]); List <DayLocation> daysList = new List <DayLocation>(); daysList = DayDAO.GetAllDayLocationByItinerary(Id); /*List<string> locationList = new List<string>(); //list for passing to asp label * foreach (var i in daysList) * { * locationList.Add(i.locaName.ToString()); * locationList.Add(i.locaOpenHour.ToString()); * locationList.Add(i.locaCloseHour.ToString()); * }*/ foreach (var i in daysList) { location += i.locaName + ","; location += i.date.ToString("dd MMM") + ","; location += i.startTime.ToString("HHmm") + ","; location += i.endTime.ToString("HHmm") + ","; location += i.locationId; location += "|"; } lbLocation.Text = location; }
private void GeneratePlanner(Itinerary newItinerary) { if (Session["prefB"] == null && //if no select pref Session["prefO"] == null && Session["prefM"] == null && Session["prefH"] == null && Session["prefS"] == null && Session["prefW"] == null) { DayDAO.AddDay(newItinerary); } }
protected void rpChildDayLocation_DataBinding(object sender, EventArgs e) { Repeater rep = (Repeater)(sender); int daybydayId = (int)(Eval("dayByDayId")); //retrieve location from Days table List <DayLocation> daysList = new List <DayLocation>(); daysList = DayDAO.GetAllDayLocation(daybydayId); rep.DataSource = daysList; }
//public void AddDay() //{ // DayDAO.AddDay(this); //} public static void UpdateDay(int dayId, string notes) { DayDAO.UpdateDay(dayId, notes); }
public static List <DayLocation> GetDayAllDayLocation(int daybydayId) { return(DayDAO.GetAllDayLocation(daybydayId)); }
protected void Page_Load(object sender, EventArgs e) { int Id = Convert.ToInt32(Request.QueryString["Id"]); //lbPlannerName.Text = Session["itineraryName"].ToString(); DayByDay getByTag = new DayByDay(); List <DayByDay> daybydayList = new List <DayByDay>(); daybydayList = getByTag.RetrieveByItinerary(Id); //rpDates.DataSource = daybydayList; //rpDates.DataBind(); List <Idk> idkList = new List <Idk>(); foreach (DayByDay dayByDay in daybydayList) { Idk oneDay = new Idk(); oneDay.dayByDayId = dayByDay.dayBydayId; oneDay.date = dayByDay.date; List <Location> locations = new List <Location>(); foreach (DayLocation day in Day.GetDayAllDayLocation(dayByDay.dayBydayId)) { Location location = new Location(); location.locaLatitude = day.locaLatitude; location.locaLongitude = day.locaLongitude; locations.Add(location); } oneDay.locations = JsonConvert.SerializeObject(locations); idkList.Add(oneDay); } rpDates.DataSource = idkList; rpDates.DataBind(); string url = HttpContext.Current.Request.Url.AbsoluteUri; try { //have to get daybydayId thru href; int daybydayId = int.Parse(Request.QueryString["daybydayId"]); daysList = DayDAO.GetAllDayLocation(daybydayId); var date = ""; var count = 0; foreach (var i in daysList) { count += 1; if (count == 1) { url += "?lat=" + count + i.locaLatitude + "?lon=" + count + i.locaLongitude; } else if (i.date.ToString() == date) { url += "?lat=" + count + i.locaLatitude + "?lon=" + count + i.locaLongitude; } else { date = i.date.ToString(); url += "?date=" + date + "?lat=" + count + i.locaLatitude + "?lon=" + count + i.locaLongitude; } } //rptLocationScript.DataSource = daysList; //rptLocationScript.DataBind(); } catch { } }
public static void DeletePlanner(int itineraryId) { DayDAO.DeleteDay(itineraryId); DayByDayDAO.DeleteDayByDay(itineraryId); ItineraryDAO.DeleteItinerary(itineraryId); }