Exemple #1
0
        private void ShowPatientView(object obj)
        {
            PatientViewModel patientViewModel = new PatientViewModel();
            IView            patientView      = new PatientWindow(patientViewModel);

            patientViewModel.settoClose(patientView);
            patientView.Show();
            viewtoClose.Close();
        }
Exemple #2
0
        private void ShowView(object obj)
        {
            IView            view;
            PatientViewModel vmodel = new PatientViewModel();

            view = new PatientWindow(vmodel);
            vmodel.settoClose(view);
            view.Show();
            viewToClose.Close();
        }
Exemple #3
0
        private void dataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            DataGridCellInfo cellInfo = dataGrid.CurrentCell;
            DataGridColumn   column   = cellInfo.Column;
            int    selectedColumn     = column.DisplayIndex;
            Action selectedAction     = (Action)dataGrid.SelectedItem;

            Operations ops = new Operations();

            Console.WriteLine(selectedColumn);

            if (selectedColumn == 1)
            {
                int userId = selectedAction.ActUser;

                foreach (User u in ops.GetUsers())
                {
                    if (u.ID == userId)
                    {
                        UserWindow window = new UserWindow(u);
                        window.Show();
                    }
                }
            }

            if (selectedColumn == 2)
            {
                int patientId = selectedAction.ActPatient;

                foreach (Patient p in ops.GetPatients())
                {
                    if (patientId == p.ID)
                    {
                        PatientWindow window = new PatientWindow(p);
                        window.Show();
                    }
                }
            }

            if (selectedColumn == 3)
            {
                int carId = selectedAction.ActCar;
                foreach (Car c in ServiceClass.Cars)
                {
                    if (c.ID == carId)
                    {
                        CarWindow window = new CarWindow(c);
                        window.Show();
                    }
                }
            }
        }
        private void ShowPatientView(object parameter)
        {
            IView            view      = null;
            PatientViewModel viewmodel = new PatientViewModel();

            view = new PatientWindow(viewmodel);

            viewmodel.settoClose(view);

            view.Show();

            viewtoClose.Close();
        }
Exemple #5
0
 private void ShowView(object obj)
 {
     if (AdminRights)
     {
         AdminViewModel adminViewModel = new AdminViewModel();
         IView          adminView      = new AdminWindow(adminViewModel);
         adminViewModel.settoClose(adminView);
         adminView.Show();
         viewToClose.Close();
     }
     if (PatientRights)
     {
         PatientViewModel patientViewModel = new PatientViewModel();
         IView            patientView      = new PatientWindow(patientViewModel);
         patientViewModel.settoClose(patientView);
         patientView.Show();
         viewToClose.Close();
     }
 }
        public void ShowView(object parameter)
        {
            if (AdminRights)
            {
                AdminViewModel adminViewModel = new AdminViewModel();
                IView          adminView      = new AdminWindow(adminViewModel);
                adminViewModel.settoClose(adminView);
                adminView.Show();
                toClose.Close();
            }

            else if (DoctorRights)
            {
                DoctorViewModel doctorViewModel = new DoctorViewModel();
                IView           doctorView      = new DoctorWindow(doctorViewModel);
                doctorViewModel.settoClose(doctorView);
                doctorView.Show();
                toClose.Close();
            }

            else if (PatientRights)
            {
                PatientViewModel patientViewModel = new PatientViewModel();
                IView            patientView      = new PatientWindow(patientViewModel);
                patientViewModel.settoClose(patientView);
                patientView.Show();
                toClose.Close();
            }

            else
            {
                IView authenticationWindow        = null;
                AuthenticationViewModel viewModel = new AuthenticationViewModel(new AuthenticationService());
                authenticationWindow = new AuthenticationWindow(viewModel);
                viewModel.settoClose(authenticationWindow);
                authenticationWindow.Show();
                toClose.Close();
            }
        }
        private void SaveExecute(object parametar)
        {
            var passwordBox = parametar as PasswordBox;
            var password    = passwordBox.Password;

            Patient.PatientPassword = password;
            try
            {
                if (service.AddPatient(Patient) != null)
                {
                    isUpdatePatient = true;

                    PatientWindow window = new PatientWindow(Patient);
                    window.Show();
                    addPatientWindow.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
        private void ShowView(object obj)
        {
            if (DoctorRights)
            {
                IView           view;
                DoctorViewModel vmodel = new DoctorViewModel();

                view = new DoctorWindow(vmodel);
                vmodel.settoClose(view);
                view.Show();
                viewToClose.Close();
            }
            else
            {
                IView            view;
                PatientViewModel vmodel = new PatientViewModel();

                view = new PatientWindow(vmodel);
                vmodel.settoClose(view);
                view.Show();
                viewToClose.Close();
            }
        }
Exemple #9
0
        private void LoginExecute(object parametar)
        {
            try
            {
                var         passwordBox = parametar as PasswordBox;
                var         password    = passwordBox.Password;
                ServiceCode service     = new ServiceCode();

                Doctor doctor = service.LoginDoctor(Username, password);
                if (doctor == null)
                {
                    Patient patient = service.LoginPatient(Username, password);

                    if (patient == null)
                    {
                        MessageBox.Show("Uneti korisnik ne postoji!");
                    }
                    else
                    {
                        PatientWindow patientWindow = new PatientWindow(patient);
                        patientWindow.Show();
                        main.Close();
                    }
                }
                else
                {
                    DoctorWindow window = new DoctorWindow(doctor);
                    window.Show();
                    main.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }