private void b_ok_Click(object sender, EventArgs e)
        {
            MySqlConnection conn;
            conn = new MySqlConnection("Database=test;Data Source=localhost;User Id=user;Password=1234");
            conn.Open();
            string SQL_String = "INSERT INTO d_cabel_type (Name, Type, Voltage, Material, Climate) VALUES(@Name, @Type, @Voltage, @Material, @Climate)";
            MySqlCommand comm = new MySqlCommand(SQL_String, conn);
            comm.Connection = conn;
            comm.Parameters.AddRange(new MySqlParameter[] {
            new MySqlParameter("Name", MySqlDbType.VarChar, 25, "Name"),
            new MySqlParameter("Type", MySqlDbType.VarChar, 25, "Type"),
            new MySqlParameter("Voltage", MySqlDbType.VarChar, 25, "Voltage"),
            new MySqlParameter("Material", MySqlDbType.VarChar, 25, "Material"),
            new MySqlParameter("Climate", MySqlDbType.VarChar, 25, "Climate")});

            string type, material;

            if (rb_type_1.Checked) { type = "Круглые"; } else { type = "Секторные"; }
            if (rb_material_1.Checked) { material = "Медь"; } else { material = "Алюминий"; }

            comm.Parameters[0].Value = t_name.Text;
            comm.Parameters[1].Value = type;
            comm.Parameters[2].Value = t_voltage.Text;
            comm.Parameters[3].Value = material;
            comm.Parameters[4].Value = t_climate.Text;

            int rows = comm.ExecuteNonQuery();
            //conn.Close();

            MySqlCommand c = new MySqlCommand("SELECT ID FROM d_cabel_type WHERE (Name = '" + t_name.Text + "' AND Type = '" + type + "' AND Voltage = '" + t_voltage.Text + "' AND Material = '" + material + "' AND Climate = '" + t_climate.Text + "')", conn);
            MySqlDataReader dr;
            dr = c.ExecuteReader();

            while (dr.Read())
            {
                DataCabel.cabel_type_id = dr[0].ToString();
            }

            conn.Close();

            d_cabel_info d_info = new d_cabel_info();
            d_info.Show();

            this.Close();
        }
        private void b_open_Click(object sender, EventArgs e)
        {
            MySqlConnection conn;
            conn = new MySqlConnection("Database=test;Data Source=localhost;User Id=user;Password=1234");
            conn.Open();

            MySqlCommand c = new MySqlCommand("SELECT ID FROM d_cabel_type WHERE (Name = '" + cb_name.Text + "' AND Type = '" + cb_type.Text + "' AND Voltage = '" + cb_voltage.Text + "')", conn);
            MySqlDataReader dr;
            dr = c.ExecuteReader();

            while (dr.Read())
            {
                DataCabel.cabel_type_id = dr[0].ToString();
            }

            conn.Close();

            d_cabel_info d_info = new d_cabel_info();
            d_info.Show();
        }