Exemplo n.º 1
0
 private void LastName_Validating(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (String.IsNullOrEmpty(LastNameText.Text))
     {
         e.Cancel = true;
         EmployeeFormValidator.SetError(LastNameText, errorMsg);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Clears windows form
        /// </summary>
        private void ClearAllFields()
        {
            foreach (int i in PositionsCheckedListBox.CheckedIndices)
            {
                PositionsCheckedListBox.SetItemCheckState(i, CheckState.Unchecked);
            }

            FirstNameText.Text = String.Empty;
            LastNameText.Text  = String.Empty;
            AddressText.Text   = String.Empty;
            EmailText.Text     = String.Empty;
            CellNoText.Text    = String.Empty;
            PositionText.Text  = String.Empty;
            PositionsCheckedListBox.SelectedIndex = -1;
            EmployeeFormValidator.Clear();
            FirstNameText.Focus();
        }