コード例 #1
0
        public RevisionPasajeroInstance Create_instanceServ(PasajeroAeronaveOid p_agrPasajeroAeronaveArg, RevisionOid p_agrRevisionArg, ONInt p_atrid_RevisionPasajeroArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {

                // Call Executive
                RevisionPasajeroExecutive lExecutive = new RevisionPasajeroExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance = Instance;
                Instance = lExecutive.Create_instanceServ(p_agrPasajeroAeronaveArg, p_agrRevisionArg, p_atrid_RevisionPasajeroArg);

            }

            return Instance;
        }
コード例 #2
0
        internal RevisionPasajeroInstance Create_instanceServ(PasajeroAeronaveOid p_agrPasajeroAeronaveArg, RevisionOid p_agrRevisionArg, ONInt p_atrid_RevisionPasajeroArg)
        {
            if (Instance != null)
            {
                ONFilterList onfilt = new ONFilterList();
                onfilt.Add("QueryByOid", new QueryByOidFilter(Instance.Oid));
                Instance.Find(onfilt);
            }
            // Execute service
            RevisionPasajeroAction lAction = new RevisionPasajeroAction(OnContext);
            lAction.Instance = new RevisionPasajeroInstance(OnContext);
            Instance = lAction.Create_instanceServ(p_agrPasajeroAeronaveArg, p_agrRevisionArg, p_atrid_RevisionPasajeroArg);

            OnContext.OperationStack.Pop();
            OnContext.OperationStack.Push(Instance);

            return Instance;
        }
コード例 #3
0
        public override void Copy(ONInstance instance)
        {
            RevisionPasajeroInstance linstance = instance as RevisionPasajeroInstance;

            Oid = new RevisionPasajeroOid(linstance.Oid);

            RevisionRoleTemp = linstance.RevisionRoleTemp;
            if (linstance.RevisionRoleOidTemp != null)
            {
                RevisionRoleOidTemp = new RevisionOid(linstance.RevisionRoleOidTemp);
            }
            PasajeroAeronaveRoleTemp = linstance.PasajeroAeronaveRoleTemp;
            if (linstance.PasajeroAeronaveRoleOidTemp != null)
            {
                PasajeroAeronaveRoleOidTemp = new PasajeroAeronaveOid(linstance.PasajeroAeronaveRoleOidTemp);
            }
            StateObj = new ONString(linstance.StateObj);

            base.Copy(instance);
        }
コード例 #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="onContext">This parameter has the current context</param>
 /// <param name="instance">This parameter has the instance that exectues the service</param>
 public RevisionPasajeroServer(ONServiceContext onContext, RevisionPasajeroInstance instance)
     : base(onContext, instance, "RevisionPasajero")
 {
 }
