예제 #1
0
        public void GetDonor()
        {
            //Crea un donador
            DonorBM  donorBm     = create_donor();
            DonorBLL donorBll    = new DonorBLL();
            ResultBM donorResult = donorBll.GetDonor(donorBm.donorId);

            Assert.IsTrue(donorResult.IsValid(), "El donador debería existir.");
        }
예제 #2
0
        private void FrmDonor_Load(object sender, EventArgs e)
        {
            try
            {
                //Traducciones
                SessionHelper.RegisterForTranslation(this, Codes.MNU_GE009);
                SessionHelper.RegisterForTranslation(cmdAccept, Codes.BTN_ACCEPT);
                SessionHelper.RegisterForTranslation(cmdClose, Codes.BTN_CLOSE);

                SessionHelper.RegisterForTranslation(lblName, Codes.LBL_NAME);
                SessionHelper.RegisterForTranslation(lblLastName, Codes.LBL_LAST_NAME);
                SessionHelper.RegisterForTranslation(lblBirthday, Codes.LBL_BIRTHDAY);
                SessionHelper.RegisterForTranslation(lblMail, Codes.LBL_EMAIL);
                SessionHelper.RegisterForTranslation(lblPhone, Codes.LBL_PHONE);
                SessionHelper.RegisterForTranslation(rbuttonFemale, Codes.LBL_FEMALE);
                SessionHelper.RegisterForTranslation(rButtonMale, Codes.LBL_MALE);
                SessionHelper.RegisterForTranslation(lblDocument, Codes.LBL_UID);

                SessionHelper.RegisterForTranslation(lblStreet, Codes.LBL_STREET);
                SessionHelper.RegisterForTranslation(lblNumber, Codes.LBL_NUMBER);
                SessionHelper.RegisterForTranslation(lblApartment, Codes.LBL_APARTMENT);
                SessionHelper.RegisterForTranslation(lblComment, Codes.LBL_OBSERVATION);

                SessionHelper.RegisterForTranslation(lblCountry, Codes.LBL_COUNTRY);
                SessionHelper.RegisterForTranslation(lblCompany, Codes.LBL_COMPANY);
                SessionHelper.RegisterForTranslation(lblCategory, Codes.LBL_CATEGORY);
                SessionHelper.RegisterForTranslation(lblCommentCpny, Codes.LBL_OBSERVATION);
                SessionHelper.RegisterForTranslation(lblMailCmpny, Codes.LBL_EMAIL);
                SessionHelper.RegisterForTranslation(lblPhoneCmpny, Codes.LBL_PHONE);
                SessionHelper.RegisterForTranslation(chkBoxContact, Codes.LBL_CAN_CONTACT);

                ResultBM countryResult = new CountryBLL().GetCountries();
                cmbCountry.DataSource    = countryResult.GetValue <List <CountryBM> >();
                cmbCountry.DisplayMember = "Name";

                if (IsUpdate)
                {
                    DonorBLL donorBll    = new DonorBLL();
                    ResultBM resultDonor = donorBll.GetDonor(entity.donorId);

                    if (resultDonor.IsValid())
                    {
                        this.Entity = resultDonor.GetValue <DonorBM>();

                        CompletePersonData(this.Entity);
                        CompleteAddressData(this.Entity);
                        CompleteCompanyData(this.Entity);
                    }
                    else
                    {
                        MessageBox.Show(resultDonor.description, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                else
                {
                    entity = new DonorBM();
                }
            }
            catch (Exception exception) {
                MessageBox.Show("Se ha producido el siguiente error: " + exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }