public override void OnUpdate(IStation station) { Station st = (Station)station; //st.Name; string xml = CommuniPortConfigSerializer.Serialize(st.CommuniPortConfig); int id = (int)GuidHelper.ConvertToUInt32(st.Guid); DBI.Instance.UpdateStation(id, st.Name, xml, st.Ordinal, st.Street, st.Remark); }
public override void OnAdd(IStation station) { //throw new NotImplementedException(); Station st = (Station)station; string xml = CommuniPortConfigSerializer.Serialize(st.CommuniPortConfig); int id = DBI.Instance.InsertStation(st.Name, xml, st.Ordinal, st.Street, st.Remark); st.Guid = GuidHelper.Create((uint)id); }
void doit2(ICommuniPortConfig v) { string s = CommuniPortConfigSerializer.Serialize(v); Console.WriteLine(s); ICommuniPortConfig v2 = CommuniPortConfigSerializer.Deserialize(s); Console.WriteLine(v2); }