public override bool FilterInMemory(ONInstance instance)
        {
            AdministradorInstance lInstance = instance as AdministradorInstance;

            // SQL Optimized

            return true;
        }
        public override bool FilterInMemory(ONInstance instance)
        {
            RevisionInstance lInstance = instance as RevisionInstance;

            // SQL Optimized

            return true;
        }
        public override bool FilterInMemory(ONInstance instance)
        {
            PasajeroAeronaveInstance lInstance = instance as PasajeroAeronaveInstance;

            // SQL Optimized

            return true;
        }
        public override bool FilterInMemory(ONInstance instance)
        {
            NaveNodrizaInstance lInstance = instance as NaveNodrizaInstance;

            // SQL Optimized

            return true;
        }
        public override void Copy(ONInstance instance)
        {
            AdministradorInstance linstance = instance as AdministradorInstance;

            Oid = new AdministradorOid(linstance.Oid);

            PassWordAttr = linstance.PassWordAttr;
            StateObj     = new ONString(linstance.StateObj);

            base.Copy(instance);
        }
        public override void Copy(ONInstance instance)
        {
            NaveNodrizaInstance linstance = instance as NaveNodrizaInstance;

            Oid = new NaveNodrizaOid(linstance.Oid);

            Nombre_NaveNodrizaAttr = new ONString(linstance.Nombre_NaveNodrizaAttr);
            StateObj = new ONString(linstance.StateObj);

            base.Copy(instance);
        }
Example #7
0
        /// <summary>
        /// Finds the instance that represents this object in persistance tier. For this reaseon it is used the data component
        /// </summary>
        public ONInstance Find(ONFilterList onFilterList)
        {
            ONData       lData       = ONContext.GetComponent_Data(ClassName, OnContext);
            ONCollection lCollection = lData.ExecuteQuery(new ONLinkedToList(), onFilterList, null, null, null, 0);

            ONInstance lInstance = null;

            if (lCollection.Count > 0)
            {
                lInstance = lCollection[0];
                Copy(lInstance);
            }
            return(lInstance);
        }
        public override void Copy(ONInstance instance)
        {
            RevisionInstance linstance = instance as RevisionInstance;

            Oid = new RevisionOid(linstance.Oid);

            NombreRevisorAttr        = new ONString(linstance.NombreRevisorAttr);
            FechaRevisionAttr        = new ONDate(linstance.FechaRevisionAttr);
            Id_AeronaveAttr          = new ONString(linstance.Id_AeronaveAttr);
            RevisionPasajeroRoleTemp = linstance.RevisionPasajeroRoleTemp;
            StateObj = new ONString(linstance.StateObj);

            base.Copy(instance);
        }
        public override bool FilterInMemory(ONInstance instance)
        {
            if(!InMemory)
                return true;

            #region Horizontal visibility for agent 'Administrador'
            if(instance.OnContext.LeafActiveAgentFacets.Contains("Administrador"))
            {
                return true;
            }
            #endregion Horizontal visibility for agent 'Administrador'

            return (false);
        }
Example #10
0
        public override bool Equals(object obj)
        {
            ONInstance lObject = obj as ONInstance;

            if (lObject == null)
            {
                if (obj is ONOid)
                {
                    return(((object)Oid == (object)obj) || (Oid.Equals(obj)));
                }
                else
                {
                    return(false);
                }
            }

            return(((object)Oid == (object)lObject.Oid) || (Oid.Equals(lObject.Oid)));
        }
        public override void Copy(ONInstance instance)
        {
            PasajeroInstance linstance = instance as PasajeroInstance;

            Oid = new PasajeroOid(linstance.Oid);

            if ((object)linstance.NombreAttrTemp != null)
            {
                NombreAttrTemp = new ONText(linstance.NombreAttrTemp);
            }
            else
            {
                NombreAttrTemp = null;
            }
            PasajeroAeronaveRoleTemp = linstance.PasajeroAeronaveRoleTemp;
            StateObj = new ONString(linstance.StateObj);

            base.Copy(instance);
        }
        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);
        }
