Exemplo n.º 1
0
 private void AcceptedTurnNumberTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Enter)
         {
             if (!string.IsNullOrEmpty(AcceptedTurnNumberTextBox.Text))
             {
                 Hepsa.Core.Validation.NumericRule <Int64> NumericValidator = new Hepsa.Core.Validation.NumericRule <Int64>("AcceptedTurnNumberRule", "شماره نوبت تأیید شده", 1, null, null, 0);
                 if (NumericValidator.Validate(Convert.ToInt64(AcceptedTurnNumberTextBox.Text)) == false)
                 {
                     throw new ApplicationException(NumericValidator.Description);
                 }
                 Search();
             }
             else
             {
                 this.TurnManagementGridView.DataSource = null;
             }
             TrafficNumberTextBox.Text   = string.Empty;
             NumberPlate_nvcTextBox.Text = string.Empty;
             SerialPlate_nvcTextBox.Text = string.Empty;
             FromDate_nvcTextBox.Text    = string.Empty;
             ToDate_nvcTextBox.Text      = string.Empty;
         }
     }
     catch (Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }
Exemplo n.º 2
0
 private void LadeAssignmentIDTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Enter)
         {
             if (!string.IsNullOrEmpty(LadeAssignmentIDTextBox.Text))
             {
                 Hepsa.Core.Validation.NumericRule <Int64> NumericValidator = new Hepsa.Core.Validation.NumericRule <Int64>("LadeAssignmentIDNumberRule", "شماره بار", 1, null, null, 0);
                 if (NumericValidator.Validate(AcceptedTurnNumberTextBox.Text) == false)
                 {
                     throw new ApplicationException(NumericValidator.Description);
                 }
                 TrafficNumberTextBox.Text      = string.Empty;
                 AcceptedTurnNumberTextBox.Text = string.Empty;
                 NumberPlate_nvcTextBox.Text    = string.Empty;
                 SerialPlate_nvcTextBox.Text    = string.Empty;
                 LadBillCreditTextBox.Text      = string.Empty;
                 Search();
             }
             else
             {
                 this.LadBillWithTrafficGridView.DataSource = null;
             }
         }
     }
     catch (Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }
Exemplo n.º 3
0
 private void TrafficNumberTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Enter)
         {
             if (!string.IsNullOrEmpty(TrafficNumberTextBox.Text))
             {
                 Hepsa.Core.Validation.NumericRule <Int64> NumericValidator = new Hepsa.Core.Validation.NumericRule <Int64>("TrafficNumberRule", "شماره قبض", 1, null, null, 0);
                 if (NumericValidator.Validate(TrafficNumberTextBox.Text) == false)
                 {
                     throw new ApplicationException(NumericValidator.Description);
                 }
                 TurnNumberTextBox.Text      = string.Empty;
                 NumberPlate_nvcTextBox.Text = string.Empty;
                 SerialPlate_nvcTextBox.Text = string.Empty;
                 FromDate_nvcTextBox.Text    = string.Empty;
                 ToDate_nvcTextBox.Text      = string.Empty;
                 Search();
                 TrafficNumberTextBox.Focus();
                 this.RaiseKeyDownEvent = false;
                 TrafficNumberTextBox.SelectAll();
             }
             else
             {
                 this.TrafficGridView.DataSource = null;
                 TrafficNumberTextBox.Focus();
                 this.RaiseKeyDownEvent = false;
                 TrafficNumberTextBox.SelectAll();
             }
         }
     }
     catch (Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
         TrafficNumberTextBox.Focus();
         this.RaiseKeyDownEvent = false;
         TrafficNumberTextBox.SelectAll();
     }
 }