private void grdLevelBlockView_Click(object sender, EventArgs e) { if (selection.SelectedCount == 0) { for (int j = 0; j < grdLevelBlockView.RowCount; j++) { BOStageDetails.i_LevelBlockId = Convert.ToInt32(CommFun.IsNullCheck(grdLevelBlockView.GetRowCellValue(j, "LevelId"), CommFun.datatypes.vartypenumeric)); BOStageDetails.i_BlockId = Convert.ToInt32(CommFun.IsNullCheck(grdBlockView.GetRowCellValue(grdBlockView.FocusedRowHandle, "BlockId"), CommFun.datatypes.vartypenumeric)); StageDetBL.DeleteLevelBlock(BOStageDetails); } } else { for (int i = 0; i < selection.SelectedCount; i++) { BOStageDetails.i_LevelBlockId = Convert.ToInt32(CommFun.IsNullCheck(grdLevelBlockView.GetRowCellValue(i, "LevelId"), CommFun.datatypes.vartypenumeric)); BOStageDetails.i_BlockId = Convert.ToInt32(CommFun.IsNullCheck(grdBlockView.GetRowCellValue(grdBlockView.FocusedRowHandle, "BlockId"), CommFun.datatypes.vartypenumeric)); if (BOStageDetails.i_LevelBlockId != 0 || BOStageDetails.i_BlockId != 0) { StageDetBL.DeleteLevelBlock(BOStageDetails); StageDetBL.InsertLevelBlock(BOStageDetails); } else { MessageBox.Show("Please Select Block Name", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } } }
private void grdLevelBlockView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { BOStageDetails.i_LevelBlockId = Convert.ToInt32(CommFun.IsNullCheck(grdLevelBlockView.GetRowCellValue(grdLevelBlockView.FocusedRowHandle, "LevelId"), CommFun.datatypes.vartypenumeric)); BOStageDetails.i_BlockId = Convert.ToInt32(CommFun.IsNullCheck(grdBlockView.GetRowCellValue(grdBlockView.FocusedRowHandle, "BlockId"), CommFun.datatypes.vartypenumeric)); if (selection.IsRowSelected(grdLevelBlockView.FocusedRowHandle) == true) { if (BOStageDetails.i_LevelBlockId != 0 || BOStageDetails.i_BlockId != 0) { StageDetBL.DeleteLevelBlock(BOStageDetails); StageDetBL.InsertLevelBlock(BOStageDetails); } else { MessageBox.Show("Please Select Block Name", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } else { StageDetBL.DeleteLevelBlock(BOStageDetails); } }