Beispiel #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="val">Value for this type</param>
 public ONString(ONString val)
 {
     if (val == null)
         Value = null;
     else
         Value = val.Value;
 }
 /// <summary>Default Constructor</summary>
 public NaveNodrizaInstance(ONContext onContext)
     : base(onContext, "NaveNodriza", "Clas_1347649273856884_Alias")
 {
     Oid = new NaveNodrizaOid();
     Nombre_NaveNodrizaAttr = ONString.Null;
     StateObjAttrTemp = null;
 }
 /// <summary>Default Constructor</summary>
 public PasajeroInstance(ONContext onContext)
     : base(onContext, "Pasajero", "Clas_1348178542592658_Alias")
 {
     Oid = new PasajeroOid();
     NombreAttr = null;
     PasajeroAeronaveRoleTemp = null;
     StateObjAttrTemp = null;
 }
 /// <summary>Default Constructor</summary>
 public RevisionInstance(ONContext onContext)
     : base(onContext, "Revision", "Clas_1348178542592347_Alias")
 {
     Oid = new RevisionOid();
     NombreRevisorAttr = ONString.Null;
     FechaRevisionAttr = ONDate.Null;
     Id_AeronaveAttr = ONString.Null;
     RevisionPasajeroRoleTemp = null;
     StateObjAttrTemp = null;
 }
 /// <summary>Default Constructor</summary>
 public RevisionPasajeroInstance(ONContext onContext)
     : base(onContext, "RevisionPasajero", "Clas_1348178673664478_Alias")
 {
     Oid = new RevisionPasajeroOid();
     RevisionRoleTemp = null;
     RevisionRoleOidTemp = null;
     PasajeroAeronaveRoleTemp = null;
     PasajeroAeronaveRoleOidTemp = null;
     StateObjAttrTemp = null;
 }
 /// <summary>Default Constructor</summary>
 public AeronaveInstance(ONContext onContext)
     : base(onContext, "Aeronave", "Clas_1348178411520734_Alias")
 {
     Oid = new AeronaveOid();
     NombreAttr = null;
     MaximoPasajerosAttr = ONInt.Null;
     OrigenAttr = null;
     DestinoAttr = null;
     PasajeroAeronaveRoleTemp = null;
     StateObjAttrTemp = null;
 }
 /// <summary>Default Constructor</summary>
 public PasajeroAeronaveInstance(ONContext onContext)
     : base(onContext, "PasajeroAeronave", "Clas_1348178542592177_Alias")
 {
     Oid = new PasajeroAeronaveOid();
     NombreAeronaveAttr = ONString.Null;
     NombrePasajeroAttr = ONString.Null;
     RevisionPasajeroRoleTemp = null;
     AeronaveRoleTemp = null;
     AeronaveRoleOidTemp = null;
     PasajeroRoleTemp = null;
     PasajeroRoleOidTemp = null;
     StateObjAttrTemp = null;
 }
        public RevisionInstance Create_instanceServ(ONInt p_atrid_RevisarAeronaveArg, ONDate p_atrFechaRevisionArg, ONString p_atrNombreRevisorArg, ONString p_atrId_AeronaveArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {

                // Call Executive
                RevisionExecutive lExecutive = new RevisionExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance = Instance;
                Instance = lExecutive.Create_instanceServ(p_atrid_RevisarAeronaveArg, p_atrFechaRevisionArg, p_atrNombreRevisorArg, p_atrId_AeronaveArg);

            }

            return Instance;
        }
        public AdministradorInstance Create_instanceServ(ONInt p_atrid_AdministradorArg, ONString p_passwordArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {

                // Call Executive
                AdministradorExecutive lExecutive = new AdministradorExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance = Instance;
                Instance = lExecutive.Create_instanceServ(p_atrid_AdministradorArg, p_passwordArg);

            }

            return Instance;
        }
        public PasajeroAeronaveInstance Create_instanceServ(AeronaveOid p_agrAeronaveArg, PasajeroOid p_agrPasajeroArg, ONInt p_atrid_PasajeroAeronaveArg, ONString p_atrNombreAeronaveArg, ONString p_atrNombrePasajeroArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {

                // Call Executive
                PasajeroAeronaveExecutive lExecutive = new PasajeroAeronaveExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance = Instance;
                Instance = lExecutive.Create_instanceServ(p_agrAeronaveArg, p_agrPasajeroArg, p_atrid_PasajeroAeronaveArg, p_atrNombreAeronaveArg, p_atrNombrePasajeroArg);

            }

            return Instance;
        }
        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 RevisionInstance Create_instanceServ(ONInt p_atrid_RevisarAeronaveArg, ONDate p_atrFechaRevisionArg, ONString p_atrNombreRevisorArg, ONString p_atrId_AeronaveArg)
        {
            if (Instance != null)
            {
                ONFilterList onfilt = new ONFilterList();
                onfilt.Add("QueryByOid", new QueryByOidFilter(Instance.Oid));
                Instance.Find(onfilt);
            }
            // Execute service
            RevisionAction lAction = new RevisionAction(OnContext);
            lAction.Instance = new RevisionInstance(OnContext);
            Instance = lAction.Create_instanceServ(p_atrid_RevisarAeronaveArg, p_atrFechaRevisionArg, p_atrNombreRevisorArg, p_atrId_AeronaveArg);

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

            return Instance;
        }
        internal AdministradorInstance Create_instanceServ(ONInt p_atrid_AdministradorArg, ONString p_passwordArg)
        {
            if (Instance != null)
            {
                ONFilterList onfilt = new ONFilterList();
                onfilt.Add("QueryByOid", new QueryByOidFilter(Instance.Oid));
                Instance.Find(onfilt);
            }
            // Execute service
            AdministradorAction lAction = new AdministradorAction(OnContext);
            lAction.Instance = new AdministradorInstance(OnContext);
            Instance = lAction.Create_instanceServ(p_atrid_AdministradorArg, p_passwordArg);

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

            return Instance;
        }
