Beispiel #1
0
        public void SaveExecute(object parametar)
        {
            var passwordBox = parametar as PasswordBox;
            var password    = passwordBox.Password;

            User.Password = password;
            User.GenderId = selectedGender.GenderId;
            User.RoleId   = 2;
            try
            {
                int userId = service.AddClinicUser(User);
                if (userId != 0)
                {
                    UserMaintainance.ClinicUserId = userId;
                    if (service.AddNewMaintainance(UserMaintainance) != 0)
                    {
                        service.ChackNumberOfMaintainanc();
                    }
                    MessageBox.Show("You have successfully added new maintainance");
                    Logging.LoggAction("AddMaintainanceViewModel", "Info", "Succesfull added new doctor");
                    MaintainancView maintainanceView = new MaintainancView(AdminUser);
                    maintainanceView.Show();
                    addMaintainanceView.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                Logging.LoggAction("AddDoctorViewModel", "Error", ex.ToString());
            }
        }
Beispiel #2
0
 public void QuitExecute()
 {
     try
     {
         MaintainancView maintainancView = new MaintainancView(AdminUser);
         maintainancView.Show();
         addMaintainanceView.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Beispiel #3
0
 public void GoToMaintainancExecute()
 {
     try
     {
         MaintainancView main = new MaintainancView(user);
         main.Show();
         administratorView.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Beispiel #4
0
 public MaintainancViewModel(ClinicUser user, MaintainancView maintainancViewOpen)
 {
     this.user         = user;
     maintainancView   = maintainancViewOpen;
     ListOFMaintenance = new ObservableCollection <vwMaintenance>(service.GetAllvwMaintainancList());
 }