private void btnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (grdAmenitiesMasterView.FocusedRowHandle < 0)
            {
                return;
            }
            if (BsfGlobal.FindPermission("Amenities Master-Delete") == false)
            {
                MessageBox.Show("You don't have Rights to Amenities Master-Delete");
                return;
            }
            int iAId = Convert.ToInt32(CommFun.IsNullCheck(grdAmenitiesMasterView.GetRowCellValue(grdAmenitiesMasterView.FocusedRowHandle, "AmenityId").ToString(), CommFun.datatypes.vartypenumeric));

            if (ProjectInfoDL.CheckAmenityUsed(iAId) == true)
            {
                MessageBox.Show("Amenity Used, Do not Delete");
                return;
            }

            if (MessageBox.Show("Do You want to Delete Row?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                ProjectInfoDL.DeleteAmenitiesMaster(iAId);
                grdAmenitiesMasterView.DeleteRow(grdAmenitiesMasterView.FocusedRowHandle);
            }
        }
Exemple #2
0
 public static void DeleteAmenitiesMaster(int argAId)
 {
     ProjectInfoDL.DeleteAmenitiesMaster(argAId);
 }