/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
public static void ReadValues(this AccountBanTable source, System.Data.IDataRecord dataRecord)
{
System.Int32 i;

i = dataRecord.GetOrdinal("account_id");

source.AccountID = (DemoGame.AccountID)(DemoGame.AccountID)dataRecord.GetInt32(i);

i = dataRecord.GetOrdinal("end_time");

source.EndTime = (System.DateTime)(System.DateTime)dataRecord.GetDateTime(i);

i = dataRecord.GetOrdinal("expired");

source.Expired = (System.Boolean)(System.Boolean)dataRecord.GetBoolean(i);

i = dataRecord.GetOrdinal("id");

source.ID = (System.Int32)(System.Int32)dataRecord.GetInt32(i);

i = dataRecord.GetOrdinal("issued_by");

source.IssuedBy = (System.String)(System.String)(dataRecord.IsDBNull(i) ? (System.String)null : dataRecord.GetString(i));

i = dataRecord.GetOrdinal("reason");

source.Reason = (System.String)(System.String)dataRecord.GetString(i);

i = dataRecord.GetOrdinal("start_time");

source.StartTime = (System.DateTime)(System.DateTime)dataRecord.GetDateTime(i);
}
Esempio n. 2
0
        /// <summary>
        /// Permet remplir les propriétés de mappage de l'entité réponse.
        /// </summary>
        /// <param name="reader">reader contenant les données.</param>
        /// <returns>Un objet reponseDTO.</returns>
        public override Mappage.DTOBase populateDTO(System.Data.SqlClient.SqlDataReader reader)
        {
            reponseDTO reponse = new reponseDTO();

            if (!reader.IsDBNull(ordReponseGuid)) { reponse.reponseGuid = reader.GetGuid(ordReponseGuid); }
            if (!reader.IsDBNull(ordReponseIntitule)) { reponse.reponseIntitule = reader.GetString(ordReponseIntitule); }
            if (!reader.IsDBNull(ordReponseJuste)) { reponse.reponseJuste = reader.GetBoolean(ordReponseJuste); }
            if (!reader.IsDBNull(ordReponseQuestionGuid)) { reponse.reponseQuestionGuid = reader.GetInt32(ordReponseQuestionGuid); }

            reponse.isNew = false;
            return reponse;
        }
Esempio n. 3
0
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
public static void ReadValues(this ShopTable source, System.Data.IDataRecord dataRecord)
{
System.Int32 i;

i = dataRecord.GetOrdinal("can_buy");

source.CanBuy = (System.Boolean)(System.Boolean)dataRecord.GetBoolean(i);

i = dataRecord.GetOrdinal("id");

source.ID = (NetGore.Features.Shops.ShopID)(NetGore.Features.Shops.ShopID)dataRecord.GetUInt16(i);

i = dataRecord.GetOrdinal("name");

source.Name = (System.String)(System.String)dataRecord.GetString(i);
}
Esempio n. 4
0
        private OutputQueueData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            try
              {
              ruleid = info.GetInt32("ruleid");
              priority = info.GetInt32("priority");
              mode = (OutputModeEnum)info.GetValue("mode", typeof(OutputModeEnum));

              _IsSuccess = info.GetBoolean("_IsSuccess");
              _devName = info.GetString("_devName");
              _status = info.GetInt32("_status");

              data = info.GetValue("data", typeof(object));
              }
              catch (Exception ex)
              {
              Console.WriteLine(ex.Message + "," + ex.StackTrace);
              }
        }
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
public static void ReadValues(this QuestTable source, System.Data.IDataRecord dataRecord)
{
System.Int32 i;

i = dataRecord.GetOrdinal("id");

source.ID = (NetGore.Features.Quests.QuestID)(NetGore.Features.Quests.QuestID)dataRecord.GetUInt16(i);

i = dataRecord.GetOrdinal("repeatable");

source.Repeatable = (System.Boolean)(System.Boolean)dataRecord.GetBoolean(i);

i = dataRecord.GetOrdinal("reward_cash");

source.RewardCash = (System.Int32)(System.Int32)dataRecord.GetInt32(i);

i = dataRecord.GetOrdinal("reward_exp");

source.RewardExp = (System.Int32)(System.Int32)dataRecord.GetInt32(i);
}
Esempio n. 6
0
 public static Boolean GetDBBoolean(String sqlFieldName, System.Data.SqlClient.SqlDataReader reader)
 {
     return reader[sqlFieldName].Equals(DBNull.Value) ? false : reader.GetBoolean(reader.GetOrdinal(sqlFieldName));
 }
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
public static void TryReadValues(this AccountBanTable source, System.Data.IDataRecord dataRecord)
{
for (int i = 0; i < dataRecord.FieldCount; i++)
{
switch (dataRecord.GetName(i))
{
case "account_id":
source.AccountID = (DemoGame.AccountID)(DemoGame.AccountID)dataRecord.GetInt32(i);
break;


case "end_time":
source.EndTime = (System.DateTime)(System.DateTime)dataRecord.GetDateTime(i);
break;


case "expired":
source.Expired = (System.Boolean)(System.Boolean)dataRecord.GetBoolean(i);
break;


case "id":
source.ID = (System.Int32)(System.Int32)dataRecord.GetInt32(i);
break;


case "issued_by":
source.IssuedBy = (System.String)(System.String)(dataRecord.IsDBNull(i) ? (System.String)null : dataRecord.GetString(i));
break;


case "reason":
source.Reason = (System.String)(System.String)dataRecord.GetString(i);
break;


case "start_time":
source.StartTime = (System.DateTime)(System.DateTime)dataRecord.GetDateTime(i);
break;


}

}
}
Esempio n. 8
0
		protected PhoneNumber(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		{
			this.PhoneNumberID = info.GetInt32("PhoneNumberID");
			this.TenDigit = info.GetString("TenDigit");
			this.Extension = info.GetString("Extension");
			this.PersonID = info.GetInt32("PersonID");
			this.SortOrder = info.GetByte("SortOrder");
			this.LastModifiedBy = info.GetInt32("LastModifiedBy");
			this.LastModifiedAt = (DateTime)info.GetValue("LastModifiedAt", typeof(DateTime));
			this.Active = info.GetBoolean("Active");
			CustomizeDeserializationProcess(info, context);
		}
Esempio n. 9
0
 partial void CustomizeDeserializationProcess(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     this.EditToken = (Guid)info.GetValue("EditToken", typeof(Guid));
     this.WasModified = info.GetBoolean("WasModified");
 }
 /// <summary>
 /// Constructs a new instance of the HttpWebRequestResponseData class with serialized data.
 /// </summary>
 /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data.</param>
 /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
 /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception>
 /// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception>
 protected HttpWebRequestResponseData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     if (info != null)
     {
         this._headerNames = (string[])info.GetValue("_headerNames", typeof(string[]));
         this._headerNamesSet = (HashSet<string>)info.GetValue("_headerNamesSet", typeof(HashSet<string>));
         this._headers = (Dictionary<string, string>)info.GetValue("_headers", typeof(Dictionary<string, string>));
         this.StatusCode = (HttpStatusCode)info.GetValue("StatusCode", typeof(HttpStatusCode));
         this.IsSuccessStatusCode = info.GetBoolean("IsSuccessStatusCode");
         this.ContentType = info.GetString("ContentType");
         this.ContentLength = info.GetInt64("ContentLength");
     }
 }
