Esempio n. 1
0
        public async Task sendAssistReq(serviceAssistanceRequest serviceAssistance)
        {
            servAssReqRepository.Add(serviceAssistance);
            var serv = servAssReqRepository.serviceAssistanceRequests.Last();

            await Clients.All.SendAsync("ReceiveAssistanceRequest", serv);
        }
 public IActionResult acceptAssistReq([FromBody] serviceAssistanceRequest serviceAssistanceRequest)
 => Ok(nh.acceptAssistanceReq(serviceAssistanceRequest));
 public IActionResult sendAssReq([FromBody] serviceAssistanceRequest serviceAssistanceRequest)
 => Ok(nh.sendAssistanceReq(serviceAssistanceRequest));
 public bool acceptAssistanceReq(serviceAssistanceRequest serviceAssistanceRequest)
 => servAssReqRepository.Update(serviceAssistanceRequest);
 public bool sendAssistanceReq(serviceAssistanceRequest serviceAssistanceRequest)
 => servAssReqRepository.Add(serviceAssistanceRequest);
 public bool Update(serviceAssistanceRequest serviceAssistanceRequest)
 {
     context.serviceAssistanceRequests.Update(serviceAssistanceRequest);
     return(context.SaveChanges() != 0 ? true : false);;
 }
 public bool Add(serviceAssistanceRequest serviceAssistanceRequest)
 {
     serviceAssistanceRequest.date = DateTime.UtcNow;
     context.serviceAssistanceRequests.Add(serviceAssistanceRequest);
     return(context.SaveChanges() != 0 ? true : false);
 }