示例#1
0
 public static int Insert(DireccionesInfo _DireccionesInfo)
 {
     //Execute the query and return the new Guid
     object retval= _AdoHelper.ExecuteScalar(ConnectionString,"DireccionesInsert",
         new SqlParameter("@Tipo_Direccion", _DireccionesInfo.Tipo_Direccion),
         new SqlParameter("@Cod_Calle", _DireccionesInfo.Cod_Calle),
         new SqlParameter("@Cod_Segmento", _DireccionesInfo.Cod_Segmento),
         new SqlParameter("@Altura", _DireccionesInfo.Altura),
         new SqlParameter("@Unidad", _DireccionesInfo.Unidad),
         new SqlParameter("@Telefono", _DireccionesInfo.Telefono),
         new SqlParameter("@Fax", _DireccionesInfo.Fax),
         new SqlParameter("@ugly_Cod_TipoCalle", _DireccionesInfo.ugly_Cod_TipoCalle),
         new SqlParameter("@ugly_Cod_Pais", _DireccionesInfo.ugly_Cod_Pais),
         new SqlParameter("@ugly_Cod_Provincia", _DireccionesInfo.ugly_Cod_Provincia),
         new SqlParameter("@ugly_CP", _DireccionesInfo.ugly_CP),
         new SqlParameter("@ugly_Localidad", _DireccionesInfo.ugly_Localidad),
         new SqlParameter("@ugly_Calle", _DireccionesInfo.ugly_Calle),
         new SqlParameter("@Download", _DireccionesInfo.Download),
         new SqlParameter("@Action", _DireccionesInfo.Action),
         new SqlParameter("@SyncID", _DireccionesInfo.SyncID)
     );
     return Int32.Parse(retval.ToString());
 }
示例#2
0
        /// <summary>
        /// Creates a new instance of the Direcciones class and populates it with data from the specified SqlDataReader.
        /// </summary>
        private static DireccionesInfo MakeDirecciones(SqlDataReader dataReader)
        {
            DireccionesInfo direcciones = new DireccionesInfo();

            if (dataReader.IsDBNull(Cod_Direccion) == false)
                direcciones.Cod_Direccion = dataReader.GetInt32(Cod_Direccion);
            if (dataReader.IsDBNull(Tipo_Direccion) == false)
                direcciones.Tipo_Direccion = dataReader.GetInt16(Tipo_Direccion);
            if (dataReader.IsDBNull(Cod_Calle) == false)
                direcciones.Cod_Calle = dataReader.GetInt32(Cod_Calle);
            if (dataReader.IsDBNull(Cod_Segmento) == false)
                direcciones.Cod_Segmento = dataReader.GetInt32(Cod_Segmento);
            if (dataReader.IsDBNull(Altura) == false)
                direcciones.Altura = dataReader.GetString(Altura);
            if (dataReader.IsDBNull(Unidad) == false)
                direcciones.Unidad = dataReader.GetString(Unidad);
            if (dataReader.IsDBNull(Telefono) == false)
                direcciones.Telefono = dataReader.GetString(Telefono);
            if (dataReader.IsDBNull(Fax) == false)
                direcciones.Fax = dataReader.GetString(Fax);
            if (dataReader.IsDBNull(Ugly_Cod_TipoCalle) == false)
                direcciones.ugly_Cod_TipoCalle = dataReader.GetInt32(Ugly_Cod_TipoCalle);
            if (dataReader.IsDBNull(Ugly_Cod_Pais) == false)
                direcciones.ugly_Cod_Pais = dataReader.GetInt32(Ugly_Cod_Pais);
            if (dataReader.IsDBNull(Ugly_Cod_Provincia) == false)
                direcciones.ugly_Cod_Provincia = dataReader.GetInt32(Ugly_Cod_Provincia);
            if (dataReader.IsDBNull(Ugly_CP) == false)
                direcciones.ugly_CP = dataReader.GetString(Ugly_CP);
            if (dataReader.IsDBNull(Ugly_Localidad) == false)
                direcciones.ugly_Localidad = dataReader.GetString(Ugly_Localidad);
            if (dataReader.IsDBNull(Ugly_Calle) == false)
                direcciones.ugly_Calle = dataReader.GetString(Ugly_Calle);
            if (dataReader.IsDBNull(Download) == false)
                direcciones.Download = dataReader.GetDateTime(Download);
            if (dataReader.IsDBNull(Action) == false)
                direcciones.Action = dataReader.GetString(Action);
            if (dataReader.IsDBNull(SyncID) == false)
                direcciones.SyncID = dataReader.GetGuid(SyncID);
            if (dataReader.IsDBNull(SyncTimeStamp) == false)
                direcciones.SyncTimeStamp = DateTime.MinValue;

            return direcciones;
        }
示例#3
0
 public static void Delete(DireccionesInfo _DireccionesInfo)
 {
     _AdoHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure, "DireccionesDelete",
         new SqlParameter("@Cod_Direccion", _DireccionesInfo.Cod_Direccion)
     );
 }
示例#4
0
 public static void Update(DireccionesInfo _DireccionesInfo)
 {
     _AdoHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure, "DireccionesUpdate",
         new SqlParameter("@Cod_Direccion", _DireccionesInfo.Cod_Direccion),
         new SqlParameter("@Tipo_Direccion", _DireccionesInfo.Tipo_Direccion),
         new SqlParameter("@Cod_Calle", _DireccionesInfo.Cod_Calle),
         new SqlParameter("@Cod_Segmento", _DireccionesInfo.Cod_Segmento),
         new SqlParameter("@Altura", _DireccionesInfo.Altura),
         new SqlParameter("@Unidad", _DireccionesInfo.Unidad),
         new SqlParameter("@Telefono", _DireccionesInfo.Telefono),
         new SqlParameter("@Fax", _DireccionesInfo.Fax),
         new SqlParameter("@ugly_Cod_TipoCalle", _DireccionesInfo.ugly_Cod_TipoCalle),
         new SqlParameter("@ugly_Cod_Pais", _DireccionesInfo.ugly_Cod_Pais),
         new SqlParameter("@ugly_Cod_Provincia", _DireccionesInfo.ugly_Cod_Provincia),
         new SqlParameter("@ugly_CP", _DireccionesInfo.ugly_CP),
         new SqlParameter("@ugly_Localidad", _DireccionesInfo.ugly_Localidad),
         new SqlParameter("@ugly_Calle", _DireccionesInfo.ugly_Calle),
         new SqlParameter("@Download", _DireccionesInfo.Download),
         new SqlParameter("@Action", _DireccionesInfo.Action),
         new SqlParameter("@SyncID", _DireccionesInfo.SyncID)
     );
 }