private void AddObservation()
        {
            ServiceObservation.ServiceObservationClient client = new ServiceObservation.ServiceObservationClient();
            ServiceObservation.Observation obs = new ServiceObservation.Observation();
            obs.BloodPressure = BloodPressure;
            obs.Comment       = Comment;
            obs.Prescription  = Prescriptions.ToArray();
            obs.Weight        = Weight;
            obs.Pictures      = ConverttobyteArray().ToArray();
            obs.Date          = Date;

            try
            {
                client.AddObservation(Patient.Id, obs);

                View.MainWindow     mainwindow       = (View.MainWindow)Application.Current.MainWindow;
                View.NewObservation view             = new colle_tMedecine.View.NewObservation();
                ViewModel.NewObservationViewModel vm = new colle_tMedecine.ViewModel.NewObservationViewModel(Patient);
                view.DataContext = vm;
                mainwindow.contentcontrol.Content = view;
            }
            catch
            {
                View.MainWindow     mainwindow       = (View.MainWindow)Application.Current.MainWindow;
                View.NewObservation view             = new colle_tMedecine.View.NewObservation();
                ViewModel.NewObservationViewModel vm = new colle_tMedecine.ViewModel.NewObservationViewModel(Patient);
                view.DataContext = vm;
                mainwindow.contentcontrol.Content = view;
            }
        }
Ejemplo n.º 2
0
        public void navigate(UserControl fromView, UserControl destView)
        {
            ViewStack.Add((UserControl)fromView);
            View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow;
            string          destType   = destView.GetType().Name;

            if (destType == "Patients")
            {
                mainwindow.patient_nav_item.Style = (Style)Application.Current.FindResource("ActiveMenuButton");
            }
            else
            {
                mainwindow.patient_nav_item.Style = (Style)Application.Current.FindResource("MenuButton");
            }
            if (destType == "Personnel")
            {
                mainwindow.personnel_nav_item.Style = (Style)Application.Current.FindResource("ActiveMenuButton");
            }
            else
            {
                mainwindow.personnel_nav_item.Style = (Style)Application.Current.FindResource("MenuButton");
            }
            FadeOut = true;
            mainwindow.contentcontrol.Content = destView;
            FadeOut = false;
        }
Ejemplo n.º 3
0
        public Fiche_PatientViewModel(Model.Patient patient)
        {
            _liveActionCommand = new RelayCommand(LiveAction);
            _addObservation    = new RelayCommand(param => AddObs(), param => true);
            Patient            = patient;
            if (Patient.Obs != null && Patient.Obs.Count() > 0)
            {
                SelectedObservation = Patient.Obs.ElementAt(0);
            }
            else
            {
                SelectedObservation = null;
            }
            View.MainWindow mainwindow  = (View.MainWindow)Application.Current.MainWindow;
            object          datacontext = mainwindow.DataContext;

            ViewModel.MainWindow main = (ViewModel.MainWindow)datacontext;
            if (main.ConnectedUser.Role.Equals("Medecin"))
            {
                this._isAdmin = true;
            }
            else
            {
                this._isAdmin = false;
            }
            ListImages = null;
        }
Ejemplo n.º 4
0
 private void backView()
 {
     if (ViewStack.Count > 0)
     {
         View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow;
         UserControl     last_view  = ViewStack.Last <UserControl>();
         string          destType   = last_view.GetType().Name;
         if (destType == "Patients")
         {
             mainwindow.patient_nav_item.Style = (Style)Application.Current.FindResource("ActiveMenuButton");
         }
         else
         {
             mainwindow.patient_nav_item.Style = (Style)Application.Current.FindResource("MenuButton");
         }
         if (destType == "Personnel")
         {
             mainwindow.personnel_nav_item.Style = (Style)Application.Current.FindResource("ActiveMenuButton");
         }
         else
         {
             mainwindow.personnel_nav_item.Style = (Style)Application.Current.FindResource("MenuButton");
         }
         ViewStack.RemoveAt(ViewStack.Count - 1);
         FadeOut = true;
         mainwindow.contentcontrol.Content = last_view;
         FadeOut = false;
     }
 }
