public async Task <XElement> GetEventResultTypes(string sessionKey, long requestId) { #region Заглушка var hubConn = new HubConnection(Settings.Default.ResponseHubUrl); var hubProxy = hubConn.CreateHubProxy("ResponseHub"); await hubConn.Start(); var result = EventResultTypeDTO.ArrayToXElement(new EventResultTypeDTO[] { new EventResultTypeDTO() { Id = 1, Name = "Передан", }, new EventResultTypeDTO() { Id = 2, Name = "ПЕРЕЗВОНИТЬ", }, new EventResultTypeDTO() { Id = 3, Name = "Непрофильный" } }); result.Add(new XElement("rc", 0)); result.Add(new XElement("msg", "")); hubProxy.Invoke("OperationCallback", sessionKey, requestId, result); return(zapad.Model.API.ReturnCodes.BuildRcAnswer(0, "Успешно")); #endregion }
public JsonResult GetEventResultTypes() { var response = WebHostCache.Current.GetResponse <XElement>(@"api\Dictionary\GetEventResultTypes?sessionKey=" + session.Key.ToString()); var result = EventResultTypeDTO.ArrayFromXElement(response).ToList(); return(Json(new { rc = 0, Items = result }, JsonRequestBehavior.AllowGet)); }