Example #13
0
 /// <summary>
 /// Method of Copy
 /// </summary>
 /// <param name="instance">Instance to be copied</param>
 public virtual void Copy(ONInstance instance)
 {
     if (instance != null)
     {
         OnContext = instance.OnContext;
         ClassName = instance.ClassName;
         if ((object)instance.Lmd.Value == null)
         {
             Lmd = null;
         }
         else if (instance.Lmd.Value == null)
         {
             Lmd = ONDateTime.Null;
         }
         else
         {
             Lmd = new ONDateTime(instance.Lmd.TypedValue);
         }
         Modified = instance.Modified;
     }
 }
Example #14
0
        public ONSimpleType DisplaysetItemValue(ONPath displaysetItem)
        {
            if ((displaysetItem == null) || (displaysetItem.Count == 0))
            {
                return(null);
            }

            ONPath       lDisplaysetItem = new ONPath(displaysetItem);
            string       lRol            = lDisplaysetItem.RemoveHead();
            PropertyInfo lProperty       = null;
            MethodInfo   lMethod         = null;
            string       methodName      = lRol + "RoleHV";

            // Last unique role (like attributes)
            if (lDisplaysetItem.Count == 0)
            {
                lProperty = ONContext.GetPropertyInfoWithAttribute(GetType(), typeof(ONAttributeAttribute), "<Attribute>" + lRol + "</Attribute>");
                if (lProperty != null)
                {
                    return((lProperty.GetValue(this, null)) as ONSimpleType);
                }
            }

            // Roles
            lMethod = GetType().GetMethod(methodName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
            if (lMethod != null)
            {
                ONCollection lCollection = lMethod.Invoke(this, null) as ONCollection;
                if (lCollection.Count <= 0)
                {
                    return(ONSimpleType.Null(ONInstance.GetTypeOfAttribute(GetType(), displaysetItem)));
                }

                ONInstance lInstance = lCollection[0];

                return(lInstance.DisplaysetItemValue(lDisplaysetItem));
            }

            return(null);
        }
Example #15
0
        public static string GetTargetClass(ONContext onContext, Type typeInstance, ONPath path)
        {
            foreach (string lRole in path.Roles)
            {
                // Attributes
                ONAttributeAttribute lAttributeAttribute = ONContext.GetAttributeInProperty(typeInstance, typeof(ONAttributeAttribute), "<Attribute>" + lRole + "</Attribute>") as ONAttributeAttribute;

                if (lAttributeAttribute != null)
                {
                    return(lAttributeAttribute.FacetOfField);
                }

                // Roles
                ONRoleAttribute lRoleAttribute = ONContext.GetAttributeInProperty(typeInstance, typeof(ONRoleAttribute), "<Role>" + lRole + "</Role>") as ONRoleAttribute;

                if (lRoleAttribute != null)
                {
                    typeInstance = ONContext.GetType_Instance(lRoleAttribute.Domain);
                }
                else
                {
                    break;
                }
            }

            if (typeInstance != null)
            {
                object[] lParameters = new object[1];
                lParameters[0] = onContext;

                ONInstance lInstance = Activator.CreateInstance(typeInstance, lParameters) as ONInstance;
                return(lInstance.ClassName);
            }
            else
            {
                return("");
            }
        }
        public override void Copy(ONInstance instance)
        {
            PasajeroAeronaveInstance linstance = instance as PasajeroAeronaveInstance;

            Oid = new PasajeroAeronaveOid(linstance.Oid);

            NombreAeronaveAttr       = new ONString(linstance.NombreAeronaveAttr);
            NombrePasajeroAttr       = new ONString(linstance.NombrePasajeroAttr);
            RevisionPasajeroRoleTemp = linstance.RevisionPasajeroRoleTemp;
            AeronaveRoleTemp         = linstance.AeronaveRoleTemp;
            if (linstance.AeronaveRoleOidTemp != null)
            {
                AeronaveRoleOidTemp = new AeronaveOid(linstance.AeronaveRoleOidTemp);
            }
            PasajeroRoleTemp = linstance.PasajeroRoleTemp;
            if (linstance.PasajeroRoleOidTemp != null)
            {
                PasajeroRoleOidTemp = new PasajeroOid(linstance.PasajeroRoleOidTemp);
            }
            StateObj = new ONString(linstance.StateObj);

            base.Copy(instance);
        }
Example #17
0
        public override void Copy(ONInstance instance)
        {
            AeronaveInstance linstance = instance as AeronaveInstance;

            Oid = new AeronaveOid(linstance.Oid);

            if ((object)linstance.NombreAttrTemp != null)
            {
                NombreAttrTemp = new ONText(linstance.NombreAttrTemp);
            }
            else
            {
                NombreAttrTemp = null;
            }
            MaximoPasajerosAttr = new ONInt(linstance.MaximoPasajerosAttr);
            if ((object)linstance.OrigenAttrTemp != null)
            {
                OrigenAttrTemp = new ONText(linstance.OrigenAttrTemp);
            }
            else
            {
                OrigenAttrTemp = null;
            }
            if ((object)linstance.DestinoAttrTemp != null)
            {
                DestinoAttrTemp = new ONText(linstance.DestinoAttrTemp);
            }
            else
            {
                DestinoAttrTemp = null;
            }
            PasajeroAeronaveRoleTemp = linstance.PasajeroAeronaveRoleTemp;
            StateObj = new ONString(linstance.StateObj);

            base.Copy(instance);
        }
Example #18
0
 public override void UpdateDeleted(ONInstance instance)
 {
 }
Example #19
0
 public override void UpdateAdded(ONInstance instance)
 {
 }
Example #20
0
        public void LoadRelated(ONContext onContext, ONDisplaySet displaySet, object[] columns, int index, ONInstance instance)
        {
            // Related attributes
            for (; index < displaySet.ElementsInData; index++)
            {
                ONDisplaySetItem lDSItem = displaySet[index];
                string lTypeName = ONInstance.GetTypeOfAttribute(instance.GetType(), new ONPath(lDSItem.Path));

                instance.RelatedValues.Add(lDSItem.Path, ONDBData.GetBasicTypeFromDB(lTypeName, columns[index]));
            }
        }
Example #21
0
 public virtual ONCollection ExecuteQuery(ONSql onSql, ONFilterList onFilterList, ONOrderCriteria comparer, ONOid startRowOID, int blockSize, ONInstance instance)
 {
     return null;
 }
Example #22
0
 /// <summary>
 /// Compare with oid fields
 /// </summary>
 /// <param name="instance1">Instance 1</param>
 /// <param name="instance2">Instance 2</param>
 /// <returns>0 if equals, -1 if instance1 is minor, 1 if instance2 is mayor</returns>
 public virtual int CompareUnionOID(ONInstance instance1, ONInstance instance2)
 {
     return 0;
 }
        public override void Copy(ONInstance instance)
        {
            NaveNodrizaInstance linstance = instance as NaveNodrizaInstance;

            Oid = new NaveNodrizaOid(linstance.Oid);

            Nombre_NaveNodrizaAttr = new ONString(linstance.Nombre_NaveNodrizaAttr);
            StateObj = new ONString(linstance.StateObj);

            base.Copy(instance);
        }
 public override bool FilterInMemory(ONInstance instance)
 {
     return (true);
 }
Example #25
0
 public abstract void UpdateAdded(ONInstance instance);
        /// <summary>This method builds the SQL statement to edit the instance in database</summary>
        /// <param name="instance">This parameter represents the instance to be modified in the database</param>
        public override void UpdateEdited(ONInstance instance)
        {
            NaveNodrizaInstance lInstance = instance as NaveNodrizaInstance;

            ONSqlUpdate lOnSql = new ONSqlUpdate();
            lOnSql.AddUpdate(CtesBD.TBL_NAVENODRIZA);
            // Field 'id_NaveNodriza'
            // Update not needed (OID)
            lOnSql.AddSet(CtesBD.FLD_NAVENODRIZA_ESTADOOBJ, lInstance.StateObj);
            lOnSql.AddSet(CtesBD.FLD_NAVENODRIZA_FUM, new ONDateTime(DateTime.Now));
            // Field 'Nombre_NaveNodriza'
            if (lInstance.Nombre_NaveNodrizaAttrModified)
                lOnSql.AddSet(CtesBD.FLD_NAVENODRIZA_NOMBRE_NAVENODRIZA, lInstance.Nombre_NaveNodrizaAttr);

            lOnSql.AddWhere(CtesBD.FLD_NAVENODRIZA_ID_NAVENODRIZA, lInstance.Oid.Id_NaveNodrizaAttr);
            Execute(lOnSql);
        }
Example #27
0
 public abstract void UpdateDeleted(ONInstance instance);
Example #28
0
        public ONInstance LocalSearch(ONInstance instance)
        {
            ONSqlSelect onSql = new ONSqlSelect();

            // Create select and first table
            InhRetrieveInstances(onSql, null, null, OnContext);

            // Fix instance
            InhFixInstance(onSql, null, null, instance.Oid);

            // Execute
            ONCollection lCollection = ExecuteQuery(onSql, instance);

            if (lCollection.Count > 0)
                return lCollection[0];
            else
                return null;
        }
Example #29
0
 public override void UpdateEdited(ONInstance instance)
 {
 }
Example #30
0
        /// <summary>This method builds the SQL statement to insert the instance in database</summary>
        /// <param name="instance">This parameter represents the instance to be inserted in the database</param>
        public override void UpdateAdded(ONInstance instance)
        {
            AeronaveInstance lInstance = instance as AeronaveInstance;

            ONSqlInsert lOnSql = new ONSqlInsert();
            lOnSql.AddInto(CtesBD.TBL_AERONAVE);
            // Field 'id_Aeronave'
            lOnSql.AddValue(CtesBD.FLD_AERONAVE_ID_AERONAVE, lInstance.Oid.Id_AeronaveAttr);
            lOnSql.AddValue(CtesBD.FLD_AERONAVE_ESTADOOBJ, lInstance.StateObj);
            lOnSql.AddValue(CtesBD.FLD_AERONAVE_FUM, new ONDateTime(DateTime.Now));
            // Field 'Nombre'
            lOnSql.AddValue(CtesBD.FLD_AERONAVE_NOMBRE, lInstance.NombreAttr);
            // Field 'MaximoPasajeros'
            lOnSql.AddValue(CtesBD.FLD_AERONAVE_MAXIMOPASAJEROS, lInstance.MaximoPasajerosAttr);
            // Field 'Origen'
            lOnSql.AddValue(CtesBD.FLD_AERONAVE_ORIGEN, lInstance.OrigenAttr);
            // Field 'Destino'
            lOnSql.AddValue(CtesBD.FLD_AERONAVE_DESTINO, lInstance.DestinoAttr);
            Execute(lOnSql);
        }
        public override void Copy(ONInstance instance)
        {
            RevisionInstance linstance = instance as RevisionInstance;

            Oid = new RevisionOid(linstance.Oid);

            NombreRevisorAttr = new ONString(linstance.NombreRevisorAttr);
            FechaRevisionAttr = new ONDate(linstance.FechaRevisionAttr);
            Id_AeronaveAttr = new ONString(linstance.Id_AeronaveAttr);
            RevisionPasajeroRoleTemp = linstance.RevisionPasajeroRoleTemp;
            StateObj = new ONString(linstance.StateObj);

            base.Copy(instance);
        }
Example #32
0
        /// <summary>This method builds the SQL statement to edit the instance in database</summary>
        /// <param name="instance">This parameter represents the instance to be modified in the database</param>
        public override void UpdateEdited(ONInstance instance)
        {
            AeronaveInstance lInstance = instance as AeronaveInstance;

            ONSqlUpdate lOnSql = new ONSqlUpdate();
            lOnSql.AddUpdate(CtesBD.TBL_AERONAVE);
            // Field 'id_Aeronave'
            // Update not needed (OID)
            lOnSql.AddSet(CtesBD.FLD_AERONAVE_ESTADOOBJ, lInstance.StateObj);
            lOnSql.AddSet(CtesBD.FLD_AERONAVE_FUM, new ONDateTime(DateTime.Now));
            // Field 'Nombre'
            if (lInstance.NombreAttrModified)
                lOnSql.AddSet(CtesBD.FLD_AERONAVE_NOMBRE, lInstance.NombreAttr);
            // Field 'MaximoPasajeros'
            if (lInstance.MaximoPasajerosAttrModified)
                lOnSql.AddSet(CtesBD.FLD_AERONAVE_MAXIMOPASAJEROS, lInstance.MaximoPasajerosAttr);
            // Field 'Origen'
            if (lInstance.OrigenAttrModified)
                lOnSql.AddSet(CtesBD.FLD_AERONAVE_ORIGEN, lInstance.OrigenAttr);
            // Field 'Destino'
            if (lInstance.DestinoAttrModified)
                lOnSql.AddSet(CtesBD.FLD_AERONAVE_DESTINO, lInstance.DestinoAttr);

            lOnSql.AddWhere(CtesBD.FLD_AERONAVE_ID_AERONAVE, lInstance.Oid.Id_AeronaveAttr);
            Execute(lOnSql);
        }
        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);
        }
