예제 #1
0
        public void Execute(object parameter)
        {
            List <Student> Students = new List <Student>()
            {
                new Student()
                {
                    Id      = Guid.NewGuid(),
                    Name    = "Anar",
                    Surname = "Ehmedov",
                    Age     = 20
                },
                new Student()
                {
                    Id      = Guid.NewGuid(),
                    Name    = "Anar",
                    Surname = "Ehmedov",
                    Age     = 20
                },
                new Student()
                {
                    Id      = Guid.NewGuid(),
                    Name    = "Anar",
                    Surname = "Ehmedov",
                    Age     = 20
                },
            };
            StudentViewModel studentViewModel = new StudentViewModel();

            studentViewModel.AllStudent = Students;
            StudentWindow studentWindow = new StudentWindow(studentViewModel);

            studentWindow.ShowDialog();
        }
        void ViewStudents(object obj)
        {
            UIClass classModel = obj as UIClass;

            StudentWindow window = new StudentWindow(classModel);

            window.ShowDialog();
        }
        private void AboutMethod(object param)
        {
            int secondsRemaining = (deadline - DateTime.Now).Seconds;

            StopTimer();
            StudentWindow studentWindow = new StudentWindow();

            studentWindow.ShowDialog();
            StartTimer(secondsRemaining);
        }
예제 #4
0
        private void ClickAdd(object sender, RoutedEventArgs e)
        {
            StudentWindow studentWindow = new StudentWindow
            {
                Owner = ((MainWindow)Application.Current.MainWindow)
            };

            if (true == studentWindow.ShowDialog())
            {
                this.fetchData();
            }
        }
예제 #5
0
 private void ClickEdit(object sender, RoutedEventArgs e)
 {
     if (StudentListBox.SelectedItem != null)
     {
         StudentWindow studentWindow = new StudentWindow((Models.Student)StudentListBox.SelectedItem)
         {
             Owner = ((MainWindow)Application.Current.MainWindow)
         };
         if (true == studentWindow.ShowDialog())
         {
             this.fetchData();
         }
     }
 }
        private void MainLoop()
        {
            while (true)
            {
                Auth        auth;
                LoginWindow loginWindow = new LoginWindow();
                loginWindow.ShowDialog();
                Console.WriteLine(loginWindow.DialogResult);
                if (loginWindow.DialogResult == true)
                {
                    auth = loginWindow.Tag as Auth;
                    if (auth.Permission == "student")
                    {
                        StudentWindow studentWindow = new StudentWindow(auth);
                        studentWindow.ShowDialog();
                        Console.WriteLine(studentWindow.DialogResult);
                        if (studentWindow.DialogResult == true)
                        {
                            continue;
                        }
                        else
                        {
                            break;
                        }
                    }
                    else if (auth.Permission == "staff")
                    {
                        StaffWindow staffWindow = new StaffWindow(auth);
                        staffWindow.ShowDialog();
                        Console.WriteLine(staffWindow.DialogResult);
                        if (staffWindow.DialogResult == true)
                        {
                            continue;
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                else
                {
                    break;
                }
            }

            Environment.Exit(0);
        }