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("Проверьте введенные данные", "Ошибка"); } }
private void complite_Click(object sender, EventArgs e) { pictureBox1.Image.Save($@"{Application.StartupPath}\FilmsImage\{ImageName}.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg); string imageIndex = ImageName.ToString(); int price = Convert.ToInt32(priceTextBox.Text); string request = $"INSERT INTO Films ([Код], [Название], [Описание], [Цена], [Режиссёр], [Страна]) VALUES (" + $"'" + imageIndex + "'," + " '" + nameTextBox.Text + "'," + " '" + descriptRichBox.Text + "'," + " '" + price + "'," + " '" + directorTextBox.Text + "'," + " '" + CountryTextBox.Text + "')"; TableMenager moviesTable = new TableMenager(); moviesTable.ExecuteRequest(request); MessageBox.Show("Фильм добавлен!", "Готово"); this.Close(); }
public override string ToString() { return($"CommandName: {(CommandName!=null? CommandName.ToString(): "")}, CharName {(Character!=null? Character.ToString(): "") }, ImageName: {(ImageName!=null? ImageName.ToString() : "")}, Expression: {(Expression!=null? Expression.ToString(): "")}, StagePosition: {(Position!=null? Position.ToString():"")}, Args: {(Args!=null? Args.ToString():"")}"); }