Beispiel #14
0
 /// <summary>
 /// Creates XML elements from the data of the system.
 /// </summary>
 /// <param name="xmlWriter">Object with the XML message to add new information and return to client side</param>
 /// <param name="val">Value to be puted inside the XML message</param>
 /// <param name="dtdVersion">Version of the DTD that follows the XML message</param>
 /// <param name="xmlElement">Element of the XML that is checked</param>
 public static void ON2XML(XmlWriter xmlWriter, ONString val, double dtdVersion, string xmlElement)
 {
     if (val == null)
     {
         if (xmlElement == ONXml.XMLTAG_V)
             xmlWriter.WriteElementString(xmlElement, "");
         else
             xmlWriter.WriteElementString(ONXml.XMLTAG_NULL, null);
     }
     else
     {
         xmlWriter.WriteStartElement(xmlElement);
         if (xmlElement == ONXml.XMLTAG_OIDFIELD && dtdVersion > 2.0)
             xmlWriter.WriteAttributeString("Type", "string");
         xmlWriter.WriteString(val.TypedValue);
         xmlWriter.WriteEndElement();
     }
 }
        internal PasajeroAeronaveInstance Create_instanceServ(AeronaveOid p_agrAeronaveArg, PasajeroOid p_agrPasajeroArg, ONInt p_atrid_PasajeroAeronaveArg, ONString p_atrNombreAeronaveArg, ONString p_atrNombrePasajeroArg)
        {
            if (Instance != null)
            {
                ONFilterList onfilt = new ONFilterList();
                onfilt.Add("QueryByOid", new QueryByOidFilter(Instance.Oid));
                Instance.Find(onfilt);
            }
            // Execute service
            PasajeroAeronaveAction lAction = new PasajeroAeronaveAction(OnContext);
            lAction.Instance = new PasajeroAeronaveInstance(OnContext);
            Instance = lAction.Create_instanceServ(p_agrAeronaveArg, p_agrPasajeroArg, p_atrid_PasajeroAeronaveArg, p_atrNombreAeronaveArg, p_atrNombrePasajeroArg);

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

            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;
        }
Beispiel #17
0
        public static ONBool Like(ONString obj1, ONString obj2)
        {
            if (((object) obj1 == null) || (obj1.Value == null) ||((object) obj2 == null) || (obj2.Value == null))
                return new ONBool(false);

            return new ONBool(obj1.TypedValue.ToUpper().StartsWith(obj2.TypedValue.ToUpper()));
        }
        /// <summary>
        /// Return a new String with all its characters in their Lowercase variant
        /// </summary>		
        public static ONString lowerCase(ONString aString)
        {
            if (aString == null)
                return ONString.Null;

            return new ONString(aString.TypedValue.ToLower());
        }
