Esempio n. 1
0
        /// <summary>
        /// Delete
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int          DepartmentId = Convert.ToInt32(dgvDepartment.CurrentRow.Cells["DepartmentId"].Value);
            string       Name         = dgvDepartment.CurrentRow.Cells["Name"].Value.ToString();
            DialogResult dialogResult = MessageBox.Show(btnDelete, "Are you really want to Delete Name:" + Name, "Confirmation", MessageBoxButtons.OKCancel);

            if (dialogResult == DialogResult.OK)
            {
                DepartmentService.DeleteDepartmentById(DepartmentId);
                ReloadForm();
            }
        }