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 frmPridatNastrojeDoSkladu : Form { public frmPridatNastrojeDoSkladu() { InitializeComponent(); } private void frmPridatNastrojeDoSkladu_Shown(object sender, EventArgs e) { classGlobal.FillCB(comboBox1, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať typ nástroja"); } private void button2_Click(object sender, EventArgs e) { this.Close(); } private void button1_Click(object sender, EventArgs e) { string cmd = ""; cmd = @"INSERT INTO `mip`.`tab-evidenciabruseni` (`Typ`, `Počet brúsení`, `Status`, `Dátum`) VALUES ('" + comboBox1.Text + "', " + "0" + ", " + "'Na sklade' , " + "DATE(NOW()) );"; for (int i=1; i<=numericUpDown1.Value; i++) classSQL.SQL(cmd); this.Close(); } private void button3_Click(object sender, EventArgs e) { Form Add = new frmAddPomUdaje(); Add.Text = "Pridať typ nástroja"; DialogResult dr = Add.ShowDialog(); if (dr == DialogResult.OK) { comboBox1.Items.Clear(); classGlobal.FillCB(comboBox1, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať typ nástroja"); comboBox1.Text = classGlobal.strNovyPomocnyUdaj; } } } }