Beispiel #1
0
        public bool Update(StaffViewModel entity)
        {
            var staff = entity.MapToStaff();

            staff.PasswordHash = EncodeUtilities.GetPasswordHash(entity.Password);
            staff.FullName     = EncodeUtilities.StringNormalize(entity.FullName);
            return(_staffRepository.Update(staff));
        }
Beispiel #2
0
        public bool Add(StaffViewModel entity)
        {
            var staff = entity.MapToStaff();

            staff.PasswordHash = EncodeUtilities.GetPasswordHash(entity.Password);
            staff.CreatedDate  = DateTime.Now;
            staff.FullName     = EncodeUtilities.StringNormalize(entity.FullName);
            staff.Account      = GenerateAccount(entity.FullName);
            return(_staffRepository.Add(staff));
        }