public bool UpdateUser(SystemUser user, out List <string> errorList)
        {
            errorList        = new List <string>();
            _objectValidator = new ValueObjectValidator();
            _isValid         = _objectValidator.TryValidate(user, out _validationResults);

            if (!_isValid)
            {
                foreach (var error in _validationResults)
                {
                    errorList.Add(error.ErrorMessage);
                }

                return(false);
            }

            _userDAL.UpdateUser(user);

            return(true);
        }
Example #2
0
        public bool InsertExaminee(Examinee examinee, out List <string> errorList)
        {
            errorList        = new List <string>();
            _objectValidator = new ValueObjectValidator();
            _isValid         = _objectValidator.TryValidate(examinee, out _validationResults);

            if (!_isValid)
            {
                foreach (var error in _validationResults)
                {
                    errorList.Add(error.ErrorMessage);
                }

                return(false);
            }

            _examineeDAL.InsertExaminee(examinee);

            return(true);
        }
Example #3
0
        public bool UpdateExaminee(Examinee examinee, out List <string> errorList)
        {
            errorList        = new List <string>();
            _objectValidator = new ValueObjectValidator();
            _isValid         = _objectValidator.TryValidate(examinee, out _validationResults);

            if (!_isValid)
            {
                foreach (var error in _validationResults)
                {
                    errorList.Add(error.ErrorMessage);
                }

                return(false);
            }
            //Console.WriteLine("BLL " + examinee.DateTimeAdded.ToString());
            _examineeDAL.UpdateExaminee(examinee);

            return(true);
        }
Example #4
0
        public bool UpdateSubject(Subject subject, out List <string> errorList)
        {
            errorList        = new List <string>();
            _objectValidator = new ValueObjectValidator();
            _isValid         = _objectValidator.TryValidate(subject, out _validationResults);

            if (!_isValid)
            {
                foreach (var error in _validationResults)
                {
                    errorList.Add(error.ErrorMessage);
                }

                return(false);
            }

            _subjectDAL.UpdateSubject(subject);

            return(true);
        }
        public bool InsertUser(SystemUser user, out List <string> errorList)
        {
            errorList        = new List <string>();
            _objectValidator = new ValueObjectValidator();
            _isValid         = _objectValidator.TryValidate(user, out _validationResults);

            if (!_isValid)
            {
                foreach (var error in _validationResults)
                {
                    errorList.Add(error.ErrorMessage);
                }

                return(false);
            }

            user.Pword = SetHashText(user.Pword);   //  set new user password
            _userDAL.InsertUser(user);

            return(true);
        }