Esempio n. 1
0
        private void BtnManageUpdate_Click(object sender, EventArgs e)
        {
            dgvTaskType.DataSource      = bll.GetTasktype();
            dgvTaskType.BackgroundColor = Color.White;

            try
            {
                DAL.TaskTypeClass task = new DAL.TaskTypeClass(DAL.TaskTypeClass.TaskTypeCode, txtName.Text);
                int x = bll.UpdateTaskType(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();
        }
Esempio n. 2
0
        private void dgvTaskType_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                DAL.TaskTypeClass taskType = new DAL.TaskTypeClass(int.Parse(dgvTaskType.SelectedRows[0].Cells[0].Value.ToString()));

                var value = bll.SelectedForUpdateTaskType(taskType);

                txtName.Text = value.Rows[0].Table.Rows[0].ItemArray[1].ToString();
            }
#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
            {
            }
        }
Esempio n. 3
0
        protected void dgTaskType_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                DAL.TaskTypeClass taskType = new DAL.TaskTypeClass(int.Parse(dgTaskType.SelectedItem.Cells[1].Text.ToString()));

                var value = bll.SelectedForUpdateTaskType(taskType);

                txtName.Text = value.Rows[0].Table.Rows[0].ItemArray[1].ToString();
            }
#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
            {
            }
        }
Esempio n. 4
0
        protected void btnManageUpdate(object sender, EventArgs e)
        {
            try
            {
                DAL.TaskTypeClass task = new DAL.TaskTypeClass(DAL.TaskTypeClass.TaskTypeCode, txtName.Text);
                int x = bll.UpdateTaskType(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();
        }