Пример #1
0
        /// <summary>Extracts from the XML message the filters that have to be solved</summary>
        /// <param name="xmlReader">XML with the request message</param>
        /// <param name="dtdVersion">Version of DTD that follows the XML message</param>
        public PasajeroLMDFilter GetFilter_FUM(XmlReader xmlReader, double dtdVersion)
        {
            // Create filter
            PasajeroLMDFilter lFilter = new PasajeroLMDFilter();

            // Process the variable filters
            ONServiceInfo lSInfo = new ONServiceInfo("", "FUM", "Clas_1348178542592658_Alias", "Pasajero");

            lSInfo.AddFilterVariable("FDesde", DataTypeEnumerator.Date, 0, "", "FDesde");
            lSInfo.AddFilterVariable("FHasta", DataTypeEnumerator.Date, 0, "", "FHasta");

            try
            {
                lSInfo.XML2ONFilterVariables(xmlReader, dtdVersion);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1348178542592658_Alias", "Pasajero", "", "FUM");
            }

            lFilter.InitDateVar  = (ONDate)((ONArgumentInfo)lSInfo.mArgumentList["FDesde"]).Value;
            lFilter.FinalDateVar = (ONDate)((ONArgumentInfo)lSInfo.mArgumentList["FHasta"]).Value;

            return(lFilter);
        }
Пример #2
0
        /// <summary>Extracts from the XML message the filters that have to be solved</summary>
        /// <param name="xmlReader">XML with the request message</param>
        /// <param name="dtdVersion">Version of DTD that follows the XML message</param>
        public AeronaveLMDFilter GetFilter_LMD(XmlReader xmlReader, double dtdVersion)
        {
            // Create filter
            AeronaveLMDFilter lFilter = new AeronaveLMDFilter();

            // Process the variable filters
            ONServiceInfo lSInfo = new ONServiceInfo("", "LMD", "Clas_1348178411520734_Alias", "Aeronave");

            lSInfo.AddFilterVariable("InitDate", DataTypeEnumerator.Date, 0, "", "InitDate");
            lSInfo.AddFilterVariable("FinalDate", DataTypeEnumerator.Date, 0, "", "FinalDate");

            try
            {
                lSInfo.XML2ONFilterVariables(xmlReader, dtdVersion);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1348178411520734_Alias", "Aeronave", "", "LMD");
            }

            lFilter.InitDateVar  = (ONDate)((ONArgumentInfo)lSInfo.mArgumentList["InitDate"]).Value;
            lFilter.FinalDateVar = (ONDate)((ONArgumentInfo)lSInfo.mArgumentList["FinalDate"]).Value;

            return(lFilter);
        }
Пример #3
0
        public void Create_instanceServ(ref string ticket, ref ONOid agentOid, XmlReader xmlReader, XmlWriter xmlWriter, double dtdVersion, string clientName)
        {
            // Process the service arguments
            ONServiceInfo lSInfo = new ONServiceInfo("Clas_1347649273856884Ser_1_Alias", NaveNodrizaClassText.Create_instanceServiceAlias, "Clas_1347649273856884_Alias", NaveNodrizaClassText.ClassAlias);

            lSInfo.AddDataValuedArgument("p_atrid_NaveNodriza", false, DataTypeEnumerator.Autonumeric, 0, "Clas_1347649273856884Ser_1Arg_1_Alias", NaveNodrizaClassText.Create_instance_P_atrid_NaveNodrizaArgumentAlias);
            lSInfo.AddDataValuedArgument("p_atrNombre_NaveNodriza", false, DataTypeEnumerator.String, 100, "Clas_1347649273856884Ser_1Arg_2_Alias", NaveNodrizaClassText.Create_instance_P_atrNombre_NaveNodrizaArgumentAlias);

            try
            {
                lSInfo.XML2ON(xmlReader, dtdVersion, true);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1347649273856884_Alias", NaveNodrizaClassText.ClassAlias, "Clas_1347649273856884Ser_1_Alias", NaveNodrizaClassText.Create_instanceServiceAlias);
            }

            ONInt    lP_atrid_NaveNodrizaArg     = (ONInt)((ONArgumentInfo)lSInfo.mArgumentList["p_atrid_NaveNodriza"]).Value;
            ONString lP_atrNombre_NaveNodrizaArg = (ONString)((ONArgumentInfo)lSInfo.mArgumentList["p_atrNombre_NaveNodriza"]).Value;

            // Create Context
            ONServiceContext lOnContext = new ONServiceContext();

            lOnContext.OidAgent = agentOid;

            // Execute Service
            NaveNodrizaInstance lInstance = null;

            try
            {
                using (NaveNodrizaServer lServer = new NaveNodrizaServer(lOnContext, null))
                {
                    lServer.Create_instanceServ(lP_atrid_NaveNodrizaArg, lP_atrNombre_NaveNodrizaArg);
                    lInstance = lServer.Instance;
                }
                ticket = lOnContext.GetTicket(dtdVersion, clientName);
            }
            catch (SecurityException)
            {
                throw new ONAccessAgentValidationException(null);
            }
            catch
            {
                throw;
            }

            // Write Oid
            if (dtdVersion >= 3.1)
            {
                if (lInstance != null)
                {
                    ON2XML(xmlWriter, lInstance.Oid, dtdVersion, ONXml.XMLTAG_OIDFIELD);
                }
            }

            // Write Outbound Arguments
            xmlWriter.WriteStartElement("Arguments");
            // Write Outbound Arguments
            xmlWriter.WriteEndElement();             // Arguments
        }
