Beispiel #1
0
 /// <summary>
 /// Check on adding to DataBase
 /// </summary>
 /// <returns></returns>
 private bool AddCarInGeneral()
 {
     // check for input
     if (txbAddManufacture.Text == null || txbAddModel.Text == null || txbAddColorCar.Text == null || txbAddNumberCar == null ||
         txbAddManufacture.Text == string.Empty || txbAddModel.Text == string.Empty || txbAddColorCar.Text == string.Empty || txbAddNumberCar.Text == string.Empty)
     {
         MessageBox.Show("Please input values into all fields!", "Error");
         SetFocusToTextBox();
         CheckFieldsByType.CheckFieldsByTypeMethod(ListOfIntType, ListOfDateType, ListOfStringType, this);
         return(false);
     }
     else
     {
         //SetFocusToTextBox();
         if (CheckFieldsByType.CheckFieldsByTypeMethod(ListOfIntType, ListOfDateType, ListOfStringType, this))
         {
             AddCarToDB();
         }
         return(true);
     }
 }
 /// <summary>
 /// Check on adding to DataBase
 /// </summary>
 /// <returns></returns>
 private bool AddClientInGeneral()
 {
     // проверка на ввод
     if (txbAddClientLastName.Text == null || txbAddClientFirstName.Text == null || txbAddClientMidleName.Text == null || txbAddClientPhone == null ||
         txbAddClientAdress == null || txbAddClientLastName.Text == string.Empty || txbAddClientFirstName.Text == string.Empty || txbAddClientMidleName.Text == string.Empty ||
         txbAddClientPhone.Text == string.Empty || txbAddClientAdress.Text == string.Empty)
     {
         MessageBox.Show("Please input values all fields!", "Error");
         SetFocusToTextBox();
         CheckFieldsByType.CheckFieldsByTypeMethod(ListOfIntType, ListOfDateType, ListOfStringType, this);
         return(false);
     }
     else
     {
         //SetFocusToTextBox();
         if (CheckFieldsByType.CheckFieldsByTypeMethod(ListOfIntType, ListOfDateType, ListOfStringType, this))
         {
             AddClientToDB();
         }
         return(true);
     }
 }