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