Пример #4
0
        public void Create_instanceServ(ref string ticket, ref ONOid agentOid, XmlReader xmlReader, XmlWriter xmlWriter, double dtdVersion, string clientName)
        {
            // Process the service arguments
            ONServiceInfo lSInfo = new ONServiceInfo("Clas_1348178542592658Ser_1_Alias", PasajeroClassText.Create_instanceServiceAlias, "Clas_1348178542592658_Alias", PasajeroClassText.ClassAlias);

            lSInfo.AddOIDArgument("p_agrPasajeroAeronave", false, "PasajeroAeronave", "Clas_1348178542592658Ser_1Arg_4_Alias", PasajeroClassText.Create_instance_P_agrPasajeroAeronaveArgumentAlias);
            lSInfo.AddDataValuedArgument("p_atrid_Pasajero", false, DataTypeEnumerator.Autonumeric, 0, "Clas_1348178542592658Ser_1Arg_1_Alias", PasajeroClassText.Create_instance_P_atrid_PasajeroArgumentAlias);
            lSInfo.AddDataValuedArgument("p_atrNombre", false, DataTypeEnumerator.Text, 0, "Clas_1348178542592658Ser_1Arg_2_Alias", PasajeroClassText.Create_instance_P_atrNombreArgumentAlias);

            try
            {
                lSInfo.XML2ON(xmlReader, dtdVersion, true);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1348178542592658_Alias", PasajeroClassText.ClassAlias, "Clas_1348178542592658Ser_1_Alias", PasajeroClassText.Create_instanceServiceAlias);
            }

            PasajeroAeronaveOid lP_agrPasajeroAeronaveArg = (PasajeroAeronaveOid)((ONArgumentInfo)lSInfo.mArgumentList["p_agrPasajeroAeronave"]).Value;
            ONInt  lP_atrid_PasajeroArg = (ONInt)((ONArgumentInfo)lSInfo.mArgumentList["p_atrid_Pasajero"]).Value;
            ONText lP_atrNombreArg      = (ONText)((ONArgumentInfo)lSInfo.mArgumentList["p_atrNombre"]).Value;

            // Create Context
            ONServiceContext lOnContext = new ONServiceContext();

            lOnContext.OidAgent = agentOid;

            // Execute Service
            PasajeroInstance lInstance = null;

            try
            {
                ONFilterList             lFilterList = new ONFilterList();
                PasajeroAeronaveInstance lp_agrPasajeroAeronaveInstance = new PasajeroAeronaveInstance(lOnContext);
                if (lP_agrPasajeroAeronaveArg != null)
                {
                    lFilterList = new ONFilterList();
                    lFilterList.Add("HorizontalVisibility", new PasajeroAeronaveHorizontalVisibility());
                    lp_agrPasajeroAeronaveInstance = lP_agrPasajeroAeronaveArg.GetInstance(lOnContext, lFilterList);
                    if (lp_agrPasajeroAeronaveInstance == null)
                    {
                        throw new ONInstanceNotExistException(null, "Clas_1348178542592177_Alias", PasajeroAeronaveClassText.ClassAlias);
                    }
                }

                using (PasajeroServer lServer = new PasajeroServer(lOnContext, null))
                {
                    lServer.Create_instanceServ(lP_agrPasajeroAeronaveArg, lP_atrid_PasajeroArg, lP_atrNombreArg);
                    lInstance = lServer.Instance;
                }
                ticket = lOnContext.GetTicket(dtdVersion, clientName);
            }
            catch (SecurityException)
            {
                throw new ONAccessAgentValidationException(null);
            }
            catch
            {
                throw;
            }

            // Write Oid
            if (dtdVersion >= 3.1)
            {
                if (lInstance != null)
                {
                    ON2XML(xmlWriter, lInstance.Oid, dtdVersion, ONXml.XMLTAG_OIDFIELD);
                }
            }

            // Write Outbound Arguments
            xmlWriter.WriteStartElement("Arguments");
            // Write Outbound Arguments
            xmlWriter.WriteEndElement();             // Arguments
        }
