示例#1
0
        /// <summary>
        /// Take over lock for OrderItem
        /// </summary>
        /// <param name="nodeId">OrderItem Node Id</param>
        /// <returns>JSON result</returns>
        public ActionResult TakeOverLockedOrderItem(int nodeId)
        {
            // Response JSON
            var json = new ResultResponse();

            try
            {
                // Get current member
                int memberId = _memberInfoManager.GetCurrentMemberId(Request, Response);

                _orderItemManager.SetEditedByData(nodeId, memberId.ToString(), new Member(memberId).Text);

                // Return JSON to client
                json.Success = true;
                json.Message = "Took over lock.";

                // Notify SignalR clients of the update
                _notifier.UpdateOrderItemUpdate(nodeId, memberId.ToString(), new Member(memberId).Text);
            }
            catch (Exception e)
            {
                // Return JSON to client
                json.Success = false;
                json.Message = "Error taking lock: " + e.Message;
            }

            return(Json(json, JsonRequestBehavior.AllowGet));
        }