예제 #1
0
        public void insert_admin_account()
        {
            var hospitals = new Hospitals().All<Hospital>();

            foreach (var hospital in hospitals)
            {
                var account = new Account(true);

                account.AddProfessionalRegistration(new ProfessionalRegistration
                        {
                            Number = "123" + hospital.Id,
                            State = hospital.State,
                            Type = ProfessionalRegistrationTypeEnum.CRM
                        });
                account.ToEnterPassword("123");
                account.ToEnterFirstName(hospital.Name);
                account.ToEnterLastName("Admin");
                account.ToEnterGender(GenderEnum.Male);
                account.ToEnterEmail(RemoveSpecialCharacters(hospital.Name) + "@workker.com.br");
                account.ToEnterBirthday(new DateTime(1989, 7, 17));

                account.AddHospital(hospital);

                var accounts = new Accounts();

                accounts.Save(account);
            }
        }
예제 #2
0
        private Account CreateAccount(string firstName, string lastName, GenderEnum gender, ProfessionalRegistrationTypeEnum professionalResgistrationType,
            string professionalResgistrationNumber, string email, string password, DateTime birthday, Hospital hospital)
        {
            var professionalResgistration = new ProfessionalRegistration
                                                {
                                                    Number = professionalResgistrationNumber,
                                                    State = hospital.State,
                                                    Type = professionalResgistrationType
                                                };

            var account = new Account(false);
            account.ToApprove(false);
            account.ToRefuse(false);
            account.AddProfessionalRegistration(professionalResgistration);
            account.ToEnterFirstName(firstName);
            account.ToEnterLastName(lastName);
            account.ToEnterGender(gender);
            account.ToEnterEmail(email);
            account.ToEnterPassword(password);
            account.ToEnterBirthday(birthday);

            account.AddHospital(hospital);

            return account;
        }