Пример #5
0
        public override ONCollection QueryByRelated(ref string ticket, ref ONOid agentOid, XmlReader xmlReader, ONDisplaySet displaySet, out ONOid startRowOID, out int blockSize, double dtdVersion, string clientName)
        {
            ONLinkedToList lLinkedTo = null;
            ONFilterList   lFilters  = new ONFilterList();

            // Read Request
            blockSize = int.Parse(xmlReader.GetAttribute("BlockSize"));
            if (!xmlReader.IsEmptyElement)
            {
                xmlReader.ReadStartElement("Query.Related");
                if (xmlReader.IsStartElement("StartRow"))
                {
                    xmlReader.ReadStartElement("StartRow");
                    startRowOID = XML2ON(xmlReader, dtdVersion);
                    xmlReader.ReadEndElement();                     // StartRow
                }
                else
                {
                    startRowOID = null;
                }

                // Fill relations
                lLinkedTo = GetLinkedTo(xmlReader, dtdVersion);

                // Read Request
                xmlReader.ReadEndElement();                 // Query.Related
            }
            else
            {
                xmlReader.ReadStartElement("Query.Related");
                lLinkedTo   = new ONLinkedToList();
                startRowOID = null;
            }

            // Read Order Criteria
            string lOrderCriteria = "";

            if (xmlReader.IsStartElement("Sort"))
            {
                lOrderCriteria = xmlReader.GetAttribute("Criterium");
                xmlReader.Skip();                 // Sort
            }

            //Read Navigational Filter
            string lNavFilterId    = "";
            ONOid  lSelectedObject = null;

            if (xmlReader.IsStartElement("NavFilt"))
            {
                xmlReader.ReadStartElement("NavFilt");
                if (xmlReader.IsStartElement("NavFilt.SelectedObject"))
                {
                    lNavFilterId = xmlReader.GetAttribute("NavFilterID");
                    xmlReader.ReadStartElement("NavFilt.SelectedObject");
                    string lClassName = xmlReader.GetAttribute("Class");
                    if (lClassName == "")
                    {
                        lClassName = "GlobalTransaction";
                    }
                    object[] lArgs = new object[2];
                    lArgs[0]        = xmlReader;
                    lArgs[1]        = dtdVersion;
                    lSelectedObject = ONContext.InvoqueMethod(ONContext.GetType_XML(lClassName), "XML2ON", lArgs) as ONOid;

                    lArgs    = new Object[1];
                    lArgs[0] = lSelectedObject;

                    lFilters.Add(lNavFilterId, ONContext.GetComponent_NavigationalFilter(lNavFilterId, lArgs) as ONFilter);
                }
                else if (xmlReader.IsStartElement("NavFilt.Argument"))
                {
                    string lClassName = xmlReader.GetAttribute("Class");
                    if (lClassName == "")
                    {
                        lClassName = "GlobalTransaction";
                    }
                    string lServiceName  = xmlReader.GetAttribute("Service");
                    string lArgumentName = xmlReader.GetAttribute("Argument");
                    xmlReader.ReadStartElement("NavFilt.Argument");

                    string lFilterName = lClassName + "_" + lServiceName + "Service_" + lArgumentName + "_NavigationalFilter";
                    if (xmlReader.IsStartElement("Arguments"))
                    {
                        object[] lArgs = new object[3];
                        lArgs[0] = xmlReader;
                        lArgs[1] = dtdVersion;
                        lArgs[2] = lArgumentName;

                        lFilters.Add(lFilterName, ONContext.InvoqueMethod(ONContext.GetComponent_XML(lClassName), typeof(ONNavigationalFilterXMLAttribute), "<Filter>" + lServiceName + "</Filter>", lArgs) as ONFilter);
                    }
                    else
                    {
                        lFilters.Add(lFilterName, ONContext.GetComponent_Filter(lFilterName, null) as ONFilter);
                    }

                    xmlReader.ReadEndElement();                     //NavFilt.Argument
                }
                else if (xmlReader.IsStartElement("NavFilt.ServiceIU"))
                {
                    lNavFilterId = xmlReader.GetAttribute("NavFilterID");
                    xmlReader.ReadStartElement("NavFilt.ServiceIU");

                    if (xmlReader.IsStartElement("Arguments"))
                    {
                        object[] lArgs = new object[2];
                        lArgs[0] = xmlReader;
                        lArgs[1] = dtdVersion;

                        ONServiceInfo lSInfo = new ONServiceInfo("", "", "", "");
                        lSInfo.XML2ON(xmlReader, dtdVersion, false);

                        HybridDictionary lArguments = new HybridDictionary(true);
                        foreach (ONArgumentInfo lArgument in lSInfo.mArgumentList.Values)
                        {
                            lArguments.Add(lArgument.Name, lArgument.Value);
                        }
                        lFilters.Add(lNavFilterId, ONContext.GetComponent_NavigationalFilter(lNavFilterId, new object[1] {
                            lArguments
                        }) as ONFilter);
                    }
                    else
                    {
                        lFilters.Add(lNavFilterId, ONContext.GetComponent_NavigationalFilter(lNavFilterId, null) as ONFilter);
                    }

                    xmlReader.ReadEndElement();                     //NavFilt.ServiceIU
                }
                else if (xmlReader.IsStartElement("NavFilt.Variable"))
                {
                    string lClassName        = xmlReader.GetAttribute("Class");
                    string lSourceFilterName = xmlReader.GetAttribute("Filter");
                    string lVariableName     = xmlReader.GetAttribute("Variable");

                    xmlReader.ReadStartElement("NavFilt.Variable");
                    string lFilterName = lClassName + "_" + lSourceFilterName + "Filter_" + lVariableName + "_NavigationalFilter";
                    if (xmlReader.IsStartElement("Filter.Variables"))
                    {
                        object[] lArgs = new object[3];
                        lArgs[0] = xmlReader;
                        lArgs[1] = dtdVersion;
                        lArgs[2] = lVariableName;

                        lFilters.Add(lFilterName, ONContext.InvoqueMethod(ONContext.GetComponent_XML(lClassName), typeof(ONNavigationalFilterXMLAttribute), "<Filter>" + lSourceFilterName + "</Filter>", lArgs) as ONFilter);
                    }
                    else
                    {
                        lFilters.Add(lFilterName, ONContext.GetComponent_Filter(lFilterName, null) as ONFilter);
                    }

                    xmlReader.ReadEndElement();                     //NavFilt.Variable
                }
            }

            // Create Context
            ONContext lOnContext = new ONContext();

            lOnContext.OidAgent = agentOid;

            foreach (ONFilter lFilter in lFilters.Values)
            {
                lFilter.CheckFilterVariables(lOnContext);
            }

            // Execute
            lOnContext.CalculateQueryInstancesNumber = true;
            PasajeroQuery lQuery      = new PasajeroQuery(lOnContext);
            ONCollection  lCollection = lQuery.QueryByFilter(lLinkedTo, lFilters, displaySet, lOrderCriteria, startRowOID, blockSize);

            ticket = lOnContext.GetTicket(dtdVersion, clientName);

            return(lCollection);
        }
