Example #1
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     dj_DS = ((Kurosvaya.Dj_DS)(this.FindResource("dj_DS")));
     // Загрузить данные в таблицу emp. Можно изменить этот код как требуется.
     dj_DSempTableAdapter = new Kurosvaya.Dj_DSTableAdapters.empTableAdapter();
     dj_DSempTableAdapter.Fill(dj_DS.emp);
     empViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("empViewSource")));
     empViewSource.View.MoveCurrentToFirst();
     // Загрузить данные в таблицу pstions. Можно изменить этот код как требуется.
     dj_DSpstionsTableAdapter = new Kurosvaya.Dj_DSTableAdapters.pstionsTableAdapter();
     dj_DSpstionsTableAdapter.Fill(dj_DS.pstions);
     pstionsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("pstionsViewSource")));
     pstionsViewSource.View.MoveCurrentToFirst();
     // Загрузить данные в таблицу gnrs. Можно изменить этот код как требуется.
     dj_DSgnrsTableAdapter = new Kurosvaya.Dj_DSTableAdapters.gnrsTableAdapter();
     dj_DSgnrsTableAdapter.Fill(dj_DS.gnrs);
     gnrsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("gnrsViewSource")));
     gnrsViewSource.View.MoveCurrentToFirst();
     // Загрузить данные в таблицу cmpstn. Можно изменить этот код как требуется.
     dj_DScmpstnTableAdapter = new Kurosvaya.Dj_DSTableAdapters.cmpstnTableAdapter();
     dj_DScmpstnTableAdapter.Fill(dj_DS.cmpstn);
     cmpstnViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("cmpstnViewSource")));
     cmpstnViewSource.View.MoveCurrentToFirst();
     // Загрузить данные в таблицу mscn. Можно изменить этот код как требуется.
     dj_DSmscnTableAdapter = new Kurosvaya.Dj_DSTableAdapters.mscnTableAdapter();
     dj_DSmscnTableAdapter.Fill(dj_DS.mscn);
     mscnViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("mscnViewSource")));
     mscnViewSource.View.MoveCurrentToFirst();
     // Загрузить данные в таблицу schdl. Можно изменить этот код как требуется.
     dj_DSschdlTableAdapter = new Kurosvaya.Dj_DSTableAdapters.schdlTableAdapter();
     dj_DSschdlTableAdapter.Fill(dj_DS.schdl);
     schdlViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("schdlViewSource")));
     schdlViewSource.View.MoveCurrentToFirst();
 }
Example #2
0
        public AlohaDataset ReadPayroll(string folder)
        {
            if (string.IsNullOrEmpty(folder))
            {
                throw new ArgumentException("Folder name is null or empty", nameof(folder));
            }

            if (Directory.Exists(folder))
            {
                _logger.Info($"ReadPayroll was called for folder {folder}");
                var result = new AlohaDataset();

                _logger.Debug("Loading emp table");
                var empAdapter = new empTableAdapter();
                empAdapter.Connection.ConnectionString = GetConnectionString(folder);
                empAdapter.Fill(result.emp);
                _logger.Debug($"Done loading emp, {result.emp.Count} loaded");

                _logger.Debug("Loading adjtime table");
                var adjtimeAdapter = new adjtimeTableAdapter();
                adjtimeAdapter.Connection.ConnectionString = GetConnectionString(folder);
                adjtimeAdapter.Fill(result.adjtime);
                _logger.Debug($"Done loading adjtime, {result.adjtime.Count} loaded");

                _logger.Debug("Loading gndbreak table");
                var gndbreakAdapter = new gndbreakTableAdapter();
                gndbreakAdapter.Connection.ConnectionString = GetConnectionString(folder);
                gndbreakAdapter.Fill(result.gndbreak);
                _logger.Debug($"Done loading gndbreak, {result.gndbreak.Count} loaded");

                _logger.Info("Done ReadPayroll");
                return(result);
            }
            else
            {
                _logger.Warn($"ReadPayroll: Folder {folder} not found");
                return(null);
            }
        }