Ejemplo n.º 5
0
        private void Connecting()
        {
            bool isValid = false;

            //Call service

            if (!string.IsNullOrEmpty(LoginInput) && !string.IsNullOrEmpty(PasswordInput))
            {
                ServiceUser.ServiceUserClient clientService = new ServiceUser.ServiceUserClient();
                try
                {
                    isValid = clientService.Connect(_loginInput, _passwordInput);
                    if (isValid)
                    {
                        ServiceUser.User user = new ServiceUser.User();
                        user = clientService.GetUser(this._loginInput);
                        View.MainWindow      mainwindow   = (View.MainWindow)Application.Current.MainWindow;
                        ViewModel.MainWindow mainwindowVM = (ViewModel.MainWindow)mainwindow.DataContext;
                        mainwindowVM.MenuIsActive  = true;
                        mainwindowVM.FadeOut       = false;
                        mainwindowVM.ConnectedUser = new Model.User
                        {
                            Firstname     = user.Firstname,
                            Name          = user.Firstname,
                            Login         = user.Login,
                            Password      = user.Pwd,
                            Pic           = user.Picture,
                            Role          = user.Role,
                            Connected     = true,
                            Co            = true,
                            ExtensionData = user.ExtensionData
                        };
                        mainwindowVM.UserIdentity = user.Name + " " + user.Firstname;
                        View.Patients view             = new View.Patients();
                        ViewModel.PatientsViewModel vm = new colle_tMedecine.ViewModel.PatientsViewModel();
                        view.DataContext = vm;
                        mainwindow.contentcontrol.Content = view;
                    }
                    else
                    {
                        ErrorMessage     = "Identifiant ou mot de passe incorrect";
                        ShowConnectError = 1;
                        ShowConnectError = 0;
                    }
                }
                catch (Exception e)
                {
                    ErrorMessage     = "La connexion a échouée, réessayez plus tard";
                    ShowConnectError = 1;
                    ShowConnectError = 0;
                }
            }
            else
            {
                ErrorMessage     = "Identifiant ou mot de passe manquant";
                ShowConnectError = 1;
                ShowConnectError = 0;
            }
        }
Ejemplo n.º 6
0
        public void FillListPatient()
        {
            ServicePatient.ServicePatientClient service = new ServicePatient.ServicePatientClient();
            try
            {
                ServicePatient.Patient[] listPatient = service.GetListPatient();
                this._allPatient = new List <Model.Patient>();
                List <Model.Observation> listObs = new List <Model.Observation>();

                foreach (ServicePatient.Patient pat in listPatient)
                {
                    Model.Patient patient = new Model.Patient
                    {
                        Birth     = pat.Birthday,
                        Firstname = pat.Firstname,
                        Name      = pat.Name,
                        Id        = pat.Id
                    };

                    if (pat.Observations != null)
                    {
                        foreach (ServicePatient.Observation obs in pat.Observations)
                        {
                            Model.Observation observation = new Model.Observation
                            {
                                Comments      = obs.Comment,
                                Date          = obs.Date,
                                Pic           = obs.Pictures ?? new List <byte[]>().ToArray(),
                                Prescriptions = obs.Prescription.ToList() ?? new List <string>(),
                                Pressure      = obs.BloodPressure,
                                Weight        = obs.Weight
                            };
                            listObs.Add(observation);
                        }
                        patient.Obs = listObs;
                    }

                    patient.Name      = FirstUpper(patient.Name);
                    patient.Firstname = FirstUpper(patient.Firstname);
                    patient.Birthday  = pat.Birthday.ToString("dd/MM/yyyy");

                    this._allPatient.Add(patient);
                }
                ListPatient = new ObservableCollection <Model.Patient>(this._allPatient);
            }
            catch
            {
                MainWindow      main       = new MainWindow();
                View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow;

                View.Patients view             = new colle_tMedecine.View.Patients();
                ViewModel.PatientsViewModel vm = new colle_tMedecine.ViewModel.PatientsViewModel();
                view.DataContext = vm;

                main.navigate((UserControl)mainwindow.contentcontrol.Content, view);
            }
        }