Пример #6
0
        public override ONCollection QueryByRelated(ref string ticket, ref ONOid agentOid, XmlReader xmlReader, ONDisplaySet displaySet, out ONOid startRowOID, out int blockSize, double dtdVersion, string clientName)
        {
            ONLinkedToList lLinkedTo = null;
            ONFilterList lFilters = new ONFilterList();

            // Read Request
            blockSize = int.Parse(xmlReader.GetAttribute("BlockSize"));
            if (!xmlReader.IsEmptyElement)
            {
                xmlReader.ReadStartElement("Query.Related");
                if (xmlReader.IsStartElement("StartRow"))
                {
                    xmlReader.ReadStartElement("StartRow");
                    startRowOID = XML2ON(xmlReader, dtdVersion);
                    xmlReader.ReadEndElement(); // StartRow
                }
                else
                    startRowOID = null;

                // Fill relations
                lLinkedTo = GetLinkedTo(xmlReader, dtdVersion);

                // Read Request
                xmlReader.ReadEndElement(); // Query.Related
            }
            else
            {
                xmlReader.ReadStartElement("Query.Related");
                lLinkedTo = new ONLinkedToList();
                startRowOID = null;
            }

            // Read Order Criteria
            string lOrderCriteria = "";
            if (xmlReader.IsStartElement("Sort"))
            {
                lOrderCriteria = xmlReader.GetAttribute("Criterium");
                xmlReader.Skip(); // Sort
            }

            //Read Navigational Filter
            string lNavFilterId = "";
            ONOid lSelectedObject = null;
            if (xmlReader.IsStartElement("NavFilt"))
            {
                xmlReader.ReadStartElement("NavFilt");
                if (xmlReader.IsStartElement("NavFilt.SelectedObject"))
                {
                        lNavFilterId = xmlReader.GetAttribute("NavFilterID");
                    xmlReader.ReadStartElement("NavFilt.SelectedObject");
                    string lClassName = xmlReader.GetAttribute("Class");
                    if (lClassName == "")
                        lClassName = "GlobalTransaction";
                    object[] lArgs = new object[2];
                    lArgs[0] = xmlReader;
                    lArgs[1] = dtdVersion;
                    lSelectedObject = ONContext.InvoqueMethod(ONContext.GetType_XML(lClassName), "XML2ON", lArgs) as ONOid;

                    lArgs = new Object[1];
                    lArgs[0] = lSelectedObject;

                    lFilters.Add(lNavFilterId, ONContext.GetComponent_NavigationalFilter(lNavFilterId, lArgs) as ONFilter);
                }
                else if (xmlReader.IsStartElement("NavFilt.Argument"))
                {
                    string lClassName = xmlReader.GetAttribute("Class");
                    if (lClassName == "")
                        lClassName = "GlobalTransaction";
                    string lServiceName = xmlReader.GetAttribute("Service");
                    string lArgumentName = xmlReader.GetAttribute("Argument");
                    xmlReader.ReadStartElement("NavFilt.Argument");

                    string lFilterName = lClassName + "_" + lServiceName + "Service_" + lArgumentName + "_NavigationalFilter";
                    if (xmlReader.IsStartElement("Arguments"))
                    {
                        object[] lArgs = new object[3];
                        lArgs[0] = xmlReader;
                        lArgs[1] = dtdVersion;
                        lArgs[2] = lArgumentName;

                        lFilters.Add(lFilterName, ONContext.InvoqueMethod(ONContext.GetComponent_XML(lClassName), typeof(ONNavigationalFilterXMLAttribute), "<Filter>" + lServiceName + "</Filter>", lArgs) as ONFilter);
                    }
                    else
                    {
                        lFilters.Add(lFilterName, ONContext.GetComponent_Filter(lFilterName, null) as ONFilter);

                    }

                    xmlReader.ReadEndElement(); //NavFilt.Argument
                }
                else if (xmlReader.IsStartElement("NavFilt.ServiceIU"))
                {
                    lNavFilterId = xmlReader.GetAttribute("NavFilterID");
                    xmlReader.ReadStartElement("NavFilt.ServiceIU");

                    if (xmlReader.IsStartElement("Arguments"))
                    {
                        object[] lArgs = new object[2];
                        lArgs[0] = xmlReader;
                        lArgs[1] = dtdVersion;

                        ONServiceInfo lSInfo = new ONServiceInfo("", "", "", "");
                        lSInfo.XML2ON(xmlReader, dtdVersion, false);

                        HybridDictionary lArguments = new HybridDictionary(true);
                        foreach (ONArgumentInfo lArgument in lSInfo.mArgumentList.Values)
                        {
                            lArguments.Add(lArgument.Name, lArgument.Value);
                        }
                        lFilters.Add(lNavFilterId, ONContext.GetComponent_NavigationalFilter(lNavFilterId, new object[1] { lArguments }) as ONFilter);
                    }
                    else
                        lFilters.Add(lNavFilterId, ONContext.GetComponent_NavigationalFilter(lNavFilterId, null) as ONFilter);

                    xmlReader.ReadEndElement(); //NavFilt.ServiceIU
                }
                else if (xmlReader.IsStartElement("NavFilt.Variable"))
                {
                    string lClassName = xmlReader.GetAttribute("Class");
                    string lSourceFilterName = xmlReader.GetAttribute("Filter");
                    string lVariableName = xmlReader.GetAttribute("Variable");

                    xmlReader.ReadStartElement("NavFilt.Variable");
                    string lFilterName = lClassName + "_" + lSourceFilterName + "Filter_" + lVariableName + "_NavigationalFilter";
                    if (xmlReader.IsStartElement("Filter.Variables"))
                    {
                        object[] lArgs = new object[3];
                        lArgs[0] = xmlReader;
                        lArgs[1] = dtdVersion;
                        lArgs[2] = lVariableName;

                        lFilters.Add(lFilterName, ONContext.InvoqueMethod(ONContext.GetComponent_XML(lClassName), typeof(ONNavigationalFilterXMLAttribute), "<Filter>" + lSourceFilterName + "</Filter>", lArgs) as ONFilter);
                    }
                    else
                    {
                        lFilters.Add(lFilterName, ONContext.GetComponent_Filter(lFilterName, null) as ONFilter);

                    }

                    xmlReader.ReadEndElement(); //NavFilt.Variable
                }
            }

            // Create Context
            ONContext lOnContext = new ONContext();
            lOnContext.OidAgent = agentOid;

            foreach (ONFilter lFilter in lFilters.Values)
            {
                lFilter.CheckFilterVariables(lOnContext);
            }

            // Execute
            lOnContext.CalculateQueryInstancesNumber = true;
            PasajeroQuery lQuery = new PasajeroQuery(lOnContext);
            ONCollection lCollection = lQuery.QueryByFilter(lLinkedTo, lFilters, displaySet, lOrderCriteria, startRowOID, blockSize);
            ticket = lOnContext.GetTicket(dtdVersion, clientName);

            return lCollection;
        }
