Ejemplo n.º 1
0
        public Nurse SaveNurse(Nurse mNurse)
        {
            if (mNurse.user.id == 0)
            {
                mNurse.user.passwordHash = Infrastructure.HashPasswordHelper.HashPassword(mNurse.user.passwordHash);
            }
            mNurse.user = userRepository.SaveUser(mNurse.user);

            if (mNurse.user.id > 0)
            {
                mNurse.id = mNurse.user.id;
                nurseRepository.SaveNurse(mNurse);

                mNurse.nurseSpecialties.nurseId = mNurse.user.id;
                nurseRepository.SaveSpecialtie(mNurse.nurseSpecialties);
            }
            return(mNurse);
        }