예제 #1
0
        protected void btnManageAdd(object sender, EventArgs e)
        {
            try
            {
                //Error for input string not found
                DAL.EquipmentTypeClass equipment = new DAL.EquipmentTypeClass(txtDescription.Text);
                int x = bll.AddEquipmentType(equipment);

                if (x > 0)
                {
                    txtDescription.Text = "";
                }
                else
                {
                }
            }
            catch
            {
            }

            dgEquipmentType.DataSource = bll.GetEquipmentType();
            dgEquipmentType.DataBind();
        }
예제 #2
0
        private void BtnManageAdd_Click(object sender, EventArgs e)
        {
            try
            {
                //Error for input string not found
                DAL.EquipmentTypeClass equipment = new DAL.EquipmentTypeClass(txtEquipmentType.Text);
                int x = bll.AddEquipmentType(equipment);

                if (x > 0)
                {
                    txtEquipmentType.Clear();
                }
                else
                {
                    MessageBox.Show("Please input valid data.");
                }
            }
            catch
            {
                MessageBox.Show("Please input valid data.");
            }

            dgvEquipmentDetails.DataSource = bll.GetEquipmentType();
        }