コード例 #1
0
 public IActionResult approveStat([FromBody] statusOfVehicle stat)
 {
     if (sov.approveStatus(stat))
     {
         return(Ok(sov.viewStatus()));
     }
     else
     {
         return(Ok(false));
     }
 }
コード例 #2
0
 public IActionResult addStat([FromBody] statusOfVehicle stat)
 {
     if (sov.createStatus(stat))
     {
         return(Ok(sov.viewStatus(stat.Id)));
     }
     else
     {
         return(Ok(false));
     }
 }
コード例 #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);
        }
コード例 #4
0
 public bool approveStatus(statusOfVehicle stat) => statOfVehicle.Update(stat);
コード例 #5
0
 public bool createStatus(statusOfVehicle stat)
 {
     stat.date = DateTime.Now;
     return(statOfVehicle.Add(stat));
 }
コード例 #6
0
 public bool Update(statusOfVehicle statusOfVehicle)
 {
     context.statusOfVehicles.Update(statusOfVehicle);
     return(context.SaveChanges() != 0 ? true : false);
 }