Example #1
0
        public void OpenDoctor(int crm)
        {
            _doctorArealyExistsInDataBase = true;
            _doctor          = _doctorDapperRepository.GetById(crm);
            _doctor.Address  = _viaCepServices.GetAddress(_addressDapperRepository.GetById(_doctor.AddressId));
            _doctor.Login    = _loginDapperRepository.GetById(_doctor.LoginId);
            _doctor.Contacts = _contactDapperRepository.GetDoctorContacts(_doctor.Crm).ToList();

            NameTxt.Text        = _doctor.Name;
            CrmTxt.Text         = _doctor.Crm.ToString();
            SpecialityTxt.Text  = _doctor.Specialty;
            UserTxt.Text        = _doctor.Login.User;
            SenhaTxt.Text       = _doctor.Login.Password;
            CepTxt.Text         = _doctor.Address.Cep.ToString();
            AddressCompTxt.Text = _doctor.Address.Complemento;
            NumberTxt.Text      = _doctor.Address.Number.ToString();
            AddressTxt.Text     = _doctor.Address.AddressValue;
            foreach (var contact in _doctor.Contacts)
            {
                if (contact.Type == PhoneTypeEnum.mobile)
                {
                    CelTxt.Text = contact.ContactValue;
                }
                if (contact.Type == PhoneTypeEnum.residential)
                {
                    TelTxt.Text = contact.ContactValue;
                }
            }
        }
        public void OpenDoctor(int crm)
        {
            _secretaryArealyExistsInDataBase = true;
            _secretary          = _secretaryDapperRepository.GetById(crm);
            _secretary.Address  = _viaCepServices.GetAddress(_addressDapperRepository.GetById(_secretary.AddressId));
            _secretary.Login    = _loginDapperRepository.GetById(_secretary.LoginId);
            _secretary.Contacts = _contactDapperRepository.GetSecretaryContacts(_secretary.Cpf).ToList();

            NameTxt.Text        = _secretary.Name;
            CpfTxt.Text         = _secretary.Cpf.ToString();
            UserTxt.Text        = _secretary.Login.User;
            SenhaTxt.Text       = _secretary.Login.Password;
            CepTxt.Text         = _secretary.Address.Cep.ToString();
            AddressCompTxt.Text = _secretary.Address.Complemento;
            NumberTxt.Text      = _secretary.Address.Number.ToString();
            AddressTxt.Text     = _secretary.Address.AddressValue;
            foreach (var contact in _secretary.Contacts)
            {
                if (contact.Type == PhoneTypeEnum.mobile)
                {
                    CelTxt.Text = contact.ContactValue;
                }
                if (contact.Type == PhoneTypeEnum.residential)
                {
                    TelTxt.Text = contact.ContactValue;
                }
            }
        }
Example #3
0
 public void OpenDoctor(int crm)
 {
     _doctorArealyExistsInDataBase = true;
     _patient            = _patientDapperRepository.GetById(crm);
     _patient.Address    = _viaCepServices.GetAddress(_addressDapperRepository.GetById(_patient.AddressId));
     _patient.Contacts   = _contactDapperRepository.GetPatientContacts(_patient.Cpf).ToList();
     _patient.Convenio   = _convenioDapperRepository.GetById(_patient.ConvenioId);
     ConvenioCbo.Text    = _patient.Convenio.Name;
     NameTxt.Text        = _patient.Name;
     CpfTxt.Text         = _patient.Cpf.ToString();
     CepTxt.Text         = _patient.Address.Cep.ToString();
     AddressCompTxt.Text = _patient.Address.Complemento;
     NumberTxt.Text      = _patient.Address.Number.ToString();
     AddressTxt.Text     = _patient.Address.AddressValue;
     foreach (var contact in _patient.Contacts)
     {
         if (contact.Type == PhoneTypeEnum.mobile)
         {
             CelTxt.Text = contact.ContactValue;
         }
         if (contact.Type == PhoneTypeEnum.residential)
         {
             TelTxt.Text = contact.ContactValue;
         }
     }
 }