public int ReceivePreliminaryLoadProfileShares(electricityProfile msgProfile) { Trace.WriteLine("ReceivePreliminaryLoadProfileShares"); int result = 0; try { DataManager dataMan = new DataManager(); dataMan.SaveProfile(msgProfile); result = 1; } catch (Exception rcpExc) { Trace.WriteLine("Error in RPLPS: " + rcpExc.Message); result = 0; } return result; }
public void SendConsumptionForecast(long contractId) { Trace.WriteLine("SendConsumptionForecast"); try { DataManager dataMan = new DataManager(); electricityProfile ep = new electricityProfile(); Random rn = new Random(); ContractData contractData = dataMan.GetContractData(contractId); ep.areaId = contractData.AreaId.ToString(); ep.amount = rn.Next(100, 200).ToString(); ep.contractId = contractData.ContractId.ToString(); ep.dateStart = contractData.StartDate; ep.dateEnd = DateTime.Now; ep.fromId = "T1ES1"; //send to first krado ep.toId = "T1RK1"; try { ep.messageId = dataMan.SaveComposedMessage(ep).ToString(); t1rk1Client = new KradoServiceSoapClient(); balanceInvoice bi = t1rk1Client.presumableLoadProfile(ep); this.ReceiveBalanceInvoice(bi); } catch (Exception rk1Exc) { Trace.WriteLine("Error sending consumption forecast to T1RK1: " + rk1Exc.Message); } //send to second krado ep.toId = "T1RK2"; try { ep.messageId = dataMan.SaveComposedMessage(ep).ToString(); t1rk2Client = new ReceiveClient(); string tmp = t1rk2Client.ReceiveCfFromEs("some piparkoogid from T1ES1"); } catch (Exception rk2Exc) { Trace.WriteLine("Error sending consumption forecast to T1RK2: " + rk2Exc.Message); } } catch (Exception scfExc) { Trace.WriteLine("Error sending consumption forecast: " + scfExc.Message); } }
public int ReceiveConsumptionProfile(electricityProfile profile) { Trace.WriteLine("ReceiveConsumptionProfile"); int result = 0; try { DataManager dataMan = new DataManager(); dataMan.SaveProfile(profile); result = 1; } catch (Exception rcpExc) { Trace.WriteLine("Error in RCP: " + rcpExc.Message); result = 0; } return result; }