Example #34
0
 public abstract void UpdateEdited(ONInstance instance);
Example #35
0
        /// <summary>
        /// Compare with oid fields
        /// </summary>
        /// <param name="instance1">Instance 1</param>
        /// <param name="instance2">Instance 2</param>
        /// <returns>0 if equals, -1 if instance1 is minor, 1 if instance2 is mayor</returns>
        public override int CompareUnionOID(ONInstance instance1, ONInstance instance2)
        {
            // Null Management
            if ((instance1 == null) && (instance2 == null))
                return 0;
            else if (instance1 == null)
                return -1;
            else if (instance2 == null)
                return 1;

            AeronaveInstance lInstance1 = instance1 as AeronaveInstance;
            AeronaveInstance lInstance2 = instance2 as AeronaveInstance;

            int lCompare = 0;

            // id_Aeronave(Asc)
            lCompare = lInstance1.Id_AeronaveAttr.CompareTo(lInstance2.Id_AeronaveAttr);
            if (lCompare != 0)
                return lCompare;

            return 0;
        }
        ///<summary> 
        /// This method builds the SQL statment to delete the instance in database 
        ///</summary>
        ///<param name = instance>
        ///This parameter represents the instance to be deleted in the database
        ///</param>
        public override void UpdateDeleted(ONInstance instance)
        {
            NaveNodrizaInstance lInstance = instance as NaveNodrizaInstance;

            ONSqlDelete lOnSql = new ONSqlDelete();
            lOnSql.AddFrom(CtesBD.TBL_NAVENODRIZA);
            lOnSql.AddWhere(CtesBD.FLD_NAVENODRIZA_ID_NAVENODRIZA, lInstance.Oid.Id_NaveNodrizaAttr);
            Execute(lOnSql);
        }
