Exemplo n.º 1
0
        public void RefreshDG()
        {
            newDBcon.RefreshDataTable();
            DataView IsPresentView = new DataView(newDBcon.GetDataTable("spec"));

            IsPresentView.RowFilter = "is_present = true";
            dgListPerson.DataSource = IsPresentView;
            labelHelp.Text          = "Загружено записей: " + dgListPerson.RowCount;
        }
Exemplo n.º 2
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            backgroundWorker.ReportProgress(0, "Загрузка данных...");

            newDBcon = new MainDBConnect(IVRShared.GetDBPath());

            IsPresentView           = new DataView(newDBcon.GetDataTable("spec"));
            IsPresentView.RowFilter = "is_present = true";

            backgroundWorker.ReportProgress(100, "Загрузка завершена!");
        }
Exemplo n.º 3
0
        private void SetCBFields()
        {
            cbEducation.DataSource    = dbCon.GetDataTable("spr_edu");
            cbEducation.DisplayMember = "name";
            cbEducation.ValueMember   = "id";

            cbProfession.DataSource    = dbCon.GetDataTable("spr_profession");
            cbProfession.DisplayMember = "name";
            cbProfession.ValueMember   = "id";

            cbMstatus.DataSource    = dbCon.GetDataTable("spr_mstatus");
            cbMstatus.DisplayMember = "name";
            cbMstatus.ValueMember   = "id";

            cbNation.DataSource    = dbCon.GetDataTable("spr_nation");
            cbNation.DisplayMember = "name";
            cbNation.ValueMember   = "id";

            cbParty.DataSource    = dbCon.GetDataTable("spr_party_number");
            cbParty.DisplayMember = "name";
            cbParty.ValueMember   = "id";

            toolTip1.SetToolTip(bnPeriod, "Заполнить");
        }
Exemplo n.º 4
0
        public KartArchiveForm()
        {
            InitializeComponent();
            RegistryKey regKey = Registry.CurrentUser;

            regKey   = regKey.OpenSubKey("Software\\UFSIN\\ivrJournal");
            newDBcon = new MainDBConnect(regKey.GetValue("dbPath", "").ToString());

            DataGridViewTextBoxColumn textColumn = new DataGridViewTextBoxColumn();

            {
                textColumn.DataPropertyName = "id";
                textColumn.HeaderText       = "код";
                textColumn.Width            = 30;
                textColumn.MinimumWidth     = 50;
                textColumn.Visible          = false;
                textColumn.AutoSizeMode     = DataGridViewAutoSizeColumnMode.None;
            }
            dgArchive.Columns.Add(textColumn);

            textColumn = new DataGridViewTextBoxColumn();
            {
                textColumn.DataPropertyName = "last_name";
                textColumn.HeaderText       = "Фамилия";
                textColumn.Width            = 100;
                textColumn.MinimumWidth     = 90;
                textColumn.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            }
            dgArchive.Columns.Add(textColumn);

            textColumn = new DataGridViewTextBoxColumn();
            {
                textColumn.DataPropertyName = "first_name";
                textColumn.HeaderText       = "Имя";
                textColumn.Width            = 100;
                textColumn.MinimumWidth     = 90;
                textColumn.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            }
            dgArchive.Columns.Add(textColumn);

            textColumn = new DataGridViewTextBoxColumn();
            {
                textColumn.DataPropertyName = "patronymic";
                textColumn.HeaderText       = "Отчество";
                textColumn.Width            = 100;
                textColumn.MinimumWidth     = 90;
                textColumn.AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
            }
            dgArchive.Columns.Add(textColumn);

            textColumn = new DataGridViewTextBoxColumn();
            {
                textColumn.DataPropertyName = "birthdate";
                textColumn.HeaderText       = "Дата рождения";
                textColumn.Width            = 80;
                textColumn.MinimumWidth     = 80;
                textColumn.AutoSizeMode     = DataGridViewAutoSizeColumnMode.None;
            }
            dgArchive.Columns.Add(textColumn);

            DataView IsPresentView = new DataView(newDBcon.GetDataTable("spec"));

            IsPresentView.RowFilter       = "is_present = false";
            dgArchive.AutoGenerateColumns = false;

            dgArchive.DataSource = IsPresentView;

            labelHelp.Text = "Загружено записей: " + dgArchive.RowCount;

            toolTip1.SetToolTip(bnUnDelete, "Восстановить из архива");
            toolTip1.SetToolTip(bnClose, "Закрыть форму");

            SetRights();
        }