예제 #1
0
 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);
 }
예제 #2
0
 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;
 }
예제 #3
0
        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;
        }
예제 #4
0
 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);
 }
예제 #6
0
 private SqlDbHelper CreateHelper()
 {
     var connString = ConfigurationManager.ConnectionStrings["SimpleTasks"].ConnectionString;
     var helper = new SqlDbHelper(connString);
     return helper;
 }
예제 #7
0
 private ISecurityService CreateSecurityService()
 {
     var connString = ConfigurationManager.ConnectionStrings["SimpleTasks"].ConnectionString;
     var helper = new SqlDbHelper(connString);
     return new SecurityService(new AspNetFormsAuthentication(), new MemberRepository(helper));
 }