Ejemplo n.º 1
0
 public static NodeInformation ToNodeInformation(Entities.NodeInformation dbInfo, Nodes dbNode, PoIs dbPoI)
 {
     return new NodeInformation
         {
             DisplayName = dbInfo.DisplayName,
             Node = ToNode(dbNode),
             RoomName = dbInfo.RoomName,
             NFCTag = dbInfo.NFCTag,
             QRCode = dbInfo.QRCode,
             PoI = dbPoI == null ? new PoI() : ToPoI(dbInfo.PoIs)
         };
 }
Ejemplo n.º 2
0
 public static PoI ToPoI(PoIs dbPoI)
 {
     return new PoI
         {
             Description = dbPoI.Description,
             Type = ToPoiType(dbPoI.PoiTypes)
         };
 }
Ejemplo n.º 3
0
 private static void CreateOrUpdateNodeInfo(MapsEntities entities, NodeInformation inputInfo,
     Data.Entities.NodeInformation nodeInformation, PoIs poi)
 {
     int? poiId = poi != null ? (int?)poi.Id : null;
     // Wenn es keine NodeInfo gibt, eine Neue anlegen
     if (nodeInformation == null)
     {
         entities.NodeInformation.Add(new Data.Entities.NodeInformation
             {
                 DisplayName = inputInfo.DisplayName,
                 RoomName = inputInfo.RoomName,
                 QRCode = inputInfo.QRCode,
                 NFCTag = inputInfo.NFCTag,
                 PoiId = poiId,
                 NodeId = inputInfo.Node.Id,
                 CreationTime = DateTime.Now
             });
     }
     // Ansonsten die bestehende NodeInfo aktualisieren
     else
     {
         nodeInformation.DisplayName = inputInfo.DisplayName;
         nodeInformation.RoomName = inputInfo.RoomName;
         nodeInformation.NFCTag = inputInfo.NFCTag;
         nodeInformation.QRCode = inputInfo.QRCode;
         nodeInformation.PoiId = poiId;
     }
     entities.SaveChanges();
 }