コード例 #5
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_1348178673664478Ser_3_Alias", RevisionPasajeroClassText.Edit_instanceServiceAlias, "Clas_1348178673664478_Alias", RevisionPasajeroClassText.ClassAlias);
            lSInfo.AddOIDArgument("p_thisRevisionPasajero", false, "RevisionPasajero", "Clas_1348178673664478Ser_3Arg_1_Alias", RevisionPasajeroClassText.Edit_instance_P_thisRevisionPasajeroArgumentAlias);

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

            RevisionPasajeroOid lP_thisRevisionPasajeroArg = (RevisionPasajeroOid) ((ONArgumentInfo) lSInfo.mArgumentList["p_thisRevisionPasajero"]).Value;

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

            // Execute Service
            RevisionPasajeroInstance lInstance = null;
            try
            {
                ONFilterList lFilterList = new ONFilterList();
                RevisionPasajeroInstance lThisInstance = new RevisionPasajeroInstance(lOnContext);
                if (lP_thisRevisionPasajeroArg != null)
                {
                    lFilterList = new ONFilterList();
                    lFilterList.Add("HorizontalVisibility", new RevisionPasajeroHorizontalVisibility());
                    lThisInstance = lP_thisRevisionPasajeroArg.GetInstance(lOnContext, lFilterList);
                    if (lThisInstance == null)
                        throw new ONInstanceNotExistException(null, "Clas_1348178673664478_Alias", RevisionPasajeroClassText.ClassAlias);
                }

                using (RevisionPasajeroServer lServer = new RevisionPasajeroServer(lOnContext, lThisInstance))
                {
                    lServer.Edit_instanceServ(lP_thisRevisionPasajeroArg);
                    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
        }
コード例 #6
0
        protected override ONInstance InhGetInstance(ONContext onContext, ONFilterList onFilterList)
        {
            // Add oid filter to the list
            ONFilterList lOnFilterList = new ONFilterList(onFilterList);
            lOnFilterList.Add("QueryByOid", new QueryByOidFilter(this));

            // Search Instance
            ONInstance lInstance = new RevisionPasajeroInstance(onContext);
            lInstance.Oid = this;
            lInstance = lInstance.Find(lOnFilterList);
            if (lInstance == null)
                lInstance = new RevisionPasajeroInstance(onContext);

            return lInstance;
        }
コード例 #7
0
        ///<summary> This method adds the order criteria to the SQL statement </summary>
        ///<param name = "onSql"> This parameter represents the SQL component </param>
        ///<param name = "comparer"> This parameter has all the information refering to the order criteria to add to SQL statement</param>
        /// <param name="startRowOid">This parameter has the OID necessary to start the search</param>
        /// <param name="blockSize">This parameter represents the number of instances to be returned</param>
        protected override void AddOrderCriteria(ONSqlSelect onSql, ONOrderCriteria comparer, ONOid startRowOid, int blockSize, ONPath initialPath)
        {
            //Initilizate StartRow
            RevisionPasajeroInstance lInstance = null;
            if (startRowOid != null)
            {
                lInstance = new RevisionPasajeroInstance(OnContext);
                lInstance.Oid = startRowOid as RevisionPasajeroOid;
            }

            //Default OrderCriteria
            if (comparer == null)
            {
                string lAlias = onSql.GetAlias("RevisionPasajero", initialPath);
                if (lInstance != null)
                {
                    onSql.AddOrderBy(lAlias, CtesBD.FLD_REVISIONPASAJERO_ID_REVISIONPASAJERO, OrderByTypeEnumerator.Asc, lInstance.Oid.Id_RevisionPasajeroAttr);
                }
                else
                {
                    onSql.AddOrderBy(lAlias, CtesBD.FLD_REVISIONPASAJERO_ID_REVISIONPASAJERO, OrderByTypeEnumerator.Asc, null);
                }
                return;
            }

            //Add OrderCriteria
            bool lUseStartRow = (!comparer.InMemory);
            foreach (ONOrderCriteriaItem lOrderCriteriaItem in comparer.OrderCriteriaSqlItem)
            {
                ONPath lPath = new ONPath(lOrderCriteriaItem.OnPath);
                if((lInstance != null) && (lUseStartRow))
                {
                    ONSimpleType lAttrStartRow = null;

                    if (lPath.Path == "")
                        lAttrStartRow = lInstance[lOrderCriteriaItem.Attribute] as ONSimpleType;
                    else
                    {
                        ONCollection lCollection = (lInstance[lPath.Path] as ONCollection);
                        if((lCollection != null) && (lCollection.Count > 0))
                            lAttrStartRow = lCollection[0][lOrderCriteriaItem.Attribute] as ONSimpleType;
                    }
                    onSql.AddOrderBy(RevisionPasajeroData.AddPath(onSql, JoinType.LeftJoin, lOrderCriteriaItem.Facet, lPath, null, lOrderCriteriaItem.DomainArgument, false), lOrderCriteriaItem.Attribute, lOrderCriteriaItem.Type, lAttrStartRow);
                    lUseStartRow = (lAttrStartRow != null);
                }
                else
                    onSql.AddOrderBy(RevisionPasajeroData.AddPath(onSql, JoinType.LeftJoin, lOrderCriteriaItem.Facet, lPath, null, lOrderCriteriaItem.DomainArgument, false), lOrderCriteriaItem.Attribute, lOrderCriteriaItem.Type, null);
            }
            return;
        }
コード例 #8
0
        /// <summary>
        /// Load the data retrieved from the Data Base to components of the application
        /// </summary>
        /// <param name="onContext">This parameter has the current context</param>
        /// <param name="columns">This parameter has the data collected from the database</param>
        /// <param name="index">This parameter has the position of the first data to fix in the application</param>
        public static RevisionPasajeroInstance LoadFacet(ONContext onContext, ONDisplaySet displaySet, object[] columns, ref int index)
        {
            RevisionPasajeroInstance lInstance = new RevisionPasajeroInstance(onContext);
            lInstance.Oid = new RevisionPasajeroOid();

            lInstance.RevisionRoleOidTemp = new RevisionOid();
            lInstance.PasajeroAeronaveRoleOidTemp = new PasajeroAeronaveOid();
            // Field 'id_RevisionPasajero'
            lInstance.Oid.Id_RevisionPasajeroAttr = new ONInt(Convert.ToInt32(columns[index++]));
            // Field 'fk_Revision_1'
            lInstance.RevisionRoleOidTemp.Id_RevisarAeronaveAttr = new ONInt(Convert.ToInt32(columns[index++]));
            // Field 'fk_PasajeroAero_1'
            lInstance.PasajeroAeronaveRoleOidTemp.Id_PasajeroAeronaveAttr = new ONInt(Convert.ToInt32(columns[index++]));
            lInstance.StateObj = new ONString(((string) columns[index++]).TrimEnd());
            lInstance.Lmd = new ONDateTime((DateTime) columns[index++]);

            lInstance.Modified = false;
            return lInstance;
        }