コード例 #1
0
        private void ExchangeForm_Load(object sender, EventArgs e)
        {
            Text += " - " + _organization.regnumVal;

            yearBox.Value = MainForm.RepYear;
            _repYear      = (int)yearBox.Value;
            ExchangeTabControl.SelectedTab = tabPageDB;
            ExchangeTabControl.TabPages.Remove(tabPage1);

            // инициализация таблиц
            _listsTable = ListsView2.CreateTable();
            _listsTable.Columns.Add(Check, typeof(bool));
            _listsTable.Columns[Check].DefaultValue = false;

            // инициализация биндинг сорса к таблице пакетов
            _listsBS = new BindingSource();
            //_listsBS.CurrentChanged += new EventHandler(_listsBS_CurrentChanged);
            //_listsBS.ListChanged += new ListChangedEventHandler(_listsBS_ListChanged);
            _listsBS.DataSource = _listsTable;

            // присвоение источника dataGrid
            packetsView.AutoGenerateColumns = false;
            packetsView.Columns["checkColumn"].DataPropertyName     = Check;
            packetsView.Columns["packetNumColumn"].DataPropertyName = ListsView2.id;
            packetsView.Columns["docCountColumn"].DataPropertyName  = ListsView2.countDocs;
            packetsView.DataSource = _listsBS;

            ReloadLists();
            GetCountsFromMergies();

            cdRButton.Checked = true;
            cdOrKeyfileRButton_CheckedChanged(cdRButton, e);

            driveBox_Click(sender, e);
            flashBox_Click(sender, e);

            _worker         = new BackgroundWorker();
            _worker.DoWork += new DoWorkEventHandler(worker_DoWork);
            _worker.WorkerSupportsCancellation = true;
            _worker.RunWorkerCompleted        += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
        }
コード例 #2
0
        private void SvodVedomostGetPacketsForm_Load(object sender, EventArgs e)
        {
            orgnameBox.Text = _org.nameVal;
            regnumBox.Text  = _org.regnumVal;
            yearBox.Text    = _repYear.ToString();

            _packetTable = ListsView2.CreateTable();
            _packetTable.Columns.Add(Check, typeof(bool)).DefaultValue = false;
            SQLiteDataAdapter adapter =
                new SQLiteDataAdapter(ListsView2.GetSelectText(_org.idVal, _repYear, ListTypes.PersonalInfo),
                                      _connection);

            adapter.Fill(_packetTable);

            _packetBS            = new BindingSource();
            _packetBS.DataSource = _packetTable;

            // присвоение источника dataGrid
            packetView.AutoGenerateColumns = false;
            packetView.Columns["checkColumn"].DataPropertyName     = Check;
            packetView.Columns["packetNumColumn"].DataPropertyName = ListsView2.id;
            packetView.Columns["docCountColumn"].DataPropertyName  = ListsView2.countDocs;
            packetView.DataSource = _packetBS;
        }