コード例 #1
0
        private void PublishingFill()   //заполнение combo box данными из базы данных
        {
            DBTables dbTables = new DBTables();

            Action action = () =>
            {
                try
                {
                    dbTables.DTPublishing.Clear();
                    dbTables.DTPublishingFill();
                    dbTables.dependency.OnChange += ChangeDataPublishing;

                    cbPublishing.DataSource    = dbTables.DTPublishing;
                    cbPublishing.ValueMember   = "ID_Publishing_Book";
                    cbPublishing.DisplayMember = "Publishing";
                    cbPublishing.SelectedValue = -1;
                }
                catch
                {
                    MessageBox.Show(MessageUser.ErrorLoadingData, MessageUser.TitleError, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            };

            Invoke(action);
        }
コード例 #2
0
        private void PublishingBookFill() //заполнение combo box данными из базы данных
        {
            DBTables dbTables = new DBTables();

            Action action = () =>
            {
                dbTables.DTPublishing.Clear();
                dbTables.DTPublishingFill();
                dbTables.dependency.OnChange += ChangeDataPublishing;

                ltbPublishing.DataSource    = dbTables.DTPublishing;
                ltbPublishing.ValueMember   = "ID_Publishing_Book";
                ltbPublishing.DisplayMember = "Publishing";
            };

            Invoke(action);
        }