Пример #1
0
 public NotificationService()
 {
     alarmService         = new AlarmService();
     MedicalRecordService = new MedicalRecordService();
     physicUserService    = new PhysicUserService();
     residentService      = new ResidentService();
 }
Пример #2
0
        public static bool LockUser(int id)
        {
            var userEntity = GetUserByUserId(id);

            if (userEntity == null)
            {
                throw MegaException.ThrowException("کاربرب با این شناسه در پایگاه داده وجود ندارد");
            }

            PhysicUserService.UpdateProfile(userEntity.Id, userEntity.Username, userEntity.FirstName, userEntity.LastName, userEntity.Mobile);
            return(true);
        }
        public static bool ChangePassword(string newPassword, string oldPassword)
        {
            UserType CurrentUserType = GetUserType();

            var(UserId, _, _) = GetUserId();
            switch (CurrentUserType)
            {
            case UserType.Doctor:
            {
                return
                    (DoctorService
                     .ChangeUserPassword
                         (UserId.GetValueOrDefault(), oldPassword, newPassword));
            }

            case UserType.Resident:
            {
                return
                    (ResidentService
                     .ChangeUserPassword
                         (UserId.GetValueOrDefault(), oldPassword, newPassword));
            }

            case UserType.Physist:
            {
                return
                    (PhysicUserService
                     .ChangeUserPassword
                         (UserId.GetValueOrDefault(), oldPassword, newPassword));
            }

            case UserType.User:
            {
                return(UserService
                       .ChangeUserPassword
                           (UserId.GetValueOrDefault(), oldPassword, newPassword));
            }
            }
            return(false);
        }