Пример #7
0
        /// <summary>Extracts from the XML message the filters that have to be solved</summary>
        /// <param name="xmlReader">XML with the request message</param>
        /// <param name="dtdVersion">Version of DTD that follows the XML message</param>
        public PasajeroLMDFilter GetFilter_LMD(XmlReader xmlReader, double dtdVersion)
        {
            // Create filter
            PasajeroLMDFilter lFilter = new PasajeroLMDFilter();

            // Process the variable filters
            ONServiceInfo lSInfo = new ONServiceInfo("", "LMD", "Clas_1348178542592658_Alias", "Pasajero");
            lSInfo.AddFilterVariable("InitDate", DataTypeEnumerator.Date, 0, "", "InitDate");
            lSInfo.AddFilterVariable("FinalDate", DataTypeEnumerator.Date, 0, "", "FinalDate");

            try
            {
                lSInfo.XML2ONFilterVariables(xmlReader, dtdVersion);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1348178542592658_Alias", "Pasajero", "", "LMD");
            }

            lFilter.InitDateVar = (ONDate) ((ONArgumentInfo) lSInfo.mArgumentList["InitDate"]).Value;
            lFilter.FinalDateVar = (ONDate) ((ONArgumentInfo) lSInfo.mArgumentList["FinalDate"]).Value;

            return lFilter;
        }
Пример #8
0
        public void Edit_instanceServ(ref string ticket, ref ONOid agentOid, XmlReader xmlReader, XmlWriter xmlWriter, double dtdVersion, string clientName)
        {
            // Process the service arguments
            ONServiceInfo lSInfo = new ONServiceInfo("Clas_1348178542592658Ser_3_Alias", PasajeroClassText.Edit_instanceServiceAlias, "Clas_1348178542592658_Alias", PasajeroClassText.ClassAlias);
            lSInfo.AddOIDArgument("p_thisPasajero", false, "Pasajero", "Clas_1348178542592658Ser_3Arg_1_Alias", PasajeroClassText.Edit_instance_P_thisPasajeroArgumentAlias);

            try
            {
                lSInfo.XML2ON(xmlReader, dtdVersion, true);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1348178542592658_Alias", PasajeroClassText.ClassAlias, "Clas_1348178542592658Ser_3_Alias", PasajeroClassText.Edit_instanceServiceAlias);
            }

            PasajeroOid lP_thisPasajeroArg = (PasajeroOid) ((ONArgumentInfo) lSInfo.mArgumentList["p_thisPasajero"]).Value;

            // Create Context
            ONServiceContext lOnContext = new ONServiceContext();
            lOnContext.OidAgent = agentOid;

            // Execute Service
            PasajeroInstance lInstance = null;
            try
            {
                ONFilterList lFilterList = new ONFilterList();
                PasajeroInstance lThisInstance = new PasajeroInstance(lOnContext);
                if (lP_thisPasajeroArg != null)
                {
                    lFilterList = new ONFilterList();
                    lFilterList.Add("HorizontalVisibility", new PasajeroHorizontalVisibility());
                    lThisInstance = lP_thisPasajeroArg.GetInstance(lOnContext, lFilterList);
                    if (lThisInstance == null)
                        throw new ONInstanceNotExistException(null, "Clas_1348178542592658_Alias", PasajeroClassText.ClassAlias);
                }

                using (PasajeroServer lServer = new PasajeroServer(lOnContext, lThisInstance))
                {
                    lServer.Edit_instanceServ(lP_thisPasajeroArg);
                    lInstance = lServer.Instance;
                }
                ticket = lOnContext.GetTicket(dtdVersion, clientName);
            }
            catch (SecurityException)
            {
                throw new ONAccessAgentValidationException(null);
            }
            catch
            {
                throw;
            }

            // Write Oid
            if (dtdVersion >= 3.1)
            {
                if (lInstance != null)
                    ON2XML(xmlWriter, lInstance.Oid, dtdVersion, ONXml.XMLTAG_OIDFIELD);
            }

            // Write Outbound Arguments
            xmlWriter.WriteStartElement("Arguments");
            // Write Outbound Arguments
            xmlWriter.WriteEndElement(); // Arguments
        }
        /// <summary>Extracts from the XML message the filters that have to be solved</summary>
        /// <param name="xmlReader">XML with the request message</param>
        /// <param name="dtdVersion">Version of DTD that follows the XML message</param>
        public RevisionPasajeroLMDFilter GetFilter_FUM(XmlReader xmlReader, double dtdVersion)
        {
            // Create filter
            RevisionPasajeroLMDFilter lFilter = new RevisionPasajeroLMDFilter();

            // Process the variable filters
            ONServiceInfo lSInfo = new ONServiceInfo("", "FUM", "Clas_1348178673664478_Alias", "RevisionPasajero");
            lSInfo.AddFilterVariable("FDesde", DataTypeEnumerator.Date, 0, "", "FDesde");
            lSInfo.AddFilterVariable("FHasta", DataTypeEnumerator.Date, 0, "", "FHasta");

            try
            {
                lSInfo.XML2ONFilterVariables(xmlReader, dtdVersion);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1348178673664478_Alias", "RevisionPasajero", "", "FUM");
            }

            lFilter.InitDateVar = (ONDate) ((ONArgumentInfo) lSInfo.mArgumentList["FDesde"]).Value;
            lFilter.FinalDateVar = (ONDate) ((ONArgumentInfo) lSInfo.mArgumentList["FHasta"]).Value;

            return lFilter;
        }