Example #37
0
        ///<summary> 
        /// This method builds the SQL statment to delete the instance in database 
        ///</summary>
        ///<param name = instance>
        ///This parameter represents the instance to be deleted in the database
        ///</param>
        public override void UpdateDeleted(ONInstance instance)
        {
            AeronaveInstance lInstance = instance as AeronaveInstance;

            ONSqlDelete lOnSql = new ONSqlDelete();
            lOnSql.AddFrom(CtesBD.TBL_AERONAVE);
            lOnSql.AddWhere(CtesBD.FLD_AERONAVE_ID_AERONAVE, lInstance.Oid.Id_AeronaveAttr);
            Execute(lOnSql);
        }
        /// <summary>This method builds the SQL statement to insert the instance in database</summary>
        /// <param name="instance">This parameter represents the instance to be inserted in the database</param>
        public override void UpdateAdded(ONInstance instance)
        {
            NaveNodrizaInstance lInstance = instance as NaveNodrizaInstance;

            ONSqlInsert lOnSql = new ONSqlInsert();
            lOnSql.AddInto(CtesBD.TBL_NAVENODRIZA);
            // Field 'id_NaveNodriza'
            lOnSql.AddValue(CtesBD.FLD_NAVENODRIZA_ID_NAVENODRIZA, lInstance.Oid.Id_NaveNodrizaAttr);
            lOnSql.AddValue(CtesBD.FLD_NAVENODRIZA_ESTADOOBJ, lInstance.StateObj);
            lOnSql.AddValue(CtesBD.FLD_NAVENODRIZA_FUM, new ONDateTime(DateTime.Now));
            // Field 'Nombre_NaveNodriza'
            lOnSql.AddValue(CtesBD.FLD_NAVENODRIZA_NOMBRE_NAVENODRIZA, lInstance.Nombre_NaveNodrizaAttr);
            Execute(lOnSql);
        }
        public override void Copy(ONInstance instance)
        {
            PasajeroInstance linstance = instance as PasajeroInstance;

            Oid = new PasajeroOid(linstance.Oid);

            if ((object) linstance.NombreAttrTemp != null)
                NombreAttrTemp = new ONText(linstance.NombreAttrTemp);
            else
                NombreAttrTemp = null;
            PasajeroAeronaveRoleTemp = linstance.PasajeroAeronaveRoleTemp;
            StateObj = new ONString(linstance.StateObj);

            base.Copy(instance);
        }
