protected virtual void PrintSchedule_button_Click(object sender, EventArgs e) { if (ScheduleSQL.SearchSchedule(this.teachingAssist.Id) == false) { MessageBox.Show("No schedule has been assigned yet."); } }
protected override void PrintSchedule_button_Click(object sender, EventArgs e) { if (ScheduleSQL.SearchSchedule(this.lecturer.Id) == false) { MessageBox.Show("No schedule has been assigned yet."); } }
private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { Time time = new Time(); Constant.Loader(this.resourceLoader.GetString("GlobalLoading"), true); param = JsonConvert.DeserializeObject <ScheduleSQL>(e.NavigationParameter.ToString()); this.DefaultViewModel["Direction"] = param.d_name; this.DefaultViewModel["Number"] = param.number; this.DefaultViewModel["Stop"] = param.s_name; this.DefaultViewModel["NextBus"] = param.next_bus; this.DefaultViewModel["BorderColor"] = Constant.TransportColors[param.type]; this.DefaultViewModel["Favorite"] = param.favorite ? Constant.FavoriteStar : Constant.UnFavoriteStar; await Task.Run(() => LoadRoutes(param)); Constant.Loader(this.resourceLoader.GetString("GlobalLoadingSuccess"), false); await Task.Run(async() => { while (true) { await Task.Delay(10000); this.DefaultViewModel["NextBus"] = time.getNextBusTime(param.schedule, param.days); } }); }
private async Task LoadRoutes(ScheduleSQL param) { Time time = new Time(); List <List <New_Goes.CommonAPI.Time.TimeView> > list = time.getScheduleList(param.width, param.days, param.schedule); await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { this.DefaultViewModel["Monday"] = list[0]; this.DefaultViewModel["Tuesday"] = list[1]; this.DefaultViewModel["Wednesday"] = list[2]; this.DefaultViewModel["Thursday"] = list[3]; this.DefaultViewModel["Friday"] = list[4]; this.DefaultViewModel["Saturday"] = list[5]; this.DefaultViewModel["Sunday"] = list[6]; selectedPivot = Time.getCurrentDaySchedule(param.schedule, param.days); if (list[0].Count == 0) { PivotMain.Items.RemoveAt(PivotMain.Items.IndexOf(PItemMonday)); } if (list[1].Count == 0) { PivotMain.Items.RemoveAt(PivotMain.Items.IndexOf(PItemTuesday)); } if (list[2].Count == 0) { PivotMain.Items.RemoveAt(PivotMain.Items.IndexOf(PItemWednesday)); } if (list[3].Count == 0) { PivotMain.Items.RemoveAt(PivotMain.Items.IndexOf(PItemThursday)); } if (list[4].Count == 0) { PivotMain.Items.RemoveAt(PivotMain.Items.IndexOf(PItemFriday)); } if (list[5].Count == 0) { PivotMain.Items.RemoveAt(PivotMain.Items.IndexOf(PItemSaturday)); } if (list[6].Count == 0) { PivotMain.Items.RemoveAt(PivotMain.Items.IndexOf(PItemSunday)); } PivotMain.SelectedIndex = selectedPivot; } ); }
public void CreateSchedule() { Schedule schedule; if (type == "Lecturer") { schedule = new Schedule(selectedLecturer.Id, selectedLecturer.FirstName, selectedLecturer.LastName, "Lecturer", selectedCourse.CourseID, assignedHours, selectedDay, selectedCourse.CourseName); } else { schedule = new Schedule(selectedTeachingAssist.Id, selectedTeachingAssist.FirstName, selectedTeachingAssist.LastName, "TeachingAssistant", selectedCourse.CourseID, assignedHours, selectedDay, selectedCourse.CourseName); } ScheduleSQL scheduleSQL = new ScheduleSQL(); scheduleSQL.SaveScheduleToSQL(schedule); this.Dispose(); }
private void ListView_ItemClick(object sender, ItemClickEventArgs e) { DirectionStopSQL paramItem = e.ClickedItem as DirectionStopSQL; ScheduleSQL mainSchedule = new ScheduleSQL() { favorite = (paramItem.favorite == Constant.FavoriteStar) ? true : false, type = param.type, width = param.width, days = paramItem.days, schedule = paramItem.schedule, number = param.number, d_name = param.name, s_name = paramItem.name, d_id = paramItem.d_id, r_id = paramItem.r_id, next_bus = paramItem.next_bus, n_id = paramItem.n_id }; if (!Frame.Navigate(typeof(Views.MainSchedule), JsonConvert.SerializeObject(mainSchedule))) { throw new Exception(this.resourceLoader.GetString("NavigationFailedExceptionMessage")); } }
public PrintSchedule_Form() { InitializeComponent(); ScheduleSQL.LoadSchedulesToListView(ref this.schedule_listView); }