protected override void OnNavigatedTo(NavigationEventArgs e) { if (e.Parameter != null && e.Parameter.GetType() == typeof(Teacher)) { teacherInstance = (Teacher)e.Parameter; textBoxDegree.Text = teacherInstance.degree; textBoxName.Text = teacherInstance.name; textBoxSurname.Text = teacherInstance.surname; textBoxEmail.Text = teacherInstance.email; textBoxPhone.Text = teacherInstance.phone; buttonDelete.Visibility = Visibility.Visible; } }
public ClassInstance(Class classData, ClassType classType, TimeSpan from, TimeSpan to, string room, WeekDay day, WeekType weekType, Teacher teacher, string uid = "") { this.classData = classData; this.classType = classType; this.from = from; this.to = to; this.room = room; this.weekDay = day; this.weekType = weekType; this.teacher = teacher; if (string.IsNullOrWhiteSpace(uid)) this.uid = Guid.NewGuid().ToString(); else this.uid = uid; }
public static void AddTeacher(Teacher teacher) { teachers.Add(teacher); dataStore.Save(); }
public static void DeleteTeacher(Teacher teacher) { dataStore.teachers.Remove(teacher); dataStore.Save(); }