public String AddMsg(int id, string msg) { String output; HelloMsg theMsg = new HelloMsg(); theMsg.ID = id; theMsg.MSG = msg; theMsg.STATUS = "working"; try { _proxy.Update <HelloMsg>(theMsg, null, //no transactions long.MaxValue, 0, //lease and write timeouts UpdateModifiers.UpdateOrWrite); output = "[" + theMsg.ToString() + "] was written to the space"; } catch (Exception e) { output = e.Message; } return(output); }
public String UpdateLastPrice(string symbol, double last) { bool isConnected = SpaceInit(); if (!(isConnected)) { return("connection error"); } TickInfo.TickInfo tick = ReadTick(symbol); if (tick == null) { return("Not Exist"); } tick.Last = last; _proxy.Update <TickInfo.TickInfo>(tick); return("Symbol " + symbol + " has been Updated"); }