Esempio n. 11
0
      /// <summary>
      /// Deserializes the axis style (version 0).
      /// </summary>
      /// <param name="obj">The empty axis object to deserialize into.</param>
      /// <param name="info">The serialization info.</param>
      /// <param name="context">The streaming context.</param>
      /// <param name="selector">The deserialization surrogate selector.</param>
      /// <returns>The deserialized linear axis.</returns>
      public object SetObjectData(object obj,System.Runtime.Serialization.SerializationInfo info,System.Runtime.Serialization.StreamingContext context,System.Runtime.Serialization.ISurrogateSelector selector)
      {
        AxisLineStyle s = (AxisLineStyle)obj;

        s._axisPen      = (PenX)info.GetValue("AxisPen",typeof(PenX));
        s._majorTickPen = (PenX)info.GetValue("MajorPen",typeof(PenX));
        s._minorTickPen = (PenX)info.GetValue("MinorPen",typeof(PenX));

        s._majorTickLength = (float)info.GetSingle("MajorLength");
        s._minorTickLength = (float)info.GetSingle("MinorLength");
        s._showFirstUpMajorTicks = (bool)info.GetBoolean("MajorRight");
        s._showFirstDownMajorTicks = (bool)info.GetBoolean("MajorLeft");
        s._showFirstUpMinorTicks = (bool)info.GetBoolean("MinorRight");
        s._showFirstDownMinorTicks = (bool)info.GetBoolean("MinorLeft");
        s._axisPosition = (Calc.RelativeOrAbsoluteValue)info.GetValue("AxisPosition",typeof(Calc.RelativeOrAbsoluteValue));
    
        return s;
      }
