public void RowCalculate(ref Substation_Info obj) { foreach (GridColumn gc in GridView.Columns) { if (gc.FieldName.Substring(0, 1) == "S") { PSP_ExpressionCalculator express = new PSP_ExpressionCalculator(); express.FiledName = gc.FieldName; express.Flag = Expressiontype; IList <PSP_ExpressionCalculator> listtemp = Services.BaseService.GetList <PSP_ExpressionCalculator>("SelectPSP_ExpressionCalculatorByFiledNameFlag", express); if (listtemp != null) { if (listtemp.Count > 0) { ExpressionCalculator ca = new ExpressionCalculator(); if (!ca.RowCalculator(listtemp[0].Expression, this.gridView, ref obj, gc.FieldName, listtemp[0].SaveDecimalPoint)) { break; } } } } } Services.BaseService.Update <Substation_Info>(obj); }
public void Calculate(string filedname, string StrExpressiontemp, int SaveDecimalPoint) { if (ObjectList == null) { return; } IList <Substation_Info> listtemp = ObjectList; ExpressionCalculator ca = new ExpressionCalculator(); if (ca.RowCalculator(StrExpressiontemp, this.gridView, ref listtemp, filedname, SaveDecimalPoint)) { RowCalculate(ref listtemp); //刷新表格,并将焦点行定位到新对象上。 } else { foreach (Substation_Info Subtemp in listtemp) { Services.BaseService.Update <Substation_Info>(Subtemp); } } gridControl.RefreshDataSource(); }