Ejemplo n.º 7
0
        private void showPatients()
        {
            View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow.DataContext;

            View.Patients view             = new colle_tMedecine.View.Patients();
            ViewModel.PatientsViewModel vm = new colle_tMedecine.ViewModel.PatientsViewModel();
            view.DataContext = vm;
            mainwindow.contentcontrol.Content = view;
        }
Ejemplo n.º 8
0
        private void showUsers()
        {
            View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow;

            View.Personnel view             = new colle_tMedecine.View.Personnel();
            ViewModel.PersonnelViewModel vm = new colle_tMedecine.ViewModel.PersonnelViewModel();
            view.DataContext = vm;
            navigate((UserControl)mainwindow.contentcontrol.Content, view);
        }
Ejemplo n.º 9
0
 private void LiveAction(object param)
 {
     View.MainWindow      mainwindow   = (View.MainWindow)Application.Current.MainWindow;
     ViewModel.MainWindow mainwindowVM = (ViewModel.MainWindow)mainwindow.DataContext;
     mainwindowVM.ViewStack.Add((UserControl)mainwindow.contentcontrol.Content);
     View.LiveChartsWindow         view = new View.LiveChartsWindow();
     ViewModel.LiveChartsViewModel vm   = new LiveChartsViewModel();
     view.DataContext = vm;
     mainwindow.contentcontrol.Content = view;
 }
Ejemplo n.º 10
0
        public void Execute(object parameter)
        {
            First first = new First();

            View.Home home = new View.Home();
            first.Show();
            //음... 안닫히네
            View.MainWindow mainWindow = new View.MainWindow();
            mainWindow.Close();
            first.pageControl.NavigationService.Navigate(home);
        }
Ejemplo n.º 11
0
        public void ShowNewUser()
        {
            View.MainWindow      mainwindow   = (View.MainWindow)Application.Current.MainWindow;
            ViewModel.MainWindow mainwindowVM = (ViewModel.MainWindow)mainwindow.DataContext;

            View.Nouveau_Personnel view             = new colle_tMedecine.View.Nouveau_Personnel();
            ViewModel.Nouveau_PersonnelViewModel vm = new colle_tMedecine.ViewModel.Nouveau_PersonnelViewModel();
            view.DataContext = vm;

            mainwindowVM.navigate((UserControl)mainwindow.contentcontrol.Content, view);
        }
Ejemplo n.º 12
0
        private void AddObs()
        {
            View.MainWindow      mainwindow   = (View.MainWindow)Application.Current.MainWindow;
            ViewModel.MainWindow mainwindowVM = (ViewModel.MainWindow)mainwindow.DataContext;

            View.NewObservation view             = new colle_tMedecine.View.NewObservation();
            ViewModel.NewObservationViewModel vm = new colle_tMedecine.ViewModel.NewObservationViewModel(Patient);
            view.DataContext = vm;

            mainwindowVM.navigate((UserControl)mainwindow.contentcontrol.Content, view);
        }
