using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace ekz_lednev
{
    public partial class FormNewDop : Form
    {
        public FormNewDop()
        {
            InitializeComponent();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Заполните все поля по списку и нажмите кнопку добавить, ваш товар добавлен!");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DB dB = DB.GetInstance();
            MySqlCommand cmd = new MySqlCommand($@"INSERT INTO `pozorisp_lednev_ekz`.`product_type` (`name`, `coefficent`) VALUES ('{textBox6.Text}', '{textBox7.Text}');", dB.GetConnection());
            cmd.ExecuteNonQuery();

            MessageBox.Show("Добавлено!");
            Application.Restart();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Application.Restart();
            this.Close();
        }
    }
}
