public bool SaveForecastFact(TransVoltageCustForecastLoadFact fact) { TransVoltageCustForecastLoadFact f = null; if (fact == null) { return(false); } if (fact.Id != 0) { f = this.Context.TransVoltageCustForecastLoadFacts.FirstOrDefault(x => x.Id == fact.Id); } if (fact.Id != 0 && f != null) { f.LoadMeasure = fact.LoadMeasure; f.TimePeriodId = fact.TimePeriodId; f.TransmissionVoltageCustomerId = fact.TransmissionVoltageCustomerId; } else { this.Context.TransVoltageCustForecastLoadFacts.InsertOnSubmit(fact); } this.Context.SubmitChanges(); return(true); }
public bool SaveMeasures(TransVoltageCustForecastLoadFact fact) { var t = this.Context.TransVoltageCustForecastLoadFacts.FirstOrDefault(x => x.Id == fact.Id); return(true); }