예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            ado_project db = new ado_project();

            try
            {
                string name             = textBox3.Text;
                string code             = textBox1.Text;
                string description      = textBox2.Text;
                Int64  unit_value       = Int64.Parse(maskedTextBox1.Text);
                Int64  current_quntaty  = Int64.Parse(maskedTextBox2.Text);
                Int64  ideal_quntaty    = Int64.Parse(maskedTextBox3.Text);
                Int64  warnning_quntaty = Int64.Parse(maskedTextBox4.Text);
                db.insert_items(code, name, description, unit_value, current_quntaty, ideal_quntaty, warnning_quntaty);
                MessageBox.Show("Done");
            }
            catch (Exception)
            { MessageBox.Show("Try Again"); }

            textBox3.Text       = "";
            textBox1.Text       = "";
            textBox2.Text       = "";
            maskedTextBox1.Text = "";
            maskedTextBox2.Text = "";
            maskedTextBox3.Text = "";
            maskedTextBox4.Text = "";

            Form1 f = new Form1();

            f.Refresh();
        }