Exemplo n.º 1
0
        public Instrument createInstrument(MobileBackendContext context, Guid InstrumentGuid, string adress, string displayName)
        {
            Instrument toAdd = new Instrument {
                DisplayName = displayName, Adress = adress, UUID = InstrumentGuid
            };

            context.Instrument.Add(toAdd);
            context.SaveChanges();

            addNotifications(context, toAdd);
            return(toAdd);
        }
Exemplo n.º 2
0
        public void addNotifications(MobileBackendContext context, Instrument toAdd)
        {
            var temp = context.Notification.Where(x => x.NotifivationID < 0).ToList();
            List <Notification> notificationTypes = new List <Notification>();

            foreach (Notification noti in temp)
            {
                Notification tump = (Notification)context.Entry(noti).CurrentValues.ToObject();
                tump.NotifivationID   = new int();
                tump.InstrumentID     = toAdd.InstrumentID;
                tump.OriginInstrument = toAdd;
                notificationTypes.Add(tump);
            }
            context.Notification.AddRange(notificationTypes);
            context.SaveChanges();
        }
Exemplo n.º 3
0
 public UsersController(MobileBackendContext context)
 {
     _context = context;
 }
Exemplo n.º 4
0
 public InstrumentController(MobileBackendContext context)
 {
     _context = context;
 }
Exemplo n.º 5
0
 public NotificationsController(MobileBackendContext context)
 {
     _context = context;
 }
Exemplo n.º 6
0
 public CorMonitorService(MobileBackendContext context)
 {
     _context = context;
     BakaSeed();
 }