Beispiel #19
0
        public static ONBool Contains(ONString obj1, ONString obj2)
        {
            if (((object)obj1 == null) || (obj1.Value == null) || ((object)obj2 == null) || (obj2.Value == null))
              			return new ONBool(false);

              		return new ONBool(obj1.TypedValue.ToUpper().IndexOf(obj2.TypedValue.ToUpper()) != -1);
        }
        /// <summary>
        /// Returns a copy of the aString string with a number of times occurrences of the 
        /// subStr substring specified replaced by the other string, starting from the from position
        /// </summary>			
        public static ONString replaceTimes(ONString aString, ONString subStr, ONString other, ONInt from, ONInt times)
        {
            if (aString == null || subStr == null || other == null || from == null || times == null)
                return ONString.Null;

            string lAString = aString.TypedValue;
            string lSubStr = subStr.TypedValue;
            string lOther = other.TypedValue;
            int lFrom = from.TypedValue;
            int lTimes = times.TypedValue;

            System.Text.StringBuilder lBuffer = new System.Text.StringBuilder();
            int lOldPos = lFrom - 1;
            lBuffer.Append(lAString.Substring(0, lFrom - 1));
            int pos = lAString.IndexOf(lSubStr, lFrom - 1);
            for (; pos >= 0 && lTimes > 0; pos = lAString.IndexOf(lSubStr, lOldPos), lTimes--)
            {
                lBuffer.Append(lAString.Substring(lOldPos, pos - lOldPos));
                lBuffer.Append(lOther);
                lOldPos = pos + lSubStr.Length;
            }
            lBuffer.Append(lAString.Substring(lOldPos));
            return new ONString(lBuffer.ToString());
        }
        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 void CheckSTDiagram_create_instance(ONInt p_atrid_NaveNodrizaArg, ONString p_atrNombre_NaveNodrizaArg)
 {
     Instance.StateObj = new ONString("NaveNo0");
 }
        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);
        }
 internal void MVChangePassWordServ(ONString oldpasswordArg, ONString newpasswordArg)
 {
     // Execute service
     AdministradorAction lAction = new AdministradorAction(OnContext);
     lAction.Instance = Instance;
     lAction.MVChangePassWordServ(oldpasswordArg, newpasswordArg);
 }
        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);
        }
 internal void SetPasswordServ(AdministradorOid p_thisAdministradorArg, ONString p_NewPasswordArg)
 {
     if (Instance != null)
     {
         ONFilterList onfilt = new ONFilterList();
         onfilt.Add("QueryByOid", new QueryByOidFilter(Instance.Oid));
         Instance.Find(onfilt);
     }
     // Execute service
     AdministradorAction lAction = new AdministradorAction(OnContext);
     lAction.Instance = Instance;
     lAction.SetPasswordServ(p_thisAdministradorArg, p_NewPasswordArg);
 }
        public void SetPasswordServ(AdministradorOid p_thisAdministradorArg, ONString p_NewPasswordArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {
                // Change to Transactional OnContext
                Instance.OnContext = lOnContext;

                // Call Executive
                AdministradorExecutive lExecutive = new AdministradorExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance = Instance;
                lExecutive.SetPasswordServ(p_thisAdministradorArg, p_NewPasswordArg);

                // Change to Non-Transactional OnContext
                Instance.OnContext = OnContext;
            }
        }
        public void MVChangePassWordServ(ONString oldpasswordArg, ONString newpasswordArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {
                // Change to Transactional OnContext
                Instance.OnContext = lOnContext;

                // Call Executive
                AdministradorExecutive lExecutive = new AdministradorExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance = Instance;
                lExecutive.MVChangePassWordServ(oldpasswordArg, newpasswordArg);

                // Change to Non-Transactional OnContext
                Instance.OnContext = OnContext;
            }
        }
 public void MVAgentValidationServ(AdministradorOid agentOid, ONString passwordArg)
 {
     passwordArg.TypedValue = ONSecureControl.CipherPassword(passwordArg.TypedValue);
     ONString lPassword = new ONString((Instance.PassWordAttr));
     if (!((lPassword.TypedValue == passwordArg.TypedValue) && (string.Compare(agentOid.ClassName, "Administrador", true) == 0 )))
         throw new ONAgentValidationException(null);
     OnContext.OidAgent = agentOid;
 }
        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);
        }