private void registrationButton_Click(object sender, EventArgs e)
        {
            try
            {
                int discount = Convert.ToInt32(discountTextBox.Text);

                string cmdText = $"INSERT INTO Clients ([Фамилия], [Имя], [Отчество], [Адрес], [Паспорт], [Дата регистрации], [Мобильный телефон], [Предоставить скидку], [Предпологаемый месяц], [Средняя зарплата]) VALUES (" +
                                 $"'" + lastNameTextBox.Text + "'," +
                                 " '" + firstNameTextBox.Text + "'," +
                                 " '" + patronymicTextBox.Text + "'," +
                                 " '" + adressTextBox.Text + "'," +
                                 " '" + pasportTextBox.Text + "'," +
                                 " '" + DateTime.Now + "'," +
                                 " '" + phoneTextBox.Text + "'," +
                                 " '" + discount + "'," +
                                 " '" + monthСomboBox.Text + "'," +
                                 " '" + profitTextBox.Text + "')";

                new ColculateStatistick().AddClient(int.Parse(profitTextBox.Text));

                TableMenager tableMenager = new TableMenager();
                tableMenager.ExecuteRequest(cmdText);

                DataGridViewControll gridViewControll = new DataGridViewControll();
                gridViewControll.Update(DataGrid, "Clients");

                MessageBox.Show("Готово!", "Внимание!");
            }
            catch (Exception)
            {
                MessageBox.Show("Проверьте введенные данные", "Ошибка");
            }
        }
Example #2
0
        public AssortmentForm()
        {
            InitializeComponent();

            pictureBox1.Image = Image.FromFile($@"{Application.StartupPath}\ComputerImages\0.jpeg");
            gridViewControll  = new DataGridViewControll();

            gridViewControll.Update(assortmentTable, "Computers");
        }
        public ClientsForm()
        {
            InitializeComponent();

            gridViewControll = new DataGridViewControll();
        }
        public EmployeManagmentForm()
        {
            InitializeComponent();

            gridViewControll = new DataGridViewControll();
        }
        private void AddingComputerForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            DataGridViewControll gridViewControll = new DataGridViewControll();

            gridViewControll.Update(AssortmentDataGrid, "Computers");
        }