Ejemplo n.º 1
0
        private void ClientsForm_Load(object sender, EventArgs e)
        {
            // TODO: данная строка кода позволяет загрузить данные в таблицу "computerByteDataBaseDataSet2.Clients". При необходимости она может быть перемещена или удалена.
            this.clientsTableAdapter.Fill(this.computerByteDataBaseDataSet2.Clients);

            gridViewControll.Update(clientsGridView, "Clients");
        }
        public SaleComputersForm()
        {
            InitializeComponent();

            saleComputers = this;

            _viewControll.Update(computersDataGridView, "Computers");
            _viewControll.Update(clientsDataGridView, "Clients");
        }
        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("Проверьте введенные данные", "Ошибка");
            }
        }
Ejemplo n.º 4
0
        public AssortmentForm()
        {
            InitializeComponent();

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

            gridViewControll.Update(assortmentTable, "Computers");
        }
        private void deleteButton_Click(object sender, EventArgs e)
        {
            try
            {
                string request = $@"Delete * From Employees WHERE код = {employeesDataGridView[0, SelectRow].Value}";
                new TableMenager().ExecuteRequest(request);

                gridViewControll.Update(employeesDataGridView, "Employees");
            }
            catch (Exception)
            {
                MessageBox.Show("Нельзя удалить", "Внимание!");
            }
        }
Ejemplo n.º 6
0
 private void update_Click(object sender, EventArgs e)
 {
     gridViewControll.Update(assortmentTable, "Computers");
 }
        private void AddingComputerForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            DataGridViewControll gridViewControll = new DataGridViewControll();

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