Ejemplo n.º 13
0
        public void Execute(object parameter)
        {
            _driverService = ChromeDriverService.CreateDefaultService();
            _driverService.HideCommandPromptWindow = true;
            _options = new ChromeOptions();
            _options.AddArgument("headless");
            _options.AddArgument("disable-gpu");
            _driver = new ChromeDriver(_driverService, _options);

            _driver.Navigate().GoToUrl("https://ieilms.jbnu.ac.kr/");             // 웹 사이트에 접속합니다.

            _driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);

            var parameters = (object[])parameter;

            IWebElement element;

            try
            {
                element = _driver.FindElementByXPath("//*[@id='id']");
                element.SendKeys((string)parameters[0]);
                VM.mainWindowIDInformation.LoginID = ((string)parameters[0]);

                element = _driver.FindElementByXPath("//*[@id='passwd']");
                element.SendKeys((string)parameters[1]);
                VM.mainWindowIDInformation.LoginPasswd = ((string)parameters[1]);

                element = _driver.FindElementByXPath("//*[@id='loginform']/table/tbody/tr[1]/td[2]/input");
                element.Click();

                element = _driver.FindElementByXPath("//*[@id='nav']/li[10]/a");
                element.Click();


                First     first = new First();
                View.Home home  = new View.Home();
                first.Show();
                //음... 안닫히네
                View.MainWindow mainWindow = new View.MainWindow();
                // 교수님 코드 VM.mainWindowRef.Close();
                first.pageControl.NavigationService.Navigate(home);



                _driver.Close();
            }
            catch (Exception)
            {
                MessageBox.Show("ID,PW를 확인해주세요.");
                return;
            }
        }
Ejemplo n.º 14
0
        public void ShowPatientSheet(object param)
        {
            View.MainWindow      mainwindow   = (View.MainWindow)Application.Current.MainWindow;
            ViewModel.MainWindow mainwindowVM = (ViewModel.MainWindow)mainwindow.DataContext;

            Model.Patient pat = (Model.Patient)param;

            View.Fiche_Patient view = new colle_tMedecine.View.Fiche_Patient();

            ViewModel.Fiche_PatientViewModel vm = new colle_tMedecine.ViewModel.Fiche_PatientViewModel(pat);
            view.DataContext = vm;

            mainwindowVM.navigate((UserControl)mainwindow.contentcontrol.Content, view);
        }
Ejemplo n.º 15
0
        private void NewDistributionTarget_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new StringQueryDialog("Enter Target name:")
            {
                Owner = this
            };

            if (dialog.ShowDialog() == true)
            {
                String          name       = dialog.QueryString;
                View.MainWindow mainWindow = (View.MainWindow)System.Windows.Application.Current.MainWindow;
                if (mainWindow != null)
                {
                    mainWindow.ViewModel.DistributionTargetMap.Add(name, "");
                }
            }
        }
Ejemplo n.º 16
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            Views.MenuView          menu   = new Views.MenuView();
            ViewModel.MenuViewModel menuVM = new ViewModel.MenuViewModel();
            menuVM.NewGameEvent  += new EventHandler(Menu_New);
            menuVM.LoadGameEvent += new EventHandler(Menu_Load);
            menuVM.QuitGameEvent += new EventHandler(Menu_Quit);
            menu.DataContext      = menuVM;

            _mainViewModel = new ViewModel.MainViewModel(menu);
            _mainWindow    = new View.MainWindow();

            _mainWindow.DataContext = _mainViewModel;
            _mainWindow.Show();
        }