Пример #10
0
        public void Create_instanceServ(ref string ticket, ref ONOid agentOid, XmlReader xmlReader, XmlWriter xmlWriter, double dtdVersion, string clientName)
        {
            // Process the service arguments
            ONServiceInfo lSInfo = new ONServiceInfo("Clas_1348178673664478Ser_1_Alias", RevisionPasajeroClassText.Create_instanceServiceAlias, "Clas_1348178673664478_Alias", RevisionPasajeroClassText.ClassAlias);
            lSInfo.AddOIDArgument("p_agrPasajeroAeronave", false, "PasajeroAeronave", "Clas_1348178673664478Ser_1Arg_3_Alias", RevisionPasajeroClassText.Create_instance_P_agrPasajeroAeronaveArgumentAlias);
            lSInfo.AddOIDArgument("p_agrRevision", false, "Revision", "Clas_1348178673664478Ser_1Arg_4_Alias", RevisionPasajeroClassText.Create_instance_P_agrRevisionArgumentAlias);
            lSInfo.AddDataValuedArgument("p_atrid_RevisionPasajero", false, DataTypeEnumerator.Autonumeric, 0, "Clas_1348178673664478Ser_1Arg_1_Alias", RevisionPasajeroClassText.Create_instance_P_atrid_RevisionPasajeroArgumentAlias);

            try
            {
                lSInfo.XML2ON(xmlReader, dtdVersion, true);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1348178673664478_Alias", RevisionPasajeroClassText.ClassAlias, "Clas_1348178673664478Ser_1_Alias", RevisionPasajeroClassText.Create_instanceServiceAlias);
            }

            PasajeroAeronaveOid lP_agrPasajeroAeronaveArg = (PasajeroAeronaveOid) ((ONArgumentInfo) lSInfo.mArgumentList["p_agrPasajeroAeronave"]).Value;
            RevisionOid lP_agrRevisionArg = (RevisionOid) ((ONArgumentInfo) lSInfo.mArgumentList["p_agrRevision"]).Value;
            ONInt lP_atrid_RevisionPasajeroArg = (ONInt) ((ONArgumentInfo) lSInfo.mArgumentList["p_atrid_RevisionPasajero"]).Value;

            // Create Context
            ONServiceContext lOnContext = new ONServiceContext();
            lOnContext.OidAgent = agentOid;

            // Execute Service
            RevisionPasajeroInstance lInstance = null;
            try
            {
                ONFilterList lFilterList = new ONFilterList();
                PasajeroAeronaveInstance lp_agrPasajeroAeronaveInstance = new PasajeroAeronaveInstance(lOnContext);
                if (lP_agrPasajeroAeronaveArg != null)
                {
                    lFilterList = new ONFilterList();
                    lFilterList.Add("HorizontalVisibility", new PasajeroAeronaveHorizontalVisibility());
                    lp_agrPasajeroAeronaveInstance = lP_agrPasajeroAeronaveArg.GetInstance(lOnContext, lFilterList);
                    if (lp_agrPasajeroAeronaveInstance == null)
                        throw new ONInstanceNotExistException(null, "Clas_1348178542592177_Alias", PasajeroAeronaveClassText.ClassAlias);
                }

                RevisionInstance lp_agrRevisionInstance = new RevisionInstance(lOnContext);
                if (lP_agrRevisionArg != null)
                {
                    lFilterList = new ONFilterList();
                    lFilterList.Add("HorizontalVisibility", new RevisionHorizontalVisibility());
                    lp_agrRevisionInstance = lP_agrRevisionArg.GetInstance(lOnContext, lFilterList);
                    if (lp_agrRevisionInstance == null)
                        throw new ONInstanceNotExistException(null, "Clas_1348178542592347_Alias", RevisionClassText.ClassAlias);
                }

                using (RevisionPasajeroServer lServer = new RevisionPasajeroServer(lOnContext, null))
                {
                    lServer.Create_instanceServ(lP_agrPasajeroAeronaveArg,lP_agrRevisionArg,lP_atrid_RevisionPasajeroArg);
                    lInstance = lServer.Instance;
                }
                ticket = lOnContext.GetTicket(dtdVersion, clientName);
            }
            catch (SecurityException)
            {
                throw new ONAccessAgentValidationException(null);
            }
            catch
            {
                throw;
            }

            // Write Oid
            if (dtdVersion >= 3.1)
            {
                if (lInstance != null)
                    ON2XML(xmlWriter, lInstance.Oid, dtdVersion, ONXml.XMLTAG_OIDFIELD);
            }

            // Write Outbound Arguments
            xmlWriter.WriteStartElement("Arguments");
            // Write Outbound Arguments
            xmlWriter.WriteEndElement(); // Arguments
        }
