Exemplo n.º 1
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            int            statusID   = Convert.ToInt32(lblStatusID.Text);
            AdminEquipment adminEquip = new AdminEquipment(lblYearID.Text, lblYear.Text, statusID, lblStatus.Text);

            adminEquip.Show();
            this.Close();
        }
Exemplo n.º 2
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            if (txtNewEquipmentName.Text == "" || txtNewEquipmentCost.Text == "")
            {
                MessageBox.Show("Please fill up the form!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            else
            {
                decimal EquipmentCost = Convert.ToDecimal(txtNewEquipmentCost.Text);
                int     YearID        = Convert.ToInt32(lblYearID.Text);
                int     statusID      = Convert.ToInt32(lblStatusID.Text);

                myData.AddEquipment(txtNewEquipmentName.Text, EquipmentCost, YearID); //Parameters to pass to DataAccess class

                MessageBox.Show("Equipment Added!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);

                AdminEquipment adminEquip = new AdminEquipment(lblYearID.Text, lblYear.Text, statusID, lblStatus.Text);
                adminEquip.Show();
                this.Close();
            }
        }