Esempio n. 1
0
        private void but_DeleteStaff_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            string Message = string.Empty;

            if (!isValidateDeleteStaff(out Message))
            {
                MessageBox.Show(Message, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                int         handle        = Convert.ToInt32(gridView_StaffInfo.GetFocusedRowCellValue("StaffCode"));
                NhanVienBus _nhaVienBUS   = new NhanVienBus();
                string      deleteMessage = string.Empty;
                if (!_nhaVienBUS.DeleteStaff(handle, out deleteMessage))
                {
                    MessageBox.Show(deleteMessage, "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show(deleteMessage, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Search();
                }
            }
        }