private XmlDocument FilterXmlDataInput(ListSolicitudesRequest request, string[] ParamAddcamposxmlinput)
        {
            XmlDocument DataInputXML = new XmlDocument();

            DataInputXML.LoadXml("<Operation><Details></Details></Operation>");
            XmlNode    nodeRoot      = DataInputXML.SelectSingleNode("Operation/Details");
            XmlElement nodeParameter = null;
            XmlElement nodeName      = null;
            XmlElement nodeValue     = null;

            string[] camposxmlinputAdd = ParamAddcamposxmlinput;

            for (int i = 0; i < camposxmlinputAdd.Length; i++)
            {
                string nameItem = camposxmlinputAdd[i];
                nodeParameter      = DataInputXML.CreateElement("parameter");
                nodeName           = DataInputXML.CreateElement("name");
                nodeName.InnerText = nameItem;
                nodeValue          = DataInputXML.CreateElement("value");
                GetValueNodeFilter(request, nodeValue, nameItem);
                nodeParameter.AppendChild(nodeName);
                nodeParameter.AppendChild(nodeValue);
                nodeRoot.AppendChild(nodeParameter);
            }
            return(DataInputXML);
        }
        /// <summary>
        /// Lista dodas las solicitudes asociadas a una agencia
        /// </summary>
        /// <param name="request">Objeto que contiene todos los datos de autenticacion del usuario e informaciĆ³n de la Solicitud</param>
        /// <returns>Respuesta de la consulta de las solicitudes asociadas a una agencia</returns>
        public ListSolicitudesResponse ListSolicitudesByAgent(ListSolicitudesRequest request)
        {
            string methodName = string.Format("{0}", System.Reflection.MethodBase.GetCurrentMethod().Name);

            this.LogRequest(request);

            ListSolicitudesResponse response = new ListSolicitudesResponse();

            string sessionId = this.GetSessionId(request, response, out this.errorMessage);

            if (this.errorMessage != ErrorMessagesMnemonics.None)
            {
                return(response);
            }

            if (!request.IsValidRequest())
            {
                this.SetResponseErrorCode(response, ErrorMessagesMnemonics.InvalidRequiredFields);
                return(response);
            }

            ListSolicitudesOperation OperationRequest = new ListSolicitudesOperation();

            string[]    filtercamposxmlInput = OperationRequest.FiltercamposxmlInput;
            XmlDocument DataInputXML         = FilterXmlDataInput(request, filtercamposxmlInput);

            //llamado REST al API SOS IT
            response = (ListSolicitudesResponse)OperationRequest.CallOperation(this.urlApi, this.technicianKey, this.TimeOutSOSIT, Request.EnumOperation.GET_REQUESTS, -1, -1, request.Branchid, request.CountryAcronym, DataInputXML);

            //List<Solicitude> listFilter = response.Solicitudes.Where(x => x.subject.Contains("[" + request.CountryAcronym + "-" + request.Branchid + "]")).ToList();

            //response.Solicitudes = listFilter;

            return(response);
        }
        private static void GetValueNodeFilter(ListSolicitudesRequest request, XmlElement nodeValue, string nameItem)
        {
            switch (nameItem)
            {
            case "from":
                nodeValue.InnerText = request.from;
                break;

            case "limit":
                nodeValue.InnerText = request.limit;
                break;

            case "filterby":
                nodeValue.InnerText = request.filterby;
                break;
            }
        }
Example #4
0
 /// <summary>
 /// Lista las solicitudes creadas en  SOS IT dada el id de la agencia
 /// </summary>
 /// <param name="request">Objeto que contiene toda la informacion asignada a una solicitud</param>
 /// <returns>Respuesta de la Consulta</returns>
 private ListSolicitudesResponse ListSolicitudesByAgent(ListSolicitudesRequest request)
 {
     return((new Provider.SOSIT.SolicitudeProvider()).ListSolicitudesByAgent(request));
 }
Example #5
0
 ListSolicitudesResponse ISOSITApiSoap.ListSolicitudesByAgent(ListSolicitudesRequest request)
 {
     return(this.ListSolicitudesByAgent(request));
 }