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;

namespace KursovayaDvornikovAM
{
    public partial class AddProvider : Form
    {
        public AddProvider()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string connect = "server=cfif31.ru;user=ISPr24-37_DvornikovAM;database=ISPr24-37_DvornikovAM_Kursovaya;password=ISPr24-37_DvornikovAM";

            MySqlConnection connection = new MySqlConnection(connect);
            {
                connection.Open();


                var Compania = textBox1.Text;
                var Name = textBox2.Text;
                var Postavka = textBox3.Text;
                var Koli4esnvoPostavok = textBox4.Text;

                var add = $"INSERT INTO Postavshik (Compania, Name, Postavka, Koli4esnvoPostavok) VALUES ('{Compania}', '{Name}', {Postavka},{Koli4esnvoPostavok})";
                var command = new MySqlCommand(add, connection);
                command.ExecuteNonQuery();


                connection.Close();
            }
        }
    }
}