Пример #11
0
        public void Create_instanceServ(ref string ticket, ref ONOid agentOid, XmlReader xmlReader, XmlWriter xmlWriter, double dtdVersion, string clientName)
        {
            // Process the service arguments
            ONServiceInfo lSInfo = new ONServiceInfo("Clas_1347649273856884Ser_1_Alias", NaveNodrizaClassText.Create_instanceServiceAlias, "Clas_1347649273856884_Alias", NaveNodrizaClassText.ClassAlias);
            lSInfo.AddDataValuedArgument("p_atrid_NaveNodriza", false, DataTypeEnumerator.Autonumeric, 0, "Clas_1347649273856884Ser_1Arg_1_Alias", NaveNodrizaClassText.Create_instance_P_atrid_NaveNodrizaArgumentAlias);
            lSInfo.AddDataValuedArgument("p_atrNombre_NaveNodriza", false, DataTypeEnumerator.String, 100, "Clas_1347649273856884Ser_1Arg_2_Alias", NaveNodrizaClassText.Create_instance_P_atrNombre_NaveNodrizaArgumentAlias);

            try
            {
                lSInfo.XML2ON(xmlReader, dtdVersion, true);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1347649273856884_Alias", NaveNodrizaClassText.ClassAlias, "Clas_1347649273856884Ser_1_Alias", NaveNodrizaClassText.Create_instanceServiceAlias);
            }

            ONInt lP_atrid_NaveNodrizaArg = (ONInt) ((ONArgumentInfo) lSInfo.mArgumentList["p_atrid_NaveNodriza"]).Value;
            ONString lP_atrNombre_NaveNodrizaArg = (ONString) ((ONArgumentInfo) lSInfo.mArgumentList["p_atrNombre_NaveNodriza"]).Value;

            // Create Context
            ONServiceContext lOnContext = new ONServiceContext();
            lOnContext.OidAgent = agentOid;

            // Execute Service
            NaveNodrizaInstance lInstance = null;
            try
            {
                using (NaveNodrizaServer lServer = new NaveNodrizaServer(lOnContext, null))
                {
                    lServer.Create_instanceServ(lP_atrid_NaveNodrizaArg,lP_atrNombre_NaveNodrizaArg);
                    lInstance = lServer.Instance;
                }
                ticket = lOnContext.GetTicket(dtdVersion, clientName);
            }
            catch (SecurityException)
            {
                throw new ONAccessAgentValidationException(null);
            }
            catch
            {
                throw;
            }

            // Write Oid
            if (dtdVersion >= 3.1)
            {
                if (lInstance != null)
                    ON2XML(xmlWriter, lInstance.Oid, dtdVersion, ONXml.XMLTAG_OIDFIELD);
            }

            // Write Outbound Arguments
            xmlWriter.WriteStartElement("Arguments");
            // Write Outbound Arguments
            xmlWriter.WriteEndElement(); // Arguments
        }
Пример #12
0
        public void Edit_instanceServ(ref string ticket, ref ONOid agentOid, XmlReader xmlReader, XmlWriter xmlWriter, double dtdVersion, string clientName)
        {
            // Process the service arguments
            ONServiceInfo lSInfo = new ONServiceInfo("Clas_1348178411520734Ser_3_Alias", AeronaveClassText.Edit_instanceServiceAlias, "Clas_1348178411520734_Alias", AeronaveClassText.ClassAlias);

            lSInfo.AddOIDArgument("p_thisAeronave", false, "Aeronave", "Clas_1348178411520734Ser_3Arg_1_Alias", AeronaveClassText.Edit_instance_P_thisAeronaveArgumentAlias);

            try
            {
                lSInfo.XML2ON(xmlReader, dtdVersion, true);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1348178411520734_Alias", AeronaveClassText.ClassAlias, "Clas_1348178411520734Ser_3_Alias", AeronaveClassText.Edit_instanceServiceAlias);
            }

            AeronaveOid lP_thisAeronaveArg = (AeronaveOid)((ONArgumentInfo)lSInfo.mArgumentList["p_thisAeronave"]).Value;

            // Create Context
            ONServiceContext lOnContext = new ONServiceContext();

            lOnContext.OidAgent = agentOid;

            // Execute Service
            AeronaveInstance lInstance = null;

            try
            {
                ONFilterList     lFilterList   = new ONFilterList();
                AeronaveInstance lThisInstance = new AeronaveInstance(lOnContext);
                if (lP_thisAeronaveArg != null)
                {
                    lFilterList = new ONFilterList();
                    lFilterList.Add("HorizontalVisibility", new AeronaveHorizontalVisibility());
                    lThisInstance = lP_thisAeronaveArg.GetInstance(lOnContext, lFilterList);
                    if (lThisInstance == null)
                    {
                        throw new ONInstanceNotExistException(null, "Clas_1348178411520734_Alias", AeronaveClassText.ClassAlias);
                    }
                }

                using (AeronaveServer lServer = new AeronaveServer(lOnContext, lThisInstance))
                {
                    lServer.Edit_instanceServ(lP_thisAeronaveArg);
                    lInstance = lServer.Instance;
                }
                ticket = lOnContext.GetTicket(dtdVersion, clientName);
            }
            catch (SecurityException)
            {
                throw new ONAccessAgentValidationException(null);
            }
            catch
            {
                throw;
            }

            // Write Oid
            if (dtdVersion >= 3.1)
            {
                if (lInstance != null)
                {
                    ON2XML(xmlWriter, lInstance.Oid, dtdVersion, ONXml.XMLTAG_OIDFIELD);
                }
            }

            // Write Outbound Arguments
            xmlWriter.WriteStartElement("Arguments");
            // Write Outbound Arguments
            xmlWriter.WriteEndElement();             // Arguments
        }
