Beispiel #1
0
 public static int Insert(CategoriasInfo _CategoriasInfo)
 {
     //Execute the query and return the new Guid
     object retval= _AdoHelper.ExecuteScalar(ConnectionString,"CategoriasInsert",
         new SqlParameter("@Descripcion", _CategoriasInfo.Descripcion),
         new SqlParameter("@MM", _CategoriasInfo.MM),
         new SqlParameter("@Visita", _CategoriasInfo.Visita),
         new SqlParameter("@Porc_Visita", _CategoriasInfo.Porc_Visita),
         new SqlParameter("@Peso", _CategoriasInfo.Peso),
         new SqlParameter("@Download", _CategoriasInfo.Download),
         new SqlParameter("@Action", _CategoriasInfo.Action),
         new SqlParameter("@Orden", _CategoriasInfo.Orden),
         new SqlParameter("@SyncID", _CategoriasInfo.SyncID)
     );
     return Int32.Parse(retval.ToString());
 }
Beispiel #2
0
        /// <summary>
        /// Creates a new instance of the Categorias class and populates it with data from the specified SqlDataReader.
        /// </summary>
        private static CategoriasInfo MakeCategorias(SqlDataReader dataReader)
        {
            CategoriasInfo categorias = new CategoriasInfo();

            if (dataReader.IsDBNull(Cod_Categoria) == false)
                categorias.Cod_Categoria = dataReader.GetInt32(Cod_Categoria);
            if (dataReader.IsDBNull(Descripcion) == false)
                categorias.Descripcion = dataReader.GetString(Descripcion);
            if (dataReader.IsDBNull(MM) == false)
                categorias.MM = dataReader.GetInt32(MM);
            if (dataReader.IsDBNull(Visita) == false)
                categorias.Visita = dataReader.GetInt32(Visita);
            if (dataReader.IsDBNull(Porc_Visita) == false)
                categorias.Porc_Visita = dataReader.GetInt32(Porc_Visita);
            if (dataReader.IsDBNull(Peso) == false)
                categorias.Peso = dataReader.GetInt32(Peso);
            if (dataReader.IsDBNull(Download) == false)
                categorias.Download = dataReader.GetDateTime(Download);
            if (dataReader.IsDBNull(Action) == false)
                categorias.Action = dataReader.GetString(Action);
            if (dataReader.IsDBNull(Orden) == false)
                categorias.Orden = dataReader.GetInt32(Orden);
            if (dataReader.IsDBNull(SyncID) == false)
                categorias.SyncID = dataReader.GetGuid(SyncID);
            if (dataReader.IsDBNull(SyncTimeStamp) == false)
                categorias.SyncTimeStamp = DateTime.MinValue;

            return categorias;
        }
Beispiel #3
0
 public static void Delete(CategoriasInfo _CategoriasInfo)
 {
     _AdoHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure, "CategoriasDelete",
         new SqlParameter("@Cod_Categoria", _CategoriasInfo.Cod_Categoria)
     );
 }
Beispiel #4
0
 public static void Update(CategoriasInfo _CategoriasInfo)
 {
     _AdoHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure, "CategoriasUpdate",
         new SqlParameter("@Cod_Categoria", _CategoriasInfo.Cod_Categoria),
         new SqlParameter("@Descripcion", _CategoriasInfo.Descripcion),
         new SqlParameter("@MM", _CategoriasInfo.MM),
         new SqlParameter("@Visita", _CategoriasInfo.Visita),
         new SqlParameter("@Porc_Visita", _CategoriasInfo.Porc_Visita),
         new SqlParameter("@Peso", _CategoriasInfo.Peso),
         new SqlParameter("@Download", _CategoriasInfo.Download),
         new SqlParameter("@Action", _CategoriasInfo.Action),
         new SqlParameter("@Orden", _CategoriasInfo.Orden),
         new SqlParameter("@SyncID", _CategoriasInfo.SyncID)
     );
 }