public string GetAppsInfo(Entity.Graphics graDS) { var appids = (from i in graDS.Lines where i.IsShow == true select i.AppId).Distinct(); StringBuilder sb = new StringBuilder(); sb.Append("测点信息:\n"); foreach (var id in appids) { App app = DbContext.Apps.Where(s => s.Id == id).FirstOrDefault(); sb.Append(app.AppName).Append(" "); sb.Append("坐标 x y z:"); sb.Append(app.X).Append(" "); sb.Append(app.Y).Append(" "); sb.Append(app.Z).Append(" "); sb.Append("埋设时间:"); sb.Append(app.BuriedTime); sb.Append(" 备注:"); sb.Append(app.OtherInfo); sb.Append("\n"); } return(sb.ToString()); }
public Entity.Graphics CreateNewGraphicDS(App selApp) { string appName = selApp.AppName; AppIntegratedInfo appInfo = new AppIntegratedInfo(selApp, 0, null, null); var graDS = new Entity.Graphics(); // appInfo.CalcParams默认已排序 for (int i = 0; i < appInfo.CalcParams.Count; i++) { CalculateParam cp = appInfo.CalcParams[i]; var line = graDS.Lines.NewLinesRow(); line.AppName = appName; line.UnitSymbol = cp.UnitSymbol; line.AppId = cp.AppId; line.ParamName = cp.ParamName; line.LegendName = cp.ParamName; line.IsShow = true; line.ParamId = cp.Id; line.EndEdit(); graDS.Lines.AddLinesRow(line); } graDS.AcceptChanges(); return(graDS); }
public IEnumerable <CalculateValue> GetAllCalcValues(Entity.Graphics graDS) { var appids = (from i in graDS.Lines where i.IsShow == true select i.AppId).Distinct().ToList(); var values = DbContext.GetCalcValues(appids, 0, OffsetStart, OffsetEnd); return(values); }