示例#1
0
        public override int CompareTo(object obj)
        {
            ONText lVal = obj as ONText;

            if (lVal == null)
            {
                return(1);
            }

            if (Value == null && lVal.Value == null)
            {
                return(0);
            }

            if (Value == null)
            {
                return(-1);
            }

            if (lVal.Value == null)
            {
                return(1);
            }

            return(TypedValue.CompareTo(lVal.TypedValue));
        }
示例#2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="val">Value for this type</param>
 public ONText(ONText val)
 {
     if (val == null)
         Value = null;
     else
         Value = val.Value;
 }
示例#3
0
        public static ONBool Like(ONText obj1, ONText 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())));
        }
示例#4
0
        public static ONBool Contains(ONText obj1, ONText 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));
        }
示例#5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="val">Value for this type</param>
 public ONText(ONText val)
 {
     if (val == null)
     {
         Value = null;
     }
     else
     {
         Value = val.Value;
     }
 }
示例#6
0
        public AeronaveInstance Create_instanceServ(PasajeroAeronaveOid p_agrPasajeroAeronaveArg, ONInt p_atrid_AeronaveArg, ONText p_atrNombreArg, ONInt p_atrMaximoPasajerosArg, ONText p_atrOrigenArg, ONText p_atrDestinoArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {

                // Call Executive
                AeronaveExecutive lExecutive = new AeronaveExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance = Instance;
                Instance = lExecutive.Create_instanceServ(p_agrPasajeroAeronaveArg, p_atrid_AeronaveArg, p_atrNombreArg, p_atrMaximoPasajerosArg, p_atrOrigenArg, p_atrDestinoArg);

            }

            return Instance;
        }
示例#7
0
        public override bool Equals(object obj)
        {
            ONText lObj2 = obj as ONText;

            if ((Value == null) && (((object)lObj2 == null) || (lObj2.Value == null)))
            {
                return(true);
            }

            if ((Value == null) || (((object)lObj2 == null) || (lObj2.Value == null)))
            {
                return(false);
            }

            return(string.Compare(TypedValue, lObj2.TypedValue, true) == 0);
        }
示例#8
0
        public PasajeroInstance Create_instanceServ(PasajeroAeronaveOid p_agrPasajeroAeronaveArg, ONInt p_atrid_PasajeroArg, ONText p_atrNombreArg)
        {
            // Create new context
            using (ONServiceContext lOnContext = new ONServiceContext(OnContext))
            {

                // Call Executive
                PasajeroExecutive lExecutive = new PasajeroExecutive();
                lExecutive.OnContext = lOnContext;
                lExecutive.Instance = Instance;
                Instance = lExecutive.Create_instanceServ(p_agrPasajeroAeronaveArg, p_atrid_PasajeroArg, p_atrNombreArg);

            }

            return Instance;
        }
示例#9
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, ONText 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", "text");
         xmlWriter.WriteString(val.TypedValue);
         xmlWriter.WriteEndElement();
     }
 }
        internal AeronaveInstance Create_instanceServ(PasajeroAeronaveOid p_agrPasajeroAeronaveArg, ONInt p_atrid_AeronaveArg, ONText p_atrNombreArg, ONInt p_atrMaximoPasajerosArg, ONText p_atrOrigenArg, ONText p_atrDestinoArg)
        {
            if (Instance != null)
            {
                ONFilterList onfilt = new ONFilterList();
                onfilt.Add("QueryByOid", new QueryByOidFilter(Instance.Oid));
                Instance.Find(onfilt);
            }
            // Execute service
            AeronaveAction lAction = new AeronaveAction(OnContext);
            lAction.Instance = new AeronaveInstance(OnContext);
            Instance = lAction.Create_instanceServ(p_agrPasajeroAeronaveArg, p_atrid_AeronaveArg, p_atrNombreArg, p_atrMaximoPasajerosArg, p_atrOrigenArg, p_atrDestinoArg);

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

            return Instance;
        }
示例#11
0
        public static ONBool Like(ONText obj1, ONText 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()));
        }
示例#12
0
        public static ONBool Contains(ONText obj1, ONText 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);
        }
示例#13
0
        /// <summary>
        /// Returns the string representation of value
        /// </summary>			
        public static ONString textToStr(ONText value)
        {
            if (value == null)
                return ONString.Null;

            return new ONString(value.TypedValue);
        }
示例#14
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="oid">OID of the instance whose text attribute value is wanted to be loaded</param>
        public static ONText LoadTextNombre(ONContext onContext, PasajeroOid oid)
        {
            ONSqlSelect lOnSql = new ONSqlSelect();

            lOnSql.CreateAlias(CtesBD.TBL_PASAJERO, null, "Pasajero");
            lOnSql.AddSelect(CtesBD.FLD_PASAJERO_NOMBRE);

            FixInstance(lOnSql, null, null, oid);

            // Create Data Component
            PasajeroData lData = new PasajeroData(onContext);

            // Execute query
            ArrayList lSqlParameters;
            ONText lReturn = new ONText((string) lData.ExecuteScalar(lOnSql.GenerateSQL(out lSqlParameters), lSqlParameters));
            return lReturn;
        }
示例#15
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="oid">OID of the instance whose text attribute value is wanted to be loaded</param>
        public static ONText LoadTextOrigen(ONContext onContext, AeronaveOid oid)
        {
            ONSqlSelect lOnSql = new ONSqlSelect();

            lOnSql.CreateAlias(CtesBD.TBL_AERONAVE, null, "Aeronave");
            lOnSql.AddSelect(CtesBD.FLD_AERONAVE_ORIGEN);

            FixInstance(lOnSql, null, null, oid);

            // Create Data Component
            AeronaveData lData = new AeronaveData(onContext);

            // Execute query
            ArrayList lSqlParameters;
            ONText lReturn = new ONText((string) lData.ExecuteScalar(lOnSql.GenerateSQL(out lSqlParameters), lSqlParameters));
            return lReturn;
        }
示例#16
0
        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);
        }
示例#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);
        }