Exemplo n.º 1
0
        private void ReloadLists()
        {
            if (_listsBS == null)
            {
                return;
            }
            if (_listsTable == null)
            {
                return;
            }

            //отключение события ListChangedEventHandler , что б не мерцали кнопки при обновлении
            _listsBS.RaiseListChangedEvents = false;

            _listsTable.Clear();
            string commandStr = ListsView2.GetSelectText(_organization.idVal, _repYear, ListTypes.PersonalInfo);

            _listsAdapter = new SQLiteDataAdapter(commandStr, _connection);
            _listsAdapter.Fill(_listsTable);

            //включение события ListChangedEventHandler
            _listsBS.RaiseListChangedEvents = true;
            _listsBS.ResetBindings(false);

            _checkedCountLists = 0;
            _checkedCountDocs  = 0;

            checkedPacketCountBox.Text = _checkedCountLists.ToString();
            chekedDocCountBox.Text     = _checkedCountDocs.ToString();

            DisableCheckBoxInPacketView();
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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;
        }