Пример #13
0
        public void SetPasswordServ(ref string ticket, ref ONOid agentOid, XmlReader xmlReader, XmlWriter xmlWriter, double dtdVersion, string clientName)
        {
            // Process the service arguments
            ONServiceInfo lSInfo = new ONServiceInfo("Clas_1348605050880238Ser_4_Alias", AdministradorClassText.SetPasswordServiceAlias, "Clas_1348605050880238_Alias", AdministradorClassText.ClassAlias);
            lSInfo.AddOIDArgument("p_thisAdministrador", false, "Administrador", "Clas_1348605050880238Ser_4Arg_1_Alias", AdministradorClassText.SetPassword_P_thisAdministradorArgumentAlias);
            lSInfo.AddDataValuedArgument("p_NewPassword", false, DataTypeEnumerator.Password, 0, "Clas_1348605050880238Ser_4Arg_2_Alias", AdministradorClassText.SetPassword_P_NewPasswordArgumentAlias);

            try
            {
                lSInfo.XML2ON(xmlReader, dtdVersion, true);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1348605050880238_Alias", AdministradorClassText.ClassAlias, "Clas_1348605050880238Ser_4_Alias", AdministradorClassText.SetPasswordServiceAlias);
            }

            AdministradorOid lP_thisAdministradorArg = (AdministradorOid) ((ONArgumentInfo) lSInfo.mArgumentList["p_thisAdministrador"]).Value;
            ONString lP_NewPasswordArg = (ONString) ((ONArgumentInfo) lSInfo.mArgumentList["p_NewPassword"]).Value;

            // Create Context
            ONServiceContext lOnContext = new ONServiceContext();
            lOnContext.OidAgent = agentOid;

            // Execute Service
            AdministradorInstance lInstance = null;
            try
            {
                ONFilterList lFilterList = new ONFilterList();
                AdministradorInstance lThisInstance = new AdministradorInstance(lOnContext);
                if (lP_thisAdministradorArg != null)
                {
                    lFilterList = new ONFilterList();
                    lFilterList.Add("HorizontalVisibility", new AdministradorHorizontalVisibility());
                    lThisInstance = lP_thisAdministradorArg.GetInstance(lOnContext, lFilterList);
                    if (lThisInstance == null)
                        throw new ONInstanceNotExistException(null, "Clas_1348605050880238_Alias", AdministradorClassText.ClassAlias);
                }

                using (AdministradorServer lServer = new AdministradorServer(lOnContext, lThisInstance))
                {
                    lServer.SetPasswordServ(lP_thisAdministradorArg,lP_NewPasswordArg);
                    lInstance = lServer.Instance;
                }
                ticket = lOnContext.GetTicket(dtdVersion, clientName);
            }
            catch (SecurityException)
            {
                throw new ONAccessAgentValidationException(null);
            }
            catch
            {
                throw;
            }

            // Write Oid
            if (dtdVersion >= 3.1)
            {
                if (lInstance != null)
                    ON2XML(xmlWriter, lInstance.Oid, dtdVersion, ONXml.XMLTAG_OIDFIELD);
            }

            // Write Outbound Arguments
            xmlWriter.WriteStartElement("Arguments");
            // Write Outbound Arguments
            xmlWriter.WriteEndElement(); // Arguments
        }
Пример #14
0
        public void MVChangePassWordServ(ref string ticket, ref ONOid agentOid, XmlReader xmlReader, XmlWriter xmlWriter, double dtdVersion, string clientName)
        {
            // Process the service arguments
            ONServiceInfo lSInfo = new ONServiceInfo("", "MVChangePassWord", "Clas_1348605050880238_Alias", "Administrador");
            lSInfo.AddDataValuedArgument("oldpassword", false, DataTypeEnumerator.Password, LENGTHPASSWORDADMINISTRADOR, "", "oldpassword");
            lSInfo.AddDataValuedArgument("newpassword", false, DataTypeEnumerator.Password, LENGTHPASSWORDADMINISTRADOR, "", "newpassword");
            try
            {
                lSInfo.XML2ON(xmlReader, dtdVersion, true);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1348605050880238_Alias", "Administrador", "", "MVChangePassWord");
            }

            ONString lOldpasswordArg = (ONString) ((ONArgumentInfo) lSInfo.mArgumentList["oldpassword"]).Value;
            ONString lNewpasswordArg = (ONString) ((ONArgumentInfo) lSInfo.mArgumentList["newpassword"]).Value;

            // Create Context
            ONServiceContext lOnContext = new ONServiceContext();
            lOnContext.OidAgent = agentOid;

            // Execute Service
            AdministradorInstance lInstance = null;
            try
            {
                // Find Agent Instance
                AdministradorInstance lAgentInstance = (agentOid as AdministradorOid).GetInstance(lOnContext);
                if (lAgentInstance == null)
                    throw new ONInstanceNotExistException(null, "", ClassName);

                using (AdministradorServer lServer = new AdministradorServer(lOnContext, lAgentInstance))
                {
                    lServer.MVChangePassWordServ(lOldpasswordArg, lNewpasswordArg);
                    lInstance = lServer.Instance;
                }
                ticket = lOnContext.GetTicket(dtdVersion, clientName);
            }
            catch (SecurityException)
            {
                throw new ONAccessAgentValidationException(null);
            }
            catch
            {
                throw;
            }

            // Write Oid
            if (dtdVersion >= 3.1)
                ON2XML(xmlWriter, lInstance.Oid, dtdVersion, ONXml.XMLTAG_OIDFIELD);

            // Write Outbound Arguments
            xmlWriter.WriteStartElement("Arguments");
            xmlWriter.WriteEndElement(); // Arguments
        }