public MainWindowVM(bool admin, int teachid) { _isAdmin = admin; TeachID = teachid; if (admin) { LoggedIn = "Admin"; forA = Visibility.Visible; forT = Visibility.Collapsed; } else { forT = Visibility.Visible; forA = Visibility.Collapsed; using (_ujc = new Model.UniversityEntities()) { var _tmpteach = _ujc.University_Teacher.Where(t => t.Teacher_ID == TeachID).FirstOrDefault(); LoggedIn = _tmpteach.First_Name + " " + _tmpteach.Last_Name; } } _schdVM = new ScheduleVM() { TabName = "Schedule", Vis = forA }; _gvm = new GroupVM() { TabName = "Groups", Vis = forA }; _teacVM = new TeacherVM() { TabName = "Teachers", Vis = forA }; _subjvm = new SubjectVM() { TabName = "Subjects", Vis = forA }; _studvm = new StudentVM() { TabName = "Students", Vis = forA }; _teachIntVM = new TeacherInterfaceVM(TeachID) { TabName = "", TeacherID = TeachID, Vis = forT }; if (!_isAdmin) SelectIndex = 5; }
public MainWindowVM(bool admin, int teachid) { _isAdmin = admin; TeachID = teachid; if (admin) { LoggedIn = "Admin"; forA = Visibility.Visible; forT = Visibility.Collapsed; } else { forT = Visibility.Visible; forA = Visibility.Collapsed; using (_ujc = new Model.UniversityEntities()) { var _tmpteach = _ujc.University_Teacher.Where(t => t.Teacher_ID == TeachID).FirstOrDefault(); LoggedIn = _tmpteach.First_Name + " " + _tmpteach.Last_Name; } } _schdVM = new ScheduleVM() { TabName = "Schedule", Vis = forA }; _gvm = new GroupVM() { TabName = "Groups", Vis = forA }; _teacVM = new TeacherVM() { TabName = "Teachers", Vis = forA }; _subjvm = new SubjectVM() { TabName = "Subjects", Vis = forA }; _studvm = new StudentVM() { TabName = "Students", Vis = forA }; _teachIntVM = new TeacherInterfaceVM(TeachID) { TabName = "", TeacherID = TeachID, Vis = forT }; if (!_isAdmin) { SelectIndex = 5; } }