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); } }
private void UpdateValues() { DataTable dt = new DataTable(); DataTable dtM = new DataTable(); dtM = grdCheck.DataSource as DataTable; DataView dv = new DataView(dtM); if (m_sBussinessType == "L") { if (dtM != null) { if (selection.SelectedCount == 0) { //dt = null; //dtLand = dt; dt = dtM; dtLand = null; } else if (selection.SelectedCount == dtM.Rows.Count) { dt = dtM; dtLand = dt; } else { string s = ""; for (int i = 0; i < dtM.Rows.Count; i++) { bool j = Convert.ToBoolean(selection.IsRowSelected(i).ToString()); if (j == true) { s = s + dtM.Rows[i]["CheckListId"].ToString() + ","; } } dv.RowFilter = "CheckListId In(" + s.TrimEnd(',') + ")"; dt = dv.ToTable(); dtLand = dt; dt = dtM; } } bool bChk = false; if (dtLand != null) { if (dtLand.Rows.Count == dtM.Rows.Count) { } else { bChk = true; } } if (bChk == false && bChkAlertSend == true) { bFinal = true; } } else { if (dtM != null) { if (selection.SelectedCount == 0) { dt = dtM; for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["Status"] = false; } } else if (selection.SelectedCount == dtM.Rows.Count) { dt = dtM; for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["Status"] = true; } } else { string s = ""; for (int i = 0; i < dtM.Rows.Count; i++) { bool j = Convert.ToBoolean(selection.IsRowSelected(i).ToString()); if (j == true) { s = s + dtM.Rows[i]["CheckListId"].ToString() + ","; dtM.Rows[i]["Status"] = true; } else { dtM.Rows[i]["Status"] = false; } } //dv.RowFilter = "CheckListId In(" + s.TrimEnd(',') + ")"; //dt = dv.ToTable(); dt = dtM; } } bool bChk = false; if (dt != null) { for (int i = 0; i < dt.Rows.Count; i++) { if (Convert.ToBoolean(CommFun.IsNullCheck(dt.Rows[i]["Status"])) == true) { } else { bChk = true; } } } if (bChk == false && bChkAlertSend == true) { bFinal = true; } } if (m_sType == "ProjectInfo" && m_sCType != "") { if (dt.Rows.Count > 0) { UnitDirBL.InsertProjCheckList(dt, m_iId); } } else if (m_sType == "FlatType" && m_sCType != "") { if (dt.Rows.Count > 0) { UnitDirBL.InsertFlatTypeCheckList(dt, m_iId, m_sCType); } } else if (m_sType == "Flat" && m_sCType != "") { if (dt.Rows.Count > 0) { UnitDirBL.InsertFlatCheckList(dt, m_iId, m_sCType, bFinal, m_icostCentreId, m_sFlatNo); grdCheckView.FocusedRowHandle = grdCheckView.FocusedRowHandle - 1; if (m_bRegAns == false) { DialogResult Result = MessageBox.Show("Do you Want to Update Buyer Name?", "CRM", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (Result == DialogResult.Yes) { UnitDirBL.UpdateBuyerName(m_iLeadId, CommFun.IsNullCheck(txtBuyerName.EditValue, CommFun.datatypes.vartypestring).ToString(), CommFun.IsNullCheck(txtCoAppli.EditValue, CommFun.datatypes.vartypestring).ToString()); } } } } else if (m_sType == "Project" && m_sCType != "") { if (dt.Rows.Count > 0) { UnitDirBL.InsertProjCheckListFlat(dt, m_iId, m_sCType); } } else if (m_sType == "Final" && m_sCType == "") { if (dt.Rows.Count > 0) { dtFinal = dt; } } else if (m_sType == "Cancel" && m_sCType != "") { dtCancel = dt; } }