Exemple #1
0
        public MainWindow()
        {
            InitializeComponent();

            MySqlSettings.DeserializeInstance("PAU.cfg");

            MySqlConnection con = new MySqlConnection(MySqlSettings.Instance.ConnectionString());
            try
            {
                con.Open();
            }
            catch (Exception)
            {
                winMySqlConnection conDlg = new winMySqlConnection();

                _conEstablished = conDlg.ShowDialog().Value;

                if (_conEstablished == false)
                {
                    Close();
                }
            }

            PAU.Properties.Settings.Default.Reload();

            dgPassenger.DataContext = controller;

            this.DataContext = controller;

            controller.AppDock = AppDock;
            controller.DockGroup = dockGroup;
            controller.PassengerGrid = dgPassenger;
            controller.DPOGrid = dgDPO;
            controller.NationalityGrid = dgNationality;

            Loaded += new RoutedEventHandler(MainWindow_Loaded);
            this.Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);
        }
Exemple #2
0
 private void ConnectionSettings(object sender, ExecutedRoutedEventArgs e)
 {
     winMySqlConnection con = new winMySqlConnection();
     con.ShowDialog();
 }