protected override void OnNavigatedTo(NavigationEventArgs e) { Sqlite sqlData = new Sqlite(); var plan = (Plans)e.Parameter; Days d; //startDate.Text = "From " + plan.StartDate.Date.ToString("d", DateTimeFormatInfo.InvariantInfo) + " To " + plan.EndDate.Date.ToString("d", DateTimeFormatInfo.InvariantInfo); startDate.Text = "From " + plan.StartDate.ToString("dd/MM/yyyy") + " To " + plan.EndDate.ToString("dd/MM/yyyy"); location.Text = "in " + plan.Location; maxDay.Text = plan.MaxDay.ToString(); if (plan.MaxDay == 0) { addNewEvent.IsEnabled = false; } //DaysList = DayList.getDayList(plan.StartDate, plan.EndDate); // Initialize date instance var queryDay = from pd in sqlData.conn.Table<Days>() where pd.PlanID_FK.Equals(plan.PlanID) select pd; // create date if there is no date if (queryDay.Count<Days>() == 0) { for (int i = 1; i <= Convert.ToInt16(maxDay.Text); i++) { d = new Days(plan.PlanID, "No Activities on this day!", "Day " + i.ToString()); sqlData.conn.Insert(d); } } DaysList = DayList.getDayList(plan); }
private void addNewEvent_Click(object sender, RoutedEventArgs e) { Days day = new Days("", "Add New Day"); Frame.Navigate(typeof(DayEvents),day); }
protected override void OnNavigatedTo(NavigationEventArgs e) { var day = (Days)e.Parameter; pageTitle.Text = day.DayNo; selectedDay = day; }