public string ProcessAction(string usuario, Dictionary <string, string> actionParameters, AssistantAction action)
        {
            switch (action)
            {
            case AssistantAction.FindMaterial:
                var message = FindMaterialProperty(actionParameters);
                if (message == null)
                {
                    message = LocalizedText.AssistantEmptyResult;
                }
                return(message);

                break;

            case AssistantAction.ConectividadEstacion:
                //return CheckStationConectivity(actionParameters);
                break;

            case AssistantAction.FindLocation:
                //return FindLocalidadProperty(actionParameters);
                break;

            default:
                return(string.Empty);

                break;
            }

            return(string.Empty);
        }
Exemplo n.º 2
0
        public void ProcessAssistantQuery(List <KeyValuePair <string, string> > actionParameters, AssistantAction action)
        {
            string user    = Context.User.Identity.Name;
            string message = string.Empty;

            try
            {
                message = AssistantService.ProcessAction(user, actionParameters.ToDictionary(x => x.Key, x => x.Value), action);
            }
            //catch (GenericBaseException ex)
            //{
            //		message = ex.Message;
            //}
            catch (Exception e)
            {
                message = "Hubo un error al procesar la solicitud.";
            }

            Clients.Group(GetCurrentUserName()).sendChatMessageToClient(message);
        }