private void TableComboBox_DropDownOpened(object sender, EventArgs e) { var helper = new SqlDbHelper(ConnectionStringTextBox.Text); var provider = new SqlServerProvider(helper); var tables = provider.GetTableSchemas(); TableComboBox.ItemsSource = tables.OrderBy(x => x.Name); }
private ITasksService CreateTaskService() { var helper = new SqlDbHelper(ConfigurationManager.ConnectionStrings["SimpleTasks"].ConnectionString); var projectRepo = new ProjectRepository(helper); var genericRepo = new GenericRepository(helper); var memberRepo = new MemberRepository(helper); var taskRepo = new TasksRepository(helper); var service = new TasksService(helper, projectRepo, genericRepo, memberRepo, taskRepo); return service; }
private void TableComboBox_DropDownOpened(object sender, EventArgs e) { if (_tables != null && _tables.Count() > 0 && !String.IsNullOrEmpty(_connectionString) && !String.IsNullOrEmpty(ConnectionStringTextBox.Text) && _connectionString.Equals(ConnectionStringTextBox.Text)) { TableComboBox.ItemsSource = _tables; return; } var helper = new SqlDbHelper(ConnectionStringTextBox.Text); var provider = new SqlServerProvider(helper); var tables = provider.GetTableSchemas(); _tables = tables.OrderBy(x => x.Name); TableComboBox.ItemsSource = _tables; }
static void Main(string[] args) { try { var helper = new SqlDbHelper("server=.;database=SimpleTasks;Integrated Security=SSPI;"); var prog = new Program(helper); prog.Run(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } Console.WriteLine("Done..."); Console.ReadLine(); }
private INotificationsRepository CreateRepo() { var connString = ConfigurationManager.ConnectionStrings["SimpleTasks"].ConnectionString; var helper = new SqlDbHelper(connString); return new NotificationsRepository(helper); }
private SqlDbHelper CreateHelper() { var connString = ConfigurationManager.ConnectionStrings["SimpleTasks"].ConnectionString; var helper = new SqlDbHelper(connString); return helper; }
private ISecurityService CreateSecurityService() { var connString = ConfigurationManager.ConnectionStrings["SimpleTasks"].ConnectionString; var helper = new SqlDbHelper(connString); return new SecurityService(new AspNetFormsAuthentication(), new MemberRepository(helper)); }