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 Mip { public partial class frmAddMat : Form { public frmAddMat() { InitializeComponent(); } private void button2_Click(object sender, EventArgs e) { this.Close(); } private void textBox1_TextChanged(object sender, EventArgs e) { if (textBox1.Text == "") button1.Enabled = false; else button1.Enabled = true; } private void button1_Click(object sender, EventArgs e) { string cmd; cmd = @"INSERT INTO `tabmaterial` (`Nazov`, `Typ`, `Hustota`) VALUES ('" + textBox1.Text + "', '" + textBox2.Text + "', " + myNumericUpDown1.Value.ToString().Replace(",", ".") + ");"; classSQL.SQL(cmd); this.Close(); } } }