コード例 #1
0
        private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (BsfGlobal.FindPermission("Request-Delete") == false)
            {
                MessageBox.Show("No Rights to Delete Request", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            int RequestId = Convert.ToInt32(clsStatics.IsNullCheck(ReqListView.GetFocusedRowCellValue("RequestId").ToString(), clsStatics.datatypes.vartypenumeric));
            int argCCId   = Convert.ToInt32(clsStatics.IsNullCheck(ReqListView.GetFocusedRowCellValue("CostCentreId"), clsStatics.datatypes.vartypenumeric));

            if (RequestEntryBL.ValidDelete(RequestId) == true)
            {
                if (MessageBox.Show("Are you sure want to Delete this Register", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString() == "Yes")
                {
                    RequestEntryBL.DeleteRegister(RequestId, argCCId);
                    ReqListView.DeleteRow(ReqListView.FocusedRowHandle);
                }
            }
            else
            {
                MessageBox.Show("Already Used. Do Not Delete!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }