public SMA_add(int mode) { InitializeComponent(); this.mode = mode; if (mode == 1) { Degree_label.Visibility = Visibility.Hidden; Degree_choose.Visibility = Visibility.Hidden; Sem_label.Visibility = Visibility.Hidden; Sem_choose.Visibility = Visibility.Hidden; } else if (mode == 2) { Sem_label.Visibility = Visibility.Hidden; Sem_choose.Visibility = Visibility.Hidden; } else if (mode == 3) { Degree_label.Visibility = Visibility.Hidden; Degree_choose.Visibility = Visibility.Hidden; } List <Tuple <int, string, string> > semsetrInfoList = new List <Tuple <int, string, string> >(); IQueryable <SemsestrInfo> stb = MenuLecturerLogic.getSemestrInfo(); stb.ToList(); foreach (var rec in stb) { semsetrInfoList.Add(Tuple.Create(rec.semestrid, rec.fieldofstudy.Trim(), rec.yearofstudy)); } Sem_choose.ItemsSource = semsetrInfoList; ObservableCollection <string> list = new ObservableCollection <string>(); list.Add("Inż"); list.Add("Mgr."); list.Add("Dr."); list.Add("Prof"); Degree_choose.ItemsSource = list; }
public SelectionMenuLecturer(Lecturer lecturer) { InitializeComponent(); List <Tuple <int, string, string> > semsetrInfoList = new List <Tuple <int, string, string> >(); IQueryable <SemsestrInfo> stb = MenuLecturerLogic.getSemestrInfo(); stb.ToList(); foreach (var rec in stb) { semsetrInfoList.Add(Tuple.Create(rec.semestrid, rec.fieldofstudy.Trim(), rec.yearofstudy)); } fieldofstudybox.ItemsSource = semsetrInfoList; /* this.lecturer = new Lecturer(); * this.lecturer.ID_lecturer = lecturer.ID_lecturer; * this.lecturer.Name = lecturer.Name; * this.lecturer.Surname = lecturer.Surname; * this.lecturer.Degree = lecturer.Degree; */ this.lecturer = lecturer; }