Beispiel #1
0
        public IHttpActionResult UpdateOrder(SwitchOrderModel model)
        {
            //Thread.Sleep(2000);

            var result = _switchService.UpdateOrder(User.Identity.GetUserId(), model.SwitchId, model.Order);

            var obj = new
            {
                Success = true,
                Message = "",
                Result  = result,
            };

            var client = LynexWebSocketHandler.GetWebSocketSession(model.SiteId);

            if (client != null)
            {
                var webSocketMessage = new WebSocketMessage(WebSocketMessageType.WebSwitchOrderUpdate);
                webSocketMessage.BroadcastType = WebSocketBroadcastType.All;
                webSocketMessage.ClientId      = model.ClientWebSocketId;
                webSocketMessage.Message       = model;
                client.Broadcast(JsonConvert.SerializeObject(webSocketMessage));
            }

            return(Ok(obj));
        }
Beispiel #2
0
        public IHttpActionResult UpdateOrder(SwitchOrderModel model)
        {
            //Thread.Sleep(2000);

            var result = _switchService.UpdateOrder(User.Identity.GetUserId(), model.SwitchId, model.Order);

            var obj = new
            {
                Success = true,
                Message = "",
                Result  = result,
            };

            return(Ok(obj));
        }