Esempio n. 12
0
		protected Transaction(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		{
			this.TransactionID = info.GetInt64("TransactionID");
			this.Amount = info.GetDecimal("Amount");
			this.TransactionTypeID = info.GetInt32("TransactionTypeID");
			this.PublicNotes = info.GetString("PublicNotes");
			this.PrivateNotes = info.GetString("PrivateNotes");
			this.Date = (DateTime)info.GetValue("Date", typeof(DateTime));
			this.PlayerID = info.GetInt32("PlayerID");
			this.Active = info.GetBoolean("Active");
			this.CreateDt = (DateTime)info.GetValue("CreateDt", typeof(DateTime));
			this.CreateUserID = info.GetInt32("CreateUserID");
			this.ModifyDt = (DateTime?)info.GetValue("ModifyDt", typeof(DateTime?));
			this.ModifyUserID = (int?)info.GetValue("ModifyUserID", typeof(int?));
			CustomizeDeserializationProcess(info, context);
		}
Esempio n. 13
0
 private SectionInfo(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
     : base(info, context)
 {
     this._id = info.GetInt32("id");
     this._name = info.GetString("name");
     this._title = info.GetString("title");
     this._parentID = info.GetInt32("parentID");
     this._order = info.GetInt32("order");
     this._visible = info.GetBoolean("visible");
     this._syndicated = info.GetBoolean("syndicated");
     this._originalTheme = info.GetString("originalTheme");
     this._originalStyle = info.GetString("originalStyle");
     this._owner = info.GetString("owner");
     this._moduleID = new Guid(info.GetString("moduleID"));
     this._touched = info.GetDateTime("touched");
     this._community_id = info.GetInt32("community_id");
     this._community_idOld = this._community_id;
 }
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
public static void TryReadValues(this QuestTable source, System.Data.IDataRecord dataRecord)
{
for (int i = 0; i < dataRecord.FieldCount; i++)
{
switch (dataRecord.GetName(i))
{
case "id":
source.ID = (NetGore.Features.Quests.QuestID)(NetGore.Features.Quests.QuestID)dataRecord.GetUInt16(i);
break;


case "repeatable":
source.Repeatable = (System.Boolean)(System.Boolean)dataRecord.GetBoolean(i);
break;


case "reward_cash":
source.RewardCash = (System.Int32)(System.Int32)dataRecord.GetInt32(i);
break;


case "reward_exp":
source.RewardExp = (System.Int32)(System.Int32)dataRecord.GetInt32(i);
break;


}

}
}
Esempio n. 15
0
 public virtual object SetObjectData(object obj,System.Runtime.Serialization.SerializationInfo info,System.Runtime.Serialization.StreamingContext context,System.Runtime.Serialization.ISurrogateSelector selector)
 {
   _position = (PointF)info.GetValue("Position", typeof(PointF));
   _bounds = (RectangleF)info.GetValue("Bounds", typeof(RectangleF));
   _rotation = info.GetSingle("Rotation");
   _autoSize = info.GetBoolean("AutoSize");
   return this;
 }
Esempio n. 16
0
        /// <summary>
        /// Generate CSV formatted output for the given reader.
        /// </summary>
        public string Generate(System.Data.Common.DbDataReader reader)
        {
            var builder = new StringBuilder();

            var schema = reader.GetSchemaTable();
            var colcount = reader.FieldCount;
            var nullable = new bool[colcount];
            var datatype = new Type[colcount];
            var typename = new string[colcount];

            for(int c=0; c<colcount; c++)
            {
                nullable[c] = true;
                datatype[c] = reader.GetFieldType(c);
                typename[c] = reader.GetDataTypeName(c);

                if (c == 0)
                {
                    if (this.Settings.AddLineNumbers)
                    {
                        if (this.Settings.QuotedStrings) builder.Append(this.Settings.StringQuote);
                        builder.Append("Line");
                        if (this.Settings.QuotedStrings) builder.Append(this.Settings.StringQuote);
                        builder.Append(this.Settings.FieldSeparator);
                    }
                }
                else
                {
                    builder.Append(this.Settings.FieldSeparator);
                }
                if (this.Settings.QuotedStrings) builder.Append(this.Settings.StringQuote);
                builder.Append(reader.GetName(c));
                if (this.Settings.QuotedStrings) builder.Append(this.Settings.StringQuote);
            }

            builder.Append(this.Settings.LineSeparator);

            var lineNumber = 0;
            while (reader.Read())
            {
                lineNumber++;

                for (int c = 0; c < colcount; c++)
                {
                    if (c == 0)
                    {
                        if (this.Settings.AddLineNumbers)
                        {
                            builder.Append(lineNumber);
                            builder.Append(this.Settings.FieldSeparator);
                        }
                    }
                    else
                    {
                        builder.Append(this.Settings.FieldSeparator);
                    }

                    if (nullable[c] && reader.IsDBNull(c))
                    {
                    }
                    else
                    {
                        if (datatype[c] == typeof(String))
                        {
                            if (this.Settings.QuotedStrings) builder.Append(this.Settings.StringQuote);
                            builder.Append(ToCsvableString(reader.GetString(c)));                            
                            if (this.Settings.QuotedStrings) builder.Append(this.Settings.StringQuote);
                        }
                        else if (datatype[c] == typeof(DateTime))
                        {
                            builder.Append(reader.GetDateTime(c).ToString(this.Settings.DateTimeFormat, this.Settings.FormatProvider));
                        }
                        else if (datatype[c] == typeof(Boolean))
                        {
                            builder.Append(reader.GetBoolean(c) ? this.Settings.BooleanTrue : this.Settings.BooleanFalse);
                        }
                        else
                        {
                            builder.AppendFormat(this.Settings.FormatProvider, "{0}", reader.GetValue(c));
                        }
                    }
                }

                builder.Append(this.Settings.LineSeparator);
            }

            return builder.ToString();
        }
Esempio n. 17
0
 protected RangeInfo(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     Name = info.GetString("Name");
     Min = info.GetDouble("Min");
     Max = info.GetDouble("Max");
     Tick = info.GetDouble("Tick");
     SnapToTick = info.GetBoolean("SnapToTick");
     SmallChange = info.GetDouble("SmallChange");
 }
Esempio n. 18
0
		protected TeamPlayer(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		{
			this.TeamPlayerID = info.GetInt32("TeamPlayerID");
			this.TeamID = info.GetInt32("TeamID");
			this.PlayerPassID = (int?)info.GetValue("PlayerPassID", typeof(int?));
			this.IsSecondary = info.GetBoolean("IsSecondary");
			this.PlayerID = (int?)info.GetValue("PlayerID", typeof(int?));
			this.LastModifiedBy = info.GetInt32("LastModifiedBy");
			this.LastModifiedAt = (DateTime)info.GetValue("LastModifiedAt", typeof(DateTime));
			this.Active = info.GetBoolean("Active");
			this.Approved = info.GetBoolean("Approved");
			CustomizeDeserializationProcess(info, context);
		}
Esempio n. 19
0
        internal void fill(System.Data.IDataReader dr)
        {
            if (!dr.IsDBNull(dr.GetOrdinal("CantidadAmbientesFinal")))
            {
                this.CantidadAmbientesFinal = new Ambiente();
                this.CantidadAmbientesFinal.CantidadAmbientes = dr.GetDecimal(dr.GetOrdinal("CantidadAmbientesFinal"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("CantidadAmbientesInicial")))
            {
                this.CantidadAmbientesInicial = new Ambiente();
                this.CantidadAmbientesInicial.CantidadAmbientes = dr.GetDecimal(dr.GetOrdinal("CantidadAmbientesInicial"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("IdCategoria")))
            {
                this.Categoria = new CategoriaPropiedad();
                this.Categoria.IdCategoria = dr.GetInt32(dr.GetOrdinal("IdCategoria"));
                this.Categoria.Nombre = dr.GetString(dr.GetOrdinal("NombreCategoria"));
            }

            this.ClientePedido = new GI.BR.Clientes.ClientePedido();
            this.ClientePedido.IdCliente = dr.GetInt32(dr.GetOrdinal("IdCliente"));

            if (dr.IsDBNull(dr.GetOrdinal("Disposicion")))
                this.Disposicion = null;
            else
                this.Disposicion = (DepartamentoDisposicion)dr.GetInt32(dr.GetOrdinal("Disposicion"));

            if (dr.IsDBNull(dr.GetOrdinal("EnumEstado")))
                this.EnumEstado = null;
            else
                this.EnumEstado = (GI.BR.Propiedades.Estado)dr.GetInt32(dr.GetOrdinal("EnumEstado"));

            if (dr.IsDBNull(dr.GetOrdinal("EsAptoProfesional")))
                this.EsAptoProfesional = null;
            else
                this.EsAptoProfesional = dr.GetBoolean(dr.GetOrdinal("EsAptoProfesional"));

            this.EstadoPropiedad = dr.GetString(dr.GetOrdinal("EstadoPropiedad"));

            //if (dr.IsDBNull(dr.GetOrdinal("IdEstadoPropiedad")))
            //    this.Estado = null;
            //else
            //    this.Estado = EstadoPropiedadFlyweigthFactory.GetInstancia(this.EstadoPropiedad).GetEstado(dr.GetInt32(dr.GetOrdinal("IdEstadoPropiedad")));

            this.IdPedido = dr.GetInt32(dr.GetOrdinal("IdPedido"));

            if (dr.IsDBNull(dr.GetOrdinal("MetrosConstruiblesFinal")))
                this.MetrosConstruiblesFinal = 0;
            else
                this.MetrosConstruiblesFinal = dr.GetInt32(dr.GetOrdinal("MetrosConstruiblesFinal"));

            if (dr.IsDBNull(dr.GetOrdinal("MetrosConstruiblesInicial")))
                this.MetrosConstruiblesInicial = 0;
            else
                this.MetrosConstruiblesInicial = dr.GetInt32(dr.GetOrdinal("MetrosConstruiblesInicial"));

            if (dr.IsDBNull(dr.GetOrdinal("MetrosCubiertosFinal")))
                this.MetrosCubiertosFinal = 0;
            else
                this.MetrosCubiertosFinal = dr.GetInt32(dr.GetOrdinal("MetrosCubiertosFinal"));

            if (dr.IsDBNull(dr.GetOrdinal("MetrosCubiertosInicial")))
                this.MetrosCubiertosInicial = 0;
            else
                this.MetrosCubiertosInicial = dr.GetInt32(dr.GetOrdinal("MetrosCubiertosInicial"));

            if (dr.IsDBNull(dr.GetOrdinal("MetrosTerrenoFinal")))
                this.MetrosTerrenoFinal = 0;
            else
                this.MetrosTerrenoFinal = dr.GetInt32(dr.GetOrdinal("MetrosTerrenoFinal"));

            if (dr.IsDBNull(dr.GetOrdinal("MetrosTerrenoInicial")))
                this.MetrosTerrenoInicial = 0;
            else
                this.MetrosTerrenoInicial = dr.GetInt32(dr.GetOrdinal("MetrosTerrenoInicial"));

            if (dr.IsDBNull(dr.GetOrdinal("IdMoneda")))
                this.Moneda = null;
            else
                this.Moneda = GI.BR.Monedas.MonedasFlyweigthFactory.GetInstancia.GetMoneda(dr.GetInt32(dr.GetOrdinal("IdMoneda")));

            if (dr.IsDBNull(dr.GetOrdinal("IdTipoPropiedad")))
                this.TipoPropiedad = null;
            else
                this.TipoPropiedad = TiposPropiedadFlyweightFactory.GetInstancia.GetTipoPropiedad(dr.GetInt32(dr.GetOrdinal("IdTipoPropiedad")));

            if (dr.IsDBNull(dr.GetOrdinal("TipoZona")))
                this.TipoZona = null;
            else
                this.TipoZona = (GI.BR.Propiedades.TipoZona)dr.GetInt32(dr.GetOrdinal("TipoZona"));

            this.Ubicacion = new Ubicacion();

            if (dr.IsDBNull(dr.GetOrdinal("IdBarrio")))
                this.Ubicacion.Barrio = null;
            else
                this.Ubicacion.Barrio = GI.BR.Propiedades.Ubicaciones.UbicacionFlyweightFactory.GetInstancia.GetBarrio(dr.GetInt32(dr.GetOrdinal("IdBarrio")));

            if (dr.IsDBNull(dr.GetOrdinal("IdLocalidad")))
                this.Ubicacion.Localidad = null;
            else
                this.Ubicacion.Localidad = GI.BR.Propiedades.Ubicaciones.UbicacionFlyweightFactory.GetInstancia.GetLocalidad(dr.GetInt32(dr.GetOrdinal("IdLocalidad")));

            if (dr.IsDBNull(dr.GetOrdinal("IdPais")))
                this.Ubicacion.Pais = null;
            else
                this.Ubicacion.Pais = GI.BR.Propiedades.Ubicaciones.UbicacionFlyweightFactory.GetInstancia.GetPais(dr.GetInt32(dr.GetOrdinal("IdPais")));

            if (dr.IsDBNull(dr.GetOrdinal("IdProvincia")))
                this.Ubicacion.Provincia = null;
            else
                this.Ubicacion.Provincia = GI.BR.Propiedades.Ubicaciones.UbicacionFlyweightFactory.GetInstancia.GetProvincia(dr.GetInt32(dr.GetOrdinal("IdProvincia")));

            if (dr.IsDBNull(dr.GetOrdinal("ImporteFinal")))
                this.ValorFinal = 0;
            else
                this.ValorFinal = dr.GetDecimal(dr.GetOrdinal("ImporteFinal"));

            if (dr.IsDBNull(dr.GetOrdinal("ImporteInicial")))
                this.ValorInicial = 0;
            else
                this.ValorInicial = dr.GetDecimal(dr.GetOrdinal("ImporteInicial"));

            this.Observaciones = dr.GetString(dr.GetOrdinal("Observaciones"));
            this.Activo = dr.GetBoolean(dr.GetOrdinal("Activo"));
            this.FechaAlta = dr.GetDateTime(dr.GetOrdinal("FechaAlta"));
        }
		protected RegistrationRule(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		{
			this.RegistrationRuleID = info.GetInt32("RegistrationRuleID");
			this.OldTeamID = (int?)info.GetValue("OldTeamID", typeof(int?));
			this.NewTeamID = info.GetInt32("NewTeamID");
			this.RegistrationOpens = (DateTime)info.GetValue("RegistrationOpens", typeof(DateTime));
			this.RegistrationCloses = (DateTime)info.GetValue("RegistrationCloses", typeof(DateTime));
			this.DateOfBirthCutoff = (DateTime?)info.GetValue("DateOfBirthCutoff", typeof(DateTime?));
			this.Active = info.GetBoolean("Active");
			CustomizeDeserializationProcess(info, context);
		}
Esempio n. 21
0
		protected TeamSchedule(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		{
			this.TeamScheduleID = info.GetInt32("TeamScheduleID");
			this.EventName = info.GetString("EventName");
			this.StartDate = (DateTime)info.GetValue("StartDate", typeof(DateTime));
			this.EndDate = (DateTime)info.GetValue("EndDate", typeof(DateTime));
			this.TeamID = info.GetInt32("TeamID");
			this.RSVPBy = (DateTime?)info.GetValue("RSVPBy", typeof(DateTime?));
			this.IsActive = info.GetBoolean("IsActive");
			this.CreateUserID = info.GetInt32("CreateUserID");
			this.CreateDate = (DateTime)info.GetValue("CreateDate", typeof(DateTime));
			this.ModifyUserID = (int?)info.GetValue("ModifyUserID", typeof(int?));
			this.ModifyDate = (DateTime?)info.GetValue("ModifyDate", typeof(DateTime?));
			this.DeleteUserID = (int?)info.GetValue("DeleteUserID", typeof(int?));
			this.DeleteDate = (DateTime?)info.GetValue("DeleteDate", typeof(DateTime?));
			CustomizeDeserializationProcess(info, context);
		}
Esempio n. 22
0
		/// <summary>
		/// Serialize the datasource.
		/// </summary>
		protected void Serialize(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		{
			m_TargetID = info.GetUInt64("ID");
			this.Action = info.GetInt64("Action");
			try
			{
				if (m_TargetID != 0)
				{
					this.UseUIValue = info.GetBoolean("UseUIValue");
				}
				else
				{
					this.UseUIValue = true;
				}
			}
			catch
			{
				this.UseUIValue = true;
			}
		}
Esempio n. 23
0
      /// <summary>
      /// Deserializes the XYPlotLayer Version 0.
      /// </summary>
      /// <param name="obj">The empty XYPlotLayer object to deserialize into.</param>
      /// <param name="info">The serialization info.</param>
      /// <param name="context">The streaming context.</param>
      /// <param name="selector">The deserialization surrogate selector.</param>
      /// <returns>The deserialized XYPlotLayer.</returns>
      public object SetObjectData(object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.ISurrogateSelector selector)
      {
        XYPlotLayer s = (XYPlotLayer)obj;

        // XYPlotLayer style
        bool fillLayerArea = info.GetBoolean("FillLayerArea");
        BrushX layerAreaFillBrush = (BrushX)info.GetValue("LayerAreaFillBrush", typeof(BrushX));

        // size, position, rotation and scale

        s._location.WidthType = (XYPlotLayerSizeType)info.GetValue("WidthType", typeof(XYPlotLayerSizeType));
        s._location.HeightType = (XYPlotLayerSizeType)info.GetValue("HeightType", typeof(XYPlotLayerSizeType));
        s._location.Width = info.GetDouble("Width");
        s._location.Height = info.GetDouble("Height");
        s._cachedLayerSize = (SizeF)info.GetValue("CachedSize", typeof(SizeF));

        s._location.XPositionType = (XYPlotLayerPositionType)info.GetValue("XPositionType", typeof(XYPlotLayerPositionType));
        s._location.YPositionType = (XYPlotLayerPositionType)info.GetValue("YPositionType", typeof(XYPlotLayerPositionType));
        s._location.XPosition = info.GetDouble("XPosition");
        s._location.YPosition = info.GetDouble("YPosition");
        s._cachedLayerPosition = (PointF)info.GetValue("CachedPosition", typeof(PointF));

        s._location.Angle = info.GetSingle("Rotation");
        s._location.Scale = info.GetSingle("Scale");

        // axis related

        s._linkedScales.X.Scale = (Scale)info.GetValue("XAxis", typeof(Scale));
        s._linkedScales.Y.Scale = (Scale)info.GetValue("YAxis", typeof(Scale));
        s.LinkedScales.X.IsLinked = info.GetBoolean("LinkXAxis");
        s.LinkedScales.Y.IsLinked = info.GetBoolean("LinkYAxis");
        s.LinkedScales.X.LinkOrgA = info.GetDouble("LinkXAxisOrgA");
        s.LinkedScales.X.LinkOrgB = info.GetDouble("LinkXAxisOrgB");
        s.LinkedScales.X.LinkEndA = info.GetDouble("LinkXAxisEndA");
        s.LinkedScales.X.LinkEndB = info.GetDouble("LinkXAxisEndB");
        s.LinkedScales.Y.LinkOrgA = info.GetDouble("LinkYAxisOrgA");
        s.LinkedScales.Y.LinkOrgB = info.GetDouble("LinkYAxisOrgB");
        s.LinkedScales.Y.LinkEndA = info.GetDouble("LinkYAxisEndA");
        s.LinkedScales.Y.LinkEndB = info.GetDouble("LinkYAxisEndB");


        // Styles
        bool showLeft = info.GetBoolean("ShowLeftAxis");
        bool showBottom = info.GetBoolean("ShowBottomAxis");
        bool showRight = info.GetBoolean("ShowRightAxis");
        bool showTop = info.GetBoolean("ShowTopAxis");

        s._axisStyles.AxisStyleEnsured(CSLineID.Y0).AxisLineStyle = (AxisLineStyle)info.GetValue("LeftAxisStyle", typeof(AxisLineStyle));
        s._axisStyles.AxisStyleEnsured(CSLineID.X0).AxisLineStyle = (AxisLineStyle)info.GetValue("BottomAxisStyle", typeof(AxisLineStyle));
        s._axisStyles.AxisStyleEnsured(CSLineID.Y1).AxisLineStyle = (AxisLineStyle)info.GetValue("RightAxisStyle", typeof(AxisLineStyle));
        s._axisStyles.AxisStyleEnsured(CSLineID.X1).AxisLineStyle = (AxisLineStyle)info.GetValue("TopAxisStyle", typeof(AxisLineStyle));


        s._axisStyles[CSLineID.Y0].MajorLabelStyle = (AxisLabelStyleBase)info.GetValue("LeftLabelStyle", typeof(AxisLabelStyleBase));
        s._axisStyles[CSLineID.X0].MajorLabelStyle = (AxisLabelStyleBase)info.GetValue("BottomLabelStyle", typeof(AxisLabelStyleBase));
        s._axisStyles[CSLineID.Y1].MajorLabelStyle = (AxisLabelStyleBase)info.GetValue("RightLabelStyle", typeof(AxisLabelStyleBase));
        s._axisStyles[CSLineID.X1].MajorLabelStyle = (AxisLabelStyleBase)info.GetValue("TopLabelStyle", typeof(AxisLabelStyleBase));


        // Titles and legend
        s._axisStyles[CSLineID.Y0].Title = (TextGraphic)info.GetValue("LeftAxisTitle", typeof(TextGraphic));
        s._axisStyles[CSLineID.X0].Title = (TextGraphic)info.GetValue("BottomAxisTitle", typeof(TextGraphic));
        s._axisStyles[CSLineID.Y1].Title = (TextGraphic)info.GetValue("RightAxisTitle", typeof(TextGraphic));
        s._axisStyles[CSLineID.X1].Title = (TextGraphic)info.GetValue("TopAxisTitle", typeof(TextGraphic));

        if (!showLeft)
          s._axisStyles.Remove(CSLineID.Y0);
        if (!showRight)
          s._axisStyles.Remove(CSLineID.Y1);
        if (!showBottom)
          s._axisStyles.Remove(CSLineID.X0);
        if (!showTop)
          s._axisStyles.Remove(CSLineID.X1);


        s.Legend = (TextGraphic)info.GetValue("Legend", typeof(TextGraphic));



        // XYPlotLayer specific
        s._linkedLayer.SetDocNode((XYPlotLayer)info.GetValue("LinkedLayer", typeof(XYPlotLayer)), s);

        s._graphObjects = (GraphicCollection)info.GetValue("GraphObjects", typeof(GraphicCollection));

        s._plotItems = (PlotItemCollection)info.GetValue("Plots", typeof(PlotItemCollection));

        return s;
      }
Esempio n. 24
0
      /// <summary>
      /// Deserializes the GraphController (version 0).
      /// </summary>
      /// <param name="obj">The empty GraphController object to deserialize into.</param>
      /// <param name="info">The serialization info.</param>
      /// <param name="context">The streaming context.</param>
      /// <param name="selector">The deserialization surrogate selector.</param>
      /// <returns>The deserialized GraphController.</returns>
      public object SetObjectData(object obj,System.Runtime.Serialization.SerializationInfo info,System.Runtime.Serialization.StreamingContext context,System.Runtime.Serialization.ISurrogateSelector selector)
      {
        GraphController s = (GraphController)obj;
        s.SetMemberVariablesToDefault();

        s.m_AutoZoom = info.GetBoolean("AutoZoom");
        s.m_Zoom = info.GetSingle("Zoom");
        s.m_Graph = (GraphDocument)info.GetValue("Graph",typeof(GraphDocument));

        s.m_DeserializationSurrogate = this;
        return s;
      }
Esempio n. 25
0
        public void fill(System.Data.IDataReader dr)
        {
            this.Deposito = new Valor();
            this.Deposito.Importe = dr.GetDecimal(dr.GetOrdinal("MontoDeposito"));
            this.Deposito.Moneda = new GI.BR.Monedas.Moneda();
            this.Deposito.Moneda = Monedas.MonedasFlyweigthFactory.GetInstancia.GetMoneda(dr.GetInt32(dr.GetOrdinal("IdMonedaDeposito")));
            this.DiaCobro = dr.GetByte(dr.GetOrdinal("DiaVencimientoCuota"));

            if (dr.IsDBNull(dr.GetOrdinal("FechaCancelacion")))
                this.FechaCancelacion = null;
            else
                this.FechaCancelacion = dr.GetDateTime(dr.GetOrdinal("FechaCancelacion"));

            this.FechaInicio = dr.GetDateTime(dr.GetOrdinal("FechaInicio"));
            this.FechaVencimiento = dr.GetDateTime(dr.GetOrdinal("FechaVencimiento"));

            if (!dr.IsDBNull(dr.GetOrdinal("IdInquilino")))
            {
                this.Inquilino = new GI.BR.Clientes.Inquilino();
                this.Inquilino.IdCliente = dr.GetInt32(dr.GetOrdinal("IdInquilino"));
            }

            this.Observaciones = dr.GetString(dr.GetOrdinal("Observaciones"));
            this.IdContrato = dr.GetInt32(dr.GetOrdinal("IdContrato"));
            this.vigente = dr.GetBoolean(dr.GetOrdinal("Vigente"));
        }
Esempio n. 26
0
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
public static void TryReadValues(this ShopTable source, System.Data.IDataRecord dataRecord)
{
for (int i = 0; i < dataRecord.FieldCount; i++)
{
switch (dataRecord.GetName(i))
{
case "can_buy":
source.CanBuy = (System.Boolean)(System.Boolean)dataRecord.GetBoolean(i);
break;


case "id":
source.ID = (NetGore.Features.Shops.ShopID)(NetGore.Features.Shops.ShopID)dataRecord.GetUInt16(i);
break;


case "name":
source.Name = (System.String)(System.String)dataRecord.GetString(i);
break;


}

}
}
Esempio n. 27
0
		protected Attendance(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		{
			this.AttendanceID = info.GetInt32("AttendanceID");
			this.PlayerID = info.GetInt32("PlayerID");
			this.TeamScheduleID = info.GetInt32("TeamScheduleID");
			this.Notes = info.GetString("Notes");
			this.IsActive = info.GetBoolean("IsActive");
			this.CreateDate = (DateTime)info.GetValue("CreateDate", typeof(DateTime));
			this.CreateUserID = info.GetInt32("CreateUserID");
			this.ModifyDate = (DateTime?)info.GetValue("ModifyDate", typeof(DateTime?));
			this.ModifyUserID = (int?)info.GetValue("ModifyUserID", typeof(int?));
			CustomizeDeserializationProcess(info, context);
		}
		protected Product(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		{
			this.ProductID = info.GetInt32("ProductID");
			this.ProductName = info.GetString("ProductName");
			this.SupplierID = (int?)info.GetValue("SupplierID", typeof(int?));
			this.CategoryID = (int?)info.GetValue("CategoryID", typeof(int?));
			this.QuantityPerUnit = info.GetString("QuantityPerUnit");
			this.UnitPrice = (decimal?)info.GetValue("UnitPrice", typeof(decimal?));
			this.UnitsInStock = (short?)info.GetValue("UnitsInStock", typeof(short?));
			this.UnitsOnOrder = (short?)info.GetValue("UnitsOnOrder", typeof(short?));
			this.ReorderLevel = (short?)info.GetValue("ReorderLevel", typeof(short?));
			this.Discontinued = info.GetBoolean("Discontinued");
			CustomizeDeserializationProcess(info, context);
		}
Esempio n. 29
0
		protected Address(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
		{
			this.AddressID = info.GetInt32("AddressID");
			this.Street1 = info.GetString("Street1");
			this.Street2 = info.GetString("Street2");
			this.City = info.GetString("City");
			this.State = info.GetString("State");
			this.ZipCode = info.GetString("ZipCode");
			this.PersonID = info.GetInt32("PersonID");
			this.SortOrder = info.GetByte("SortOrder");
			this.LastModifiedBy = info.GetInt32("LastModifiedBy");
			this.LastModifiedAt = (DateTime)info.GetValue("LastModifiedAt", typeof(DateTime));
			this.Active = info.GetBoolean("Active");
			CustomizeDeserializationProcess(info, context);
		}
Esempio n. 30
0
		/// <summary> Deserialize the page.
		/// For details see <code>writeObject()</code>.
		/// </summary>
		/// <param name="in">The object stream to decode.
		/// </param>
		/// <exception cref="IOException">If there is a deserialization problem with
		/// the stream.
		/// </exception>
		/// <exception cref="ClassNotFoundException">If the deserialized class can't be
		/// located with the current classpath and class loader.
		/// </exception>
		protected Page(System.Runtime.Serialization.SerializationInfo in_Renamed, System.Runtime.Serialization.StreamingContext context)
		{
			bool fromurl;
			int offset;
			System.String href;
			System.Uri url;
			Cursor cursor;
			
			fromurl = in_Renamed.GetBoolean("Winista.Text.Htmlparser.Lex.Pagedata1");
			if (fromurl)
			{
				offset = in_Renamed.GetInt32("Winista.Text.Htmlparser.Lex.Pagedata2");
				href = ((System.String) in_Renamed.GetValue("Winista.Text.Htmlparser.Lex.Pagedata3", typeof(System.String)));
				Support.SupportMisc.DefaultReadObject(in_Renamed, context, this);
				// open the URL
				if (null != Url)
				{
					url = new System.Uri(Url);
					try
					{
						//Connection = (System.Net.HttpWebRequest) System.Net.WebRequest.Create(url);
					}
					catch (ParserException pe)
					{
						throw new System.IO.IOException(pe.Message);
					}
				}
				cursor = new Cursor(this, 0);
				for (int i = 0; i < offset; i++)
					try
					{
						GetCharacter(cursor);
					}
					catch (ParserException pe)
					{
						throw new System.IO.IOException(pe.Message);
					}
				Url = href;
			}
			else
			{
				href = ((System.String) in_Renamed.GetValue("Winista.Text.Htmlparser.Lex.Pagedata4", typeof(System.String)));
				Support.SupportMisc.DefaultReadObject(in_Renamed, context, this);
				Url = href;
			}
		}