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 AddWarehouse : Form
    {
        public AddWarehouse()
        {
            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 Nomer_Sklada = textBox1.Text;
                var Adress = textBox2.Text;
                var Opisanie = textBox3.Text;

                var add = $"INSERT INTO Sklad (Nomer_Sklada, Adress, Opisanie) VALUES ('{Nomer_Sklada}', '{Adress}', {Opisanie})";
                var command = new MySqlCommand(add, connection);
                command.ExecuteNonQuery();


                connection.Close();
            }
        }
    }
}
