Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        void doit2(ICommuniPortConfig v)
        {
            string s = CommuniPortConfigSerializer.Serialize(v);

            Console.WriteLine(s);
            ICommuniPortConfig v2 = CommuniPortConfigSerializer.Deserialize(s);

            Console.WriteLine(v2);
        }