public ActionResult SendMessage(CourierMessage courierMassage) { if (ModelState.IsValid) { courierMassage.DateTime = DateTime.Now; courierMassage.Status = false; _context.CourierMessages.Add(courierMassage); _context.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult Send(int id, int cartId) { var data = _context.AdminMassages.SingleOrDefault(c => c.Id == id); if (data != null) { data.Status = true; _context.SaveChanges(); } var send = new CourierMessage { AdminMassageId = id, CartOrderId = cartId, }; return(View(send)); }
public async Task SendNewPosition(CourierMessage message) { await Clients.All.SendAsync("ReceivedNewPosition", new CourierMessage { Uid = message.Uid, Token = message.Token }); }