Beispiel #1
0
 public void SetGender(Entity.Gender gender)
 {
     this.gender = gender;
     mediaTypes  = (new MediaTypeRepository()).FindAll();
     genders     = (new GenderRepository()).FindAll();
     statuses    = (new StatusRepository()).FindAll();
 }
Beispiel #2
0
        private void btnAccept_Click(object sender, EventArgs e)
        {
            try
            {
                Entity.Gender gender = new Entity.Gender
                {
                    Name         = NativeRules.CheckString(txtName.Text.ToString().Trim(), "Nombre inválido", 5, 50),
                    MediaType    = (new MediaTypeRepository()).FindById(int.Parse(comboMediaType.SelectedValue.ToString())),
                    ParentGender = (new GenderRepository()).FindById(int.Parse(comboParentGender.SelectedValue.ToString()))
                };

                (new GenderRepository()).Add(gender);
                MessageBox.Show("El género se ha creado exitosamente!");
                this.btnBack_Click(sender, e);
            } catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }