示例#1
0
        private void btnAccept_Click(object sender, EventArgs e)
        {
            try
            {
                Entity.Category category = new Entity.Category
                {
                    Name       = NativeRules.CheckString(txtName.Text.ToString().Trim(), "Nombre inválido", 1, 25),
                    BlockedAge = Convert.ToInt32(txtAge.Text.ToString().Trim())
                };

                (new CategoryRepository()).AddCategory(category);
                MessageBox.Show("La categoría se ha creado exitosamente!");
                this.btnBack_Click(sender, e);
            } catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
 private void Initialization()
 {
     this.oSystemUser = new SystemUser();
     this.oCategory = new Category();
     this.ObjectiveType = new Objective();
     this.oQuestionType = new QuestionType();
     this.QLevel = new Level();
     this.Text = String.Empty;
 }
示例#3
0
 public void SetCategory(Entity.Category category)
 {
     this.category = category;
 }
 private void Initialization()
 {
     this.oCategory = new Category();
     this.oCategoryType = new List<QuestionType>();
 }