Exemplo n.º 1
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_1348178542592347Ser_3_Alias", RevisionClassText.Edit_instanceServiceAlias, "Clas_1348178542592347_Alias", RevisionClassText.ClassAlias);
            lSInfo.AddOIDArgument("p_thisRevisarAeronave", false, "Revision", "Clas_1348178542592347Ser_3Arg_1_Alias", RevisionClassText.Edit_instance_P_thisRevisarAeronaveArgumentAlias);

            try
            {
                lSInfo.XML2ON(xmlReader, dtdVersion, true);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1348178542592347_Alias", RevisionClassText.ClassAlias, "Clas_1348178542592347Ser_3_Alias", RevisionClassText.Edit_instanceServiceAlias);
            }

            RevisionOid lP_thisRevisarAeronaveArg = (RevisionOid) ((ONArgumentInfo) lSInfo.mArgumentList["p_thisRevisarAeronave"]).Value;

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

            // Execute Service
            RevisionInstance lInstance = null;
            try
            {
                ONFilterList lFilterList = new ONFilterList();
                RevisionInstance lThisInstance = new RevisionInstance(lOnContext);
                if (lP_thisRevisarAeronaveArg != null)
                {
                    lFilterList = new ONFilterList();
                    lFilterList.Add("HorizontalVisibility", new RevisionHorizontalVisibility());
                    lThisInstance = lP_thisRevisarAeronaveArg.GetInstance(lOnContext, lFilterList);
                    if (lThisInstance == null)
                        throw new ONInstanceNotExistException(null, "Clas_1348178542592347_Alias", RevisionClassText.ClassAlias);
                }

                using (RevisionServer lServer = new RevisionServer(lOnContext, lThisInstance))
                {
                    lServer.Edit_instanceServ(lP_thisRevisarAeronaveArg);
                    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
        }
Exemplo n.º 2
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_1348178542592347Ser_1_Alias", RevisionClassText.Create_instanceServiceAlias, "Clas_1348178542592347_Alias", RevisionClassText.ClassAlias);
            lSInfo.AddDataValuedArgument("p_atrid_RevisarAeronave", false, DataTypeEnumerator.Autonumeric, 0, "Clas_1348178542592347Ser_1Arg_1_Alias", RevisionClassText.Create_instance_P_atrid_RevisarAeronaveArgumentAlias);
            lSInfo.AddDataValuedArgument("p_atrFechaRevision", false, DataTypeEnumerator.Date, 0, "Clas_1348178542592347Ser_1Arg_3_Alias", RevisionClassText.Create_instance_P_atrFechaRevisionArgumentAlias);
            lSInfo.AddDataValuedArgument("p_atrNombreRevisor", false, DataTypeEnumerator.String, 100, "Clas_1348178542592347Ser_1Arg_4_Alias", RevisionClassText.Create_instance_P_atrNombreRevisorArgumentAlias);
            lSInfo.AddDataValuedArgument("p_atrId_Aeronave", false, DataTypeEnumerator.String, 100, "Clas_1348178542592347Ser_1Arg_5_Alias", RevisionClassText.Create_instance_P_atrId_AeronaveArgumentAlias);

            try
            {
                lSInfo.XML2ON(xmlReader, dtdVersion, true);
            }
            catch (Exception e)
            {
                throw new ONServiceArgumentsException(e, "Clas_1348178542592347_Alias", RevisionClassText.ClassAlias, "Clas_1348178542592347Ser_1_Alias", RevisionClassText.Create_instanceServiceAlias);
            }

            ONInt lP_atrid_RevisarAeronaveArg = (ONInt) ((ONArgumentInfo) lSInfo.mArgumentList["p_atrid_RevisarAeronave"]).Value;
            ONDate lP_atrFechaRevisionArg = (ONDate) ((ONArgumentInfo) lSInfo.mArgumentList["p_atrFechaRevision"]).Value;
            ONString lP_atrNombreRevisorArg = (ONString) ((ONArgumentInfo) lSInfo.mArgumentList["p_atrNombreRevisor"]).Value;
            ONString lP_atrId_AeronaveArg = (ONString) ((ONArgumentInfo) lSInfo.mArgumentList["p_atrId_Aeronave"]).Value;

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

            // Execute Service
            RevisionInstance lInstance = null;
            try
            {
                using (RevisionServer lServer = new RevisionServer(lOnContext, null))
                {
                    lServer.Create_instanceServ(lP_atrid_RevisarAeronaveArg,lP_atrFechaRevisionArg,lP_atrNombreRevisorArg,lP_atrId_AeronaveArg);
                    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
        }