Example #40
0
        /// <summary>
        /// Create an instance of the Server component
        /// </summary>
        /// <param name="className">Name of the class necessary to create the component</param>
        /// <param name="onContext">Object of type onContext needed to create an object of this type</param>
        /// <param name="instance">Object of type instance needed to create an object of this type</param>
        public static ONServer GetComponent_Server(string className, ONContext onContext, ONInstance instance)
        {
            object[] lParams = {onContext, instance};

            //if (className == "")
            //	return GetComponent("SIGEM.Business.Server.GlobalTransactionServer", lParams) as ONServer;
              if (className == "" || className == "GlobalTransaction")
                        return new GlobalTransactionServer(onContext as ONServiceContext) as ONServer;
            else
                return GetComponent("SIGEM.Business.Server." + className + "Server", lParams) as ONServer;
        }
Example #41
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="onContext">Context of the execution of the request</param>
 /// <param name="instance">THIS Instance</param>
 /// <param name="className">Name of the class that has the services</param>
 public ONServer(ONServiceContext onContext, ONInstance instance, string className)
 {
     ClassName = className;
     OnContext = onContext;
     Instance = instance;
 }
Example #42
0
 /// <summary>
 /// Execution of a query
 /// </summary>
 /// <param name="onSql">Sentence SQL to be executed</param>
 /// <param name="comparer">Order Criteria that must be followed by the query</param>
 /// <param name="startRowOID">OID frontier</param>
 /// <param name="blockSize">Number of instances to be returned</param>
 public ONCollection ExecuteQuery(ONSql onSql, ONInstance instance)
 {
     return ExecuteQuery(onSql, null, null, null, 0, instance);
 }