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("Проверьте введенные данные", "Ошибка"); } }
private void complite_Click(object sender, EventArgs e) { try { if (pictureBox1.Image != null) { pictureBox1.Image.Save($@"{Application.StartupPath}\ComputerImages\{ImageName}.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg); } else { MessageBox.Show("Добавьте изображение", "Ошибка"); } string imageIndex = ImageName.ToString(); int price = Convert.ToInt32(priceTextBox.Text); int guarante = Convert.ToInt32(guaranteTextBox.Text); string request = $"INSERT INTO Computers ([Код], [Производитель], [Материнская плата], [ОЗУ], [ПЗУ], [Блок питания], [Видеокарта], [Процессор], [Цена], [Гарантия]) VALUES (" + $"'" + imageIndex + "'," + " '" + manufacturTextBox.Text + "'," + " '" + motherboardTextBox.Text + "'," + " '" + OZUtextBox.Text + "'," + " '" + PZUtextBox.Text + "'," + " '" + powerSupplyTextBox.Text + "'," + " '" + graphicsCardTextBox.Text + "'," + " '" + CPUTextBox.Text + "'," + " '" + price + "'," + " '" + guarante + "')"; TableMenager computersTable = new TableMenager(); computersTable.ExecuteRequest(request); MessageBox.Show("Компьютер добавлен!", "Готово"); this.Close(); } catch (Exception) { MessageBox.Show("Проверьте введенные данные", "Ошибка"); } }
public StatisticksForm() { InitializeComponent(); _tableMenager = new TableMenager(); }