Exemplo n.º 1
0
        protected void btnManageAdd(object sender, EventArgs e)
        {
            try
            {
                DAL.TaskTypeClass task = new DAL.TaskTypeClass(DAL.TaskTypeClass.TaskTypeCode, txtName.Text);
                int x = bll.AddTaskType(task);

                if (x > 0)
                {
                    txtName.Text = " ";
                }
                else
                {
                }
            }
#pragma warning disable CS0168 // The variable 'b' is declared but never used
            catch (Exception b)
#pragma warning restore CS0168 // The variable 'b' is declared but never used
            {
            }
            dgTaskType.DataSource = bll.GetTasktype();
            dgTaskType.DataBind();
        }
Exemplo n.º 2
0
        private void BtnManageAdd_Click(object sender, EventArgs e)
        {
            try
            {
                DAL.TaskTypeClass task = new DAL.TaskTypeClass(DAL.TaskTypeClass.TaskTypeCode, txtName.Text);
                int x = bll.AddTaskType(task);

                if (x > 0)
                {
                    txtName.Clear();
                }
                else
                {
                    MessageBox.Show("Please input valid data.");
                }
            }
#pragma warning disable CS0168 // The variable 'b' is declared but never used
            catch (Exception b)
#pragma warning restore CS0168 // The variable 'b' is declared but never used
            {
                MessageBox.Show("Please input valid data.");
            }
            dgvTaskType.DataSource = bll.GetTasktype();
        }