Esempio n. 1
0
 private void bg_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         Models.DataSource.ConnectionString = Settings.Default.ConnectionString;
         Console.Write(new UnitOfWork().ObligationsRepo.Fetch().Count());
         MachineTime.UpdateTime();
     }
     catch (Exception exception)
     {
         Invoke(new Action(() => { ConnectionDialog.ShowDialog(); }));
     }
 }
Esempio n. 2
0
        public static string Connection()
        {
            var cd = new ConnectionDialog();

            DataSource.AddStandardDataSources(cd);
            cd.SelectedDataSource   = DataSource.SqlDataSource;
            cd.ConnectionString     = Settings.Default.ConnectionString;
            cd.SelectedDataProvider = DataProvider.SqlDataProvider;
            DataConnectionDialog.Show(cd);
            Settings.Default.ConnectionString = cd.ConnectionString;
            Settings.Default.Save();
            return(cd.ConnectionString);
        }
Esempio n. 3
0
 private void Bg_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         var unitOfWork = new UnitOfWork();
         Debug.Write(unitOfWork.UsersRepo.Fetch().Select(x => new { x.Id }).Any());
         Thread.Sleep(100);
     }
     catch (Exception ex)
     {
         Invoke(new Action(() =>
         {
             MessageBox.Show(ex.Message, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
             UnitOfWork.DataSource = ConnectionDialog.Connection();
         }));
     }
 }
Esempio n. 4
0
 private void btnServerSetup_Click(object sender, EventArgs e)
 {
     ConnectionDialog.ShowDialog();
 }