コード例 #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
ファイル: TaskTests.cs プロジェクト: chrcar01/SimpleTasks
 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
ファイル: Program.cs プロジェクト: chrcar01/SimpleTasks
 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();
 }
コード例 #5
0
 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
ファイル: SecurityTests.cs プロジェクト: chrcar01/SimpleTasks
 private ISecurityService CreateSecurityService()
 {
     var connString = ConfigurationManager.ConnectionStrings["SimpleTasks"].ConnectionString;
     var helper = new SqlDbHelper(connString);
     return new SecurityService(new AspNetFormsAuthentication(), new MemberRepository(helper));
 }