Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        public NaveNodrizaInstance Create_instanceServ(ONInt p_atrid_NaveNodrizaArg, ONString p_atrNombre_NaveNodrizaArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {

                // Call Executive
                NaveNodrizaExecutive lExecutive = new NaveNodrizaExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance = Instance;
                Instance = lExecutive.Create_instanceServ(p_atrid_NaveNodrizaArg, p_atrNombre_NaveNodrizaArg);

            }

            return Instance;
        }
        internal NaveNodrizaInstance Create_instanceServ(ONInt p_atrid_NaveNodrizaArg, ONString p_atrNombre_NaveNodrizaArg)
        {
            if (Instance != null)
            {
                ONFilterList onfilt = new ONFilterList();
                onfilt.Add("QueryByOid", new QueryByOidFilter(Instance.Oid));
                Instance.Find(onfilt);
            }
            // Execute service
            NaveNodrizaAction lAction = new NaveNodrizaAction(OnContext);
            lAction.Instance = new NaveNodrizaInstance(OnContext);
            Instance = lAction.Create_instanceServ(p_atrid_NaveNodrizaArg, p_atrNombre_NaveNodrizaArg);

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

            return Instance;
        }
Ejemplo n.º 4
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_1347649273856884Ser_3_Alias", NaveNodrizaClassText.Edit_instanceServiceAlias, "Clas_1347649273856884_Alias", NaveNodrizaClassText.ClassAlias);
            lSInfo.AddOIDArgument("p_thisNaveNodriza", false, "NaveNodriza", "Clas_1347649273856884Ser_3Arg_1_Alias", NaveNodrizaClassText.Edit_instance_P_thisNaveNodrizaArgumentAlias);

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

            NaveNodrizaOid lP_thisNaveNodrizaArg = (NaveNodrizaOid) ((ONArgumentInfo) lSInfo.mArgumentList["p_thisNaveNodriza"]).Value;

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

            // Execute Service
            NaveNodrizaInstance lInstance = null;
            try
            {
                ONFilterList lFilterList = new ONFilterList();
                NaveNodrizaInstance lThisInstance = new NaveNodrizaInstance(lOnContext);
                if (lP_thisNaveNodrizaArg != null)
                {
                    lFilterList = new ONFilterList();
                    lFilterList.Add("HorizontalVisibility", new NaveNodrizaHorizontalVisibility());
                    lThisInstance = lP_thisNaveNodrizaArg.GetInstance(lOnContext, lFilterList);
                    if (lThisInstance == null)
                        throw new ONInstanceNotExistException(null, "Clas_1347649273856884_Alias", NaveNodrizaClassText.ClassAlias);
                }

                using (NaveNodrizaServer lServer = new NaveNodrizaServer(lOnContext, lThisInstance))
                {
                    lServer.Edit_instanceServ(lP_thisNaveNodrizaArg);
                    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
        }
Ejemplo n.º 5
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 NaveNodrizaServer(ONServiceContext onContext, NaveNodrizaInstance instance)
     : base(onContext, instance, "NaveNodriza")
 {
 }
Ejemplo n.º 6
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
            NaveNodrizaInstance lInstance = null;
            if (startRowOid != null)
            {
                lInstance = new NaveNodrizaInstance(OnContext);
                lInstance.Oid = startRowOid as NaveNodrizaOid;
            }

            //Default OrderCriteria
            if (comparer == null)
            {
                string lAlias = onSql.GetAlias("NaveNodriza", initialPath);
                if (lInstance != null)
                {
                    onSql.AddOrderBy(lAlias, CtesBD.FLD_NAVENODRIZA_ID_NAVENODRIZA, OrderByTypeEnumerator.Asc, lInstance.Oid.Id_NaveNodrizaAttr);
                }
                else
                {
                    onSql.AddOrderBy(lAlias, CtesBD.FLD_NAVENODRIZA_ID_NAVENODRIZA, 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(NaveNodrizaData.AddPath(onSql, JoinType.LeftJoin, lOrderCriteriaItem.Facet, lPath, null, lOrderCriteriaItem.DomainArgument, false), lOrderCriteriaItem.Attribute, lOrderCriteriaItem.Type, lAttrStartRow);
                    lUseStartRow = (lAttrStartRow != null);
                }
                else
                    onSql.AddOrderBy(NaveNodrizaData.AddPath(onSql, JoinType.LeftJoin, lOrderCriteriaItem.Facet, lPath, null, lOrderCriteriaItem.DomainArgument, false), lOrderCriteriaItem.Attribute, lOrderCriteriaItem.Type, null);
            }
            return;
        }
Ejemplo n.º 7
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 NaveNodrizaInstance LoadFacet(ONContext onContext, ONDisplaySet displaySet, object[] columns, ref int index)
        {
            NaveNodrizaInstance lInstance = new NaveNodrizaInstance(onContext);
            lInstance.Oid = new NaveNodrizaOid();

            // Field 'id_NaveNodriza'
            lInstance.Oid.Id_NaveNodrizaAttr = new ONInt(Convert.ToInt32(columns[index++]));
            lInstance.StateObj = new ONString(((string) columns[index++]).TrimEnd());
            lInstance.Lmd = new ONDateTime((DateTime) columns[index++]);
            // Field 'Nombre_NaveNodriza'
            lInstance.Nombre_NaveNodrizaAttr = new ONString(((string) columns[index++]).TrimEnd());

            lInstance.Modified = false;
            return lInstance;
        }
Ejemplo n.º 8
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 NaveNodrizaInstance(onContext);
            lInstance.Oid = this;
            lInstance = lInstance.Find(lOnFilterList);
            if (lInstance == null)
                lInstance = new NaveNodrizaInstance(onContext);

            return lInstance;
        }