Esempio n. 1
0
        private void okButton_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length != 0 && textBox2.Text.Length != 0 && textBox3.Text.Length != 0 &&
                textBox4.Text.Length != 0 && textBox5.Text.Length != 0 && textBox6.Text.Length != 0 &&
                textBox7.Text.Length != 0 && textBox8.Text.Length != 0 && textBox9.Text.Length != 0)
            {
                Seller seller = new Seller
                {
                    Name        = textBox1.Text,
                    INN         = textBox2.Text,
                    KPP         = textBox3.Text,
                    Adress      = textBox4.Text,
                    Sender      = textBox5.Text,
                    CheckingAcc = textBox6.Text,
                    BIK         = textBox7.Text,
                    BankName    = textBox8.Text,
                    CorpAcc     = textBox9.Text
                };
                DbEditor.AddSeller(seller);

                Form1 MainForm = (Form1)this.Owner;
                MainForm.comboBox1.Items.Clear();
                MainForm.comboBox1.Items.AddRange(DbEditor.GetAllSellers());
                this.Hide();
            }
            else
            {
                MessageBox.Show("Присутствуют незаполненные поля", "Внимание",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }
Esempio n. 2
0
        public Form1()
        {
            InitializeComponent();



            AddToolStripMenuItem.Click    += new EventHandler(OnAddItem);
            RemoveToolStripMenuItem.Click += new EventHandler(RemoveItem);

            // Подгрузка из БД продавцов
            comboBox1.Items.Clear();
            comboBox1.Items.AddRange(DbEditor.GetAllSellers());

            // Подгрузка из БД покупателей
            comboBox2.Items.Clear();
            comboBox2.Items.AddRange(DbEditor.GetAllCustomers());

            // Подгрузка из БД валюты
            comboBox3.Items.Clear();
            comboBox3.Items.AddRange(DbEditor.GetAllCurrency());
            //contextMenu.Click += new EventHandler(OnAddItem);
        }