コード例 #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());
            }
        }