private void NewCategoryRadForm_Load(object sender, EventArgs e)
 {
     MsgErrorLabel.Text = String.Empty;
     ProcessState(this.state);
     CodeCategoryRadTextBox.Focus();
     this.RegisterRadButton.Click += RegisterRadButton_Click;
 }
        private bool ValidateForm()
        {
            if (CodeCategoryRadTextBox.Text == string.Empty)
            {
                DisplayError("Debe ingresar un codigo.");
                CodeCategoryRadTextBox.Focus();
                return(false);
            }
            MsgErrorLabel.Text = String.Empty;

            if (state == StateForm.NEW)
            {
                if (this._serviceCategoryBL.ExitCategoryCode(CodeCategoryRadTextBox.Text))
                {
                    DisplayError("Código ingresado ya existe.");
                    CodeCategoryRadTextBox.Focus();
                    return(false);
                }
            }

            MsgErrorLabel.Text = string.Empty;

            if (CategoryRadTextBox.Text == string.Empty)
            {
                DisplayError("Debe ingresar una categoría.");
                CategoryRadTextBox.Focus();
                return(false);
            }
            MsgErrorLabel.Text = String.Empty;
            return(true);
        }