Example #1
0
 public IActionResult approveStat([FromBody] statusOfVehicle stat)
 {
     if (sov.approveStatus(stat))
     {
         return(Ok(sov.viewStatus()));
     }
     else
     {
         return(Ok(false));
     }
 }
Example #2
0
 public IActionResult addStat([FromBody] statusOfVehicle stat)
 {
     if (sov.createStatus(stat))
     {
         return(Ok(sov.viewStatus(stat.Id)));
     }
     else
     {
         return(Ok(false));
     }
 }
Example #3
0
        public async Task sendStatusOfVehicle(Notification notification, statusOfVehicle statusOfVehicle)
        {
            statOfVehicleRepository.Add(statusOfVehicle);
            var stat = statOfVehicleRepository.statusOfVehicles.Single(s => s.description == statusOfVehicle.description);
            var s    = typeof(statusOfVehicle).ToString();

            notification.type     = s.Split(".").Last();
            notification.objectId = stat.Id;
            notificationRepository.Add(notification);
            var notif = notificationRepository.notifications.Last();
            await Clients.All.SendAsync("ReceiveStat", notif, stat);
        }
Example #4
0
 public bool approveStatus(statusOfVehicle stat) => statOfVehicle.Update(stat);
Example #5
0
 public bool createStatus(statusOfVehicle stat)
 {
     stat.date = DateTime.Now;
     return(statOfVehicle.Add(stat));
 }
Example #6
0
 public bool Update(statusOfVehicle statusOfVehicle)
 {
     context.statusOfVehicles.Update(statusOfVehicle);
     return(context.SaveChanges() != 0 ? true : false);
 }