Ejemplo n.º 17
0
        private void addPatient()
        {
            if (!string.IsNullOrEmpty(FirstnameInput) && !string.IsNullOrEmpty(NameInput) && !string.IsNullOrEmpty(DateInput.ToString()))
            {
                Patient patient = new Patient();
                patient.Birthday     = _dateInput ?? DateTime.Now;
                patient.Firstname    = _firstnameInput;
                patient.Name         = _nameInput;
                patient.Observations = null;

                ServicePatientClient service = new ServicePatientClient();

                if (service.AddPatient(patient))
                {
                    View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow;

                    View.Patients view             = new colle_tMedecine.View.Patients();
                    ViewModel.PatientsViewModel vm = new colle_tMedecine.ViewModel.PatientsViewModel();
                    view.DataContext = vm;
                    mainwindow.contentcontrol.Content = view;
                }
            }
            else
            {
                if (string.IsNullOrEmpty(FirstnameInput) && !string.IsNullOrEmpty(NameInput) && !string.IsNullOrEmpty(DateInput.ToString()))
                {
                    ErrorMessage = _typeErrorMessage[0];
                }
                else if (!string.IsNullOrEmpty(FirstnameInput) && string.IsNullOrEmpty(NameInput) && !string.IsNullOrEmpty(DateInput.ToString()))
                {
                    ErrorMessage = _typeErrorMessage[1];
                }
                else if (!string.IsNullOrEmpty(FirstnameInput) && !string.IsNullOrEmpty(NameInput) && string.IsNullOrEmpty(DateInput.ToString()))
                {
                    ErrorMessage = _typeErrorMessage[2];
                }
                else
                {
                    ErrorMessage = _typeErrorMessage[3];
                }
                ShowConnectError = 1;
                ShowConnectError = 0;
            }
        }
        private void addUser()
        {
            if (!string.IsNullOrEmpty(FirstnameInput) && !string.IsNullOrEmpty(NameInput) &&
                !string.IsNullOrEmpty(RoleInput) && !string.IsNullOrEmpty(LoginInput) &&
                !string.IsNullOrEmpty(PasswordInput) && !string.IsNullOrEmpty(PasswordConfirmInput))
            {
                if (string.Compare(PasswordInput, PasswordConfirmInput) == 0)
                {
                    ServiceUserClient service = new ServiceUserClient();
                    User     new_user         = new User();
                    string[] roleTab          = this._roleInput.Split(' ');

                    new_user.Connected = false;
                    new_user.Firstname = _firstNameInput;
                    new_user.Name      = _nameInput;
                    new_user.Role      = roleTab[roleTab.Length - 1];
                    new_user.Pwd       = _passwordInput;
                    new_user.Login     = _loginInput;
                    new_user.Picture   = Pict;

                    if (service.AddUser(new_user))
                    {
                        View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow;

                        View.Personnel view             = new colle_tMedecine.View.Personnel();
                        ViewModel.PersonnelViewModel vm = new colle_tMedecine.ViewModel.PersonnelViewModel();
                        view.DataContext = vm;
                        mainwindow.contentcontrol.Content = view;
                    }
                }
                else
                {
                    ErrorMessage     = "Les mots de passe sont différents.";
                    ShowConnectError = 1;
                    ShowConnectError = 0;
                }
            }
            else
            {
                ErrorMessage     = "Veuillez remplir tous les champs.";
                ShowConnectError = 1;
                ShowConnectError = 0;
            }
        }
Ejemplo n.º 19
0
        public MainController()
        {
            if (!(_instance is null))
            {
                throw new InvalidOperationException();
            }
            _instance = this;

            #region Initialize
            SettingsController         = new SettingsController(LogController);
            ImageReformatController    = new ImageReformatController(this);
            RingtoneReformatController = new RingtoneReformatController(this);
            ImageServerController      = new ServerController(this);
            RequestController          = new RequestController(this);
            UpdateCheckController      = new UpdateCheckController(LogController);
            MainWindow = new View.MainWindow(this);
            #endregion Initialize

            MainWindow.Show();
        }
Ejemplo n.º 20
0
        public PersonnelViewModel()
        {
            _newUser    = new RelayCommand(param => ShowNewUser(), param => true);
            _supprUser  = new RelayCommand(DeleteUser);
            _searchUser = new RelayCommand(param => SearchUserAction(), param => true);
            Search      = "";
            View.MainWindow mainwindow  = (View.MainWindow)Application.Current.MainWindow;
            object          datacontext = mainwindow.DataContext;

            ViewModel.MainWindow main = (ViewModel.MainWindow)datacontext;
            if (main.ConnectedUser.Role.Equals("Medecin"))
            {
                this._isAdmin = true;
            }
            else
            {
                this._isAdmin = false;
            }

            FillListUser();
        }
Ejemplo n.º 21
0
 private void viewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName.Equals("LoginSuccessful"))
     {
         login.Hide();
         if (main == null)
         {
             main = new View.MainWindow(viewModel);
         }
         main.Show();
     }
     else if (e.PropertyName.Equals("LogoutUser"))
     {
         if (main != null)
         {
             main.Close();
         }
         main = null;
         login.Show();
     }
 }
Ejemplo n.º 22
0
        public PatientsViewModel()
        {
            _newPatient    = new RelayCommand(param => ShowNewPatient(), param => true);
            _patientSheet  = new RelayCommand(ShowPatientSheet);
            _supprPatient  = new RelayCommand(DeletePatient);
            _searchPatient = new RelayCommand(param => SearchPatientAction(), param => true);
            View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow;
            this._isAdmin = true;
            object datacontext = mainwindow.DataContext;

            ViewModel.MainWindow main = (ViewModel.MainWindow)datacontext;
            if (main.ConnectedUser.Role.Equals("Medecin"))
            {
                IsAdmin = true;
            }
            else
            {
                IsAdmin = false;
            }
            FillListPatient();
        }
Ejemplo n.º 23
0
        private void disconnect()
        {
            try
            {
                View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow;

                ServiceUser.ServiceUserClient clientService = new ServiceUser.ServiceUserClient();
                clientService.Disconnect(ConnectedUser.Login);

                ViewModel.MainWindow mainwindowVM = (ViewModel.MainWindow)mainwindow.DataContext;
                ConnectedUser             = null;
                mainwindowVM.MenuIsActive = false;
                View.Login view             = new colle_tMedecine.View.Login();
                ViewModel.LoginViewModel vm = new colle_tMedecine.ViewModel.LoginViewModel();
                view.DataContext = vm;
                mainwindow.contentcontrol.Content = view;
            }
            catch (Exception)
            {
            }
        }
Ejemplo n.º 24
0
        public void DeleteUser(object param)
        {
            ServiceUser.ServiceUserClient service = new ServiceUser.ServiceUserClient();
            Model.User user = (Model.User)param;

            View.MainWindow      mainwindow   = (View.MainWindow)Application.Current.MainWindow;
            ViewModel.MainWindow mainwindowVM = (ViewModel.MainWindow)mainwindow.DataContext;
            if (user.Login != mainwindowVM.ConnectedUser.Login)
            {
                try
                {
                    if (service.DeleteUser(user.Login))
                    {
                        this._allUser.Remove(user);
                        ListUser = new ObservableCollection <Model.User>(this._allUser);
                    }
                }
                catch (Exception)
                {
                    ListUser = new ObservableCollection <Model.User>(this._allUser);
                }
            }
        }
Ejemplo n.º 25
0
        public void FillListUser()
        {
            ServiceUser.ServiceUserClient service = new ServiceUser.ServiceUserClient();
            try
            {
                ServiceUser.User[] listUser = service.GetListUser();
                _allUser = new List <Model.User>();
                foreach (ServiceUser.User user in listUser)
                {
                    Model.User userModel = new Model.User
                    {
                        Login     = user.Login,
                        Password  = user.Pwd,
                        Name      = user.Name,
                        Firstname = user.Firstname,
                        Pic       = user.Picture,
                        Role      = user.Role,
                        Co        = user.Connected
                    };
                    userModel.Name      = FirstUpper(userModel.Name);
                    userModel.Firstname = FirstUpper(userModel.Firstname);
                    userModel.Role      = FirstUpper(userModel.Role);
                    this._allUser.Add(userModel);
                }
                ListUser = new ObservableCollection <Model.User>(_allUser);
            }
            catch
            {
                MainWindow      main       = new MainWindow();
                View.MainWindow mainwindow = (View.MainWindow)Application.Current.MainWindow;

                View.Personnel view             = new colle_tMedecine.View.Personnel();
                ViewModel.PersonnelViewModel vm = new colle_tMedecine.ViewModel.PersonnelViewModel();
                view.DataContext = vm;
                main.navigate((UserControl)mainwindow.contentcontrol.Content, view);
            }
        }
Ejemplo n.º 26
0
 public Main()
 {
     view = new View.MainWindow();
 }
Ejemplo n.º 27
0
 public void SetParent(View.MainWindow form)
 {
     refParent = form;
 }