public void UpdateHROTFactor() { EmployeePayRollFormulaEntities entity = (EmployeePayRollFormulaEntities)CurrentModuleEntity; HROTFactorsInfo objHROTFactorsInfo = (HROTFactorsInfo)entity.OTFactorsList[entity.OTFactorsList.CurrentIndex]; if (objHROTFactorsInfo.FK_ADOTFactorID > 0) { ADOTFactorsController objADOTFactorsController = new ADOTFactorsController(); ADOTFactorsInfo objADOTFactorsInfo = (ADOTFactorsInfo)objADOTFactorsController.GetObjectByID(objHROTFactorsInfo.FK_ADOTFactorID); if (objADOTFactorsInfo != null) { objHROTFactorsInfo.FK_ADOTFactorID = objADOTFactorsInfo.ADOTFactorID; objHROTFactorsInfo.HROTFactorValue = objADOTFactorsInfo.ADOTFactorValue; objHROTFactorsInfo.HROTFactorType = objADOTFactorsInfo.ADOTFactorType; } } entity.OTFactorsList.GridControl.RefreshDataSource(); }
void gridView_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e) { if (e.Column.FieldName == "FK_ADOTFactorID") { if (e.Value != null) { int matchCodeID = int.Parse(e.Value.ToString()); ADOTFactorsController objOTFactorsController = new ADOTFactorsController(); ADOTFactorsInfo objOTFactorsInfo = (ADOTFactorsInfo)objOTFactorsController.GetObjectByID(matchCodeID); if (objOTFactorsInfo != null) { e.DisplayText = objOTFactorsInfo.ADOTFactorName; } else { e.DisplayText = ""; } } else { e.DisplayText = ""; } } }