示例#1
0
        private bool ResetPassword()
        {
            if (CurrentTeacherData.Teacher_ID < 1)
            {
                return(false);
            }

            TeacherModel teacher = _teacherDatabase.Find(CurrentTeacherData.Teacher_ID);

            if (teacher == null)
            {
                return(false);
            }

            teacher.Password = string.Empty;

            return(_teacherDatabase.Update(teacher));
        }
示例#2
0
        private void SelectTeacher(int teacher_ID)
        {
            //Check Selected Item
            if (teacher_ID == TeacherDataView.CurrentTeacherData.Teacher_ID)
            {
                return;
            }

            //Get Teacher Data From Database
            TeacherModel teacher = _teacherDatabase.Find(teacher_ID);

            //Check teacher value is not null
            if (teacher == null)
            {
                return;
            }

            //Assign to Current teacher data
            TeacherDataView.CurrentTeacherData = new TeacherViewDataViewModel(teacher);

            //Set All List to Unselected
            foreach (var i in TeacherList)
            {
                if (i.Teacher.Teacher_ID == teacher_ID)
                {
                    i.IsSelected = true;
                }
                else
                {
                    i.IsSelected = false;
                }
            }

            //Open Teacher Data View
            CurrentTeacherPanelView = TeacherDataView;

            //Notify the Is Teacher Selected Property
            OnPropertyChanged(nameof(IsTeacherSelected));
        }
示例#3
0
文件: Program.cs 项目: HYMPYT/BD_ZU
        static void Main(string[] args)
        {
            Console.BackgroundColor = ConsoleColor.White;
            Console.ForegroundColor = ConsoleColor.Black;

            int table  = 0;
            int action = 0;

            do
            {
                table = FirstMenu();
                if (table == 0)
                {
                    return;
                }

                BaseController controller = null;

                switch (table)
                {
                case 1:
                    action     = SecondMenu("Faculty");
                    controller = new FacultyController();
                    break;

                case 2:
                    action     = SecondMenu("Group");
                    controller = new GroupController();
                    break;

                case 3:
                    action     = SecondMenu("Lectures");
                    controller = new LecturesPlanController();
                    break;

                case 4:
                    action     = SecondMenu("Student");
                    controller = new StudentController();
                    break;

                case 5:
                    action     = SecondMenu("Subject");
                    controller = new SubjectController();
                    break;

                case 6:
                    action     = SecondMenu("Teacher");
                    controller = new TeacherController();
                    break;
                }


                switch (action)
                {
                case 1:
                    controller.Create();
                    break;

                case 2:
                    controller.Read();
                    break;

                case 3:
                    controller.Update();
                    break;

                case 4:
                    controller.Delete();
                    break;

                case 5:
                    controller.Find();
                    break;
                }
            } while (true);
        }