protected override void OnAdd(IDevice device) { Xd202 d = (Xd202)device; string s = string.Format( "insert into tblDevice(DeviceAddress, deviceType, stationID, DeviceName) values({0}, '{1}', {2}, '{3}')", d.Address, d.DeviceType.Type.Name, GuidHelper.ConvertToInt32(d.Station.Guid), d.Name ); DBI.Instance.ExecuteScalar(s); d.Guid = GuidHelper.Create(GetMaxDeviceID(DBI.Instance)); }
public override IDevice OnCreate(IDeviceSource deviceSource) { Xd202DeviceSource source = (Xd202DeviceSource)deviceSource; Xd202 d = new Xd202(); d.Address = source.Address; d.Name = source.DeviceName; d.DeviceSource = source; d.DeviceType = this.Dpu.DeviceType; d.Dpu = this.Dpu; d.Guid = source.Guid; d.StationGuid = source.StationGuid; return(d); }
public override IDevice OnCreate(IDeviceSource deviceSource) { Xd202DeviceSource source = (Xd202DeviceSource)deviceSource; Xd202 d = new Xd202(); d.Address = source.Address; d.Name = source.DeviceName; d.DeviceSource = source; d.DeviceType = this.Dpu.DeviceType; d.Dpu = this.Dpu; d.Guid = source.Guid; d.StationGuid = source.StationGuid; return d; }