public bool InsertInterface(GCInterface i) { InterfaceRec rec = DataHelper.CreateInterfaceRec(i); if (rec == null) { return(false); } return(Insert(rec)); }
public bool DeleteInterface(GCInterface i) { if (i == null) { return(false); } InterfaceRec rec = new InterfaceRec(); rec.ID = i.InterfaceID; if (!Delete(rec)) { return(false); } string sql = "DELETE FROM Combination WHERE DataIn = '" + i.InterfaceName + "'"; return(Execute(sql)); }
public static InterfaceRec CreateInterfaceRec(GCInterface i) { if (i == null) { return(null); } GCDevice device = i.Device; DeviceDir idir = i.Directory; InterfaceRec rec = i.InterfaceRec; rec.Folder = i.FolderPath; rec.Name = idir.Header.Name; rec.DeviceID = device.DeviceID; rec.DeviceName = device.DeviceName; rec.IndexFile = DeviceDirManager.IndexFileName; rec.Type = ((int)device.Directory.Header.Type).ToString(); rec.Description = device.Directory.Header.Description; rec.EventType = idir.Header.EventType; switch (device.Directory.Header.Direction) { case DirectionType.INBOUND: rec.Direction = "I"; break; case DirectionType.OUTBOUND: rec.Direction = "O"; break; case DirectionType.BIDIRECTIONAL: rec.Direction = "B"; break; } return(rec); }