예제 #1
0
 private void CityBox_DropDownOpened(object sender, EventArgs e)
 {
     CityBox.SelectedIndex = -1;
     if (CountryBox.Text != "")
     {
         SqlManager sqlManager = new SqlManager();
         int        num        = sqlManager.ReturnNumber("SELECT Num_country FROM Countries WHERE Name_country = '" + CountryBox.Text + "'");
         if (num != -2)
         {
             CityBox.ItemsSource = null;
             CityBox             = DataManager.PushComboBox(CityBox, "Name_city", "SELECT Name_city FROM Cities WHERE Num_country = " + num);
             if (CityBox == null)
             {
                 PagesManager.ShowConnectionError();
             }
         }
         else if (num == -2)
         {
             PagesManager.ShowConnectionError();
         }
     }
     else
     {
         CityBox = DataManager.PushComboBox(CityBox, "Name_city", "SELECT Name_city FROM Cities");
         if (CityBox == null)
         {
             PagesManager.ShowConnectionError();
         }
     }
     System.GC.Collect();
 }
예제 #2
0
 public PageFilterTrips()
 {
     InitializeComponent();
     CountryBox = DataManager.PushComboBox(CountryBox, "Name_country", "SELECT Name_country FROM Countries");
     if (CountryBox == null)
     {
         PagesManager.ShowConnectionError();
     }
 }
예제 #3
0
 public WindowAdmin()
 {
     InitializeComponent();
     sqlManager = new SqlManager();
     listRegexs = new Dictionary <string, string>
     {
         { "String", @"[А-яа-я0-9\ ]{2,50}" },
         { "Int32", @"\d{1,10}" },
         { "Date", @"^(?:(?:31(.)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(.)(?:0?[1,3-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(.)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(.)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$" },
         { "Decimal", @"^\d*(?(?=\d.{1}\d)\d*.{1}\d*)$" }
     };
     if ((tables = DataManager.PushComboBox(tables, "name", "SELECT name FROM sys.tables " +
                                            "WHERE name != 'sysdiagrams' AND name != 'Trips' AND name != 'Accounts' AND name != 'Passwords'")) == null)
     {
         ShowConnectionError();
     }
 }