コード例 #1
0
        private void listView1_DoubleClick(object sender, EventArgs e)
        {
            if (listView1.SelectedIndices.Count == 0)
            {
                return;
            }
            Advertisement        advertisement1       = (Advertisement)listView1.SelectedItems[0].Tag;
            AddAdvertisementForm addAdvertisementForm = new AddAdvertisementForm(dB, categoryDB, countryDB, discoveredDB, advertisement1, 0);

            addAdvertisementForm.ShowDialog();
            viewer.ViewData(paginator.ShowRows);
        }
コード例 #2
0
        private void добавитьОбъявлениеToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var categories = categoryDB.GetList();
            var countries  = countryDB.GetList();

            if (categories.Count == 0)
            {
                MessageBox.Show("Вы ещё не создали категорию!");
                return;
            }
            else if (countries.Count == 0)
            {
                MessageBox.Show("Вы ещё не добавили страну!");
                return;
            }
            AddAdvertisementForm addAdvertisementForm = new AddAdvertisementForm(dB, categoryDB, countryDB, discoveredDB, dB.Add(), 1);

            addAdvertisementForm.ShowDialog();
            dB.Save();
            viewer.ViewData(paginator.ShowRows);
        }