예제 #1
0
        private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (BsfGlobal.FindPermission("Stage Details-Delete") == false)
            {
                MessageBox.Show("You don't have Rights to Stage Details-Delete");
                return;
            }

            if (grdViewStage.FocusedRowHandle >= 0)
            {
                int  iStageDetId = Convert.ToInt32(grdViewStage.GetFocusedRowCellValue("StageDetId").ToString());
                bool b_PB        = UnitDirBL.CheckPBStage(iStageDetId);
                if (b_PB == true)
                {
                    MessageBox.Show("Progress Bill Raised, Could not Delete", "Delete", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return;
                }

                DialogResult result1 = MessageBox.Show("Are you sure", "Stage Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result1 == DialogResult.Yes)
                {
                    UnitDirBL.DeleteStage(iStageDetId);
                    grdViewStage.DeleteRow(grdViewStage.FocusedRowHandle);
                }
            }
        }