Пример #1
0
 private void LoadCarTrafficWithCard()
 {
     try
     {
         HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();
         DataTable CarDataTable = new DataTable();
         // string Condition = "AND Car_T.SerialPlate_nvc='" + Serialplate + "' AND Car_T.NumberPlate_nvc='" + NumberPlate + "' ";
         string Condition = "Car_T.SerialPlate_nvc='" + Serialplate + "' AND Car_T.NumberPlate_nvc='" + NumberPlate + "' ";
         CarFactory.GetAllByConditionWithCardReader(Condition, ref CarDataTable);
         this.CarGridView.DataSource = CarDataTable;
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
Пример #2
0
 private void SerarchCar()
 {
     try
     {
         HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory();
         DataTable CarDataTable = new DataTable();
         string    Condition    = "";
         if (!string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text) && string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && string.IsNullOrEmpty(CarCardNumber_nvcTextBox.Text))
         {
             Condition = "Car_T.SerialPlate_nvc='" + SerialPlate_nvcTextBox.Text + "'";
         }
         else if (string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && string.IsNullOrEmpty(CarCardNumber_nvcTextBox.Text))
         {
             Condition = "Car_T.NumberPlate_nvc='" + NumberPlate_nvcTextBox.Text + "'";
         }
         else if (string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text) && string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(CarCardNumber_nvcTextBox.Text))
         {
             Condition = "Car_T.CarCardnumber_nvc='" + CarCardNumber_nvcTextBox.Text + "'";
         }
         else if (!string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && string.IsNullOrEmpty(CarCardNumber_nvcTextBox.Text))
         {
             Condition = "Car_T.SerialPlate_nvc='" + SerialPlate_nvcTextBox.Text + "' AND Car_T.NumberPlate_nvc='" + NumberPlate_nvcTextBox.Text + "'";
         }
         else if (string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(CarCardNumber_nvcTextBox.Text))
         {
             Condition = "Car_T.NumberPlate_nvc='" + NumberPlate_nvcTextBox.Text + "' AND Car_T.CarCardnumber_nvc='" + CarCardNumber_nvcTextBox.Text + "'";
         }
         else if (!string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text) && string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(CarCardNumber_nvcTextBox.Text))
         {
             Condition = "Car_T.SerialPlate_nvc='" + SerialPlate_nvcTextBox.Text + "' AND Car_T.CarCardnumber_nvc='" + CarCardNumber_nvcTextBox.Text + "'";
         }
         else
         {
             Condition = "Car_T.SerialPlate_nvc='" + SerialPlate_nvcTextBox.Text + "' AND Car_T.CarCardnumber_nvc='" + CarCardNumber_nvcTextBox.Text + "' AND Car_T.NumberPlate_nvc='" + NumberPlate_nvcTextBox.Text + "'";
         }
         CarFactory.GetAllByConditionWithCardReader(Condition, ref CarDataTable);
         this.CarGridView.DataSource = CarDataTable;
     }
     catch (System.Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }