Ejemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            Tafe_DataTier dt = new Tafe_DataTier();

            if (this.validateData())
            {
                try
                {
                    int rowsInserted = dt.insertCourse(txtID.Text, txtName.Text, Decimal.Parse(txtCost.Text));
                    if (rowsInserted > 0)
                    {
                        MessageBox.Show("New Course Information Saved", "Add Course", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("New Course Information NOT Saved", "Add Course", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "ERROR");
                }
            }
        }