예제 #1
0
 public static int Insert(CampaniasInfo _CampaniasInfo)
 {
     //Execute the query and return the new Guid
     object retval= _AdoHelper.ExecuteScalar(ConnectionString,"CampaniasInsert",
         new SqlParameter("@descripcion", _CampaniasInfo.descripcion),
         new SqlParameter("@inicio", _CampaniasInfo.inicio),
         new SqlParameter("@fin", _CampaniasInfo.fin),
         new SqlParameter("@fecha_activada", _CampaniasInfo.fecha_activada),
         new SqlParameter("@publica", _CampaniasInfo.publica),
         new SqlParameter("@Action", _CampaniasInfo.Action),
         new SqlParameter("@Download", _CampaniasInfo.Download),
         new SqlParameter("@SyncID", _CampaniasInfo.SyncID)
     );
     return Int32.Parse(retval.ToString());
 }
예제 #2
0
        /// <summary>
        /// Creates a new instance of the Campanias class and populates it with data from the specified SqlDataReader.
        /// </summary>
        private static CampaniasInfo MakeCampanias(SqlDataReader dataReader)
        {
            CampaniasInfo campanias = new CampaniasInfo();

            if (dataReader.IsDBNull(Cod_campania) == false)
                campanias.cod_campania = dataReader.GetInt32(Cod_campania);
            if (dataReader.IsDBNull(Descripcion) == false)
                campanias.descripcion = dataReader.GetString(Descripcion);
            if (dataReader.IsDBNull(Inicio) == false)
                campanias.inicio = dataReader.GetDateTime(Inicio);
            if (dataReader.IsDBNull(Fin) == false)
                campanias.fin = dataReader.GetDateTime(Fin);
            if (dataReader.IsDBNull(Fecha_activada) == false)
                campanias.fecha_activada = dataReader.GetDateTime(Fecha_activada);
            if (dataReader.IsDBNull(Publica) == false)
                campanias.publica = dataReader.GetBoolean(Publica);
            if (dataReader.IsDBNull(Action) == false)
                campanias.Action = dataReader.GetString(Action);
            if (dataReader.IsDBNull(Download) == false)
                campanias.Download = dataReader.GetDateTime(Download);
            if (dataReader.IsDBNull(SyncID) == false)
                campanias.SyncID = dataReader.GetGuid(SyncID);
            if (dataReader.IsDBNull(SyncTimeStamp) == false)
                campanias.SyncTimeStamp = DateTime.MinValue;

            return campanias;
        }
예제 #3
0
 public static void Delete(CampaniasInfo _CampaniasInfo)
 {
     _AdoHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure, "CampaniasDelete",
         new SqlParameter("@cod_campania", _CampaniasInfo.cod_campania)
     );
 }
예제 #4
0
 public static void Update(CampaniasInfo _CampaniasInfo)
 {
     _AdoHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure, "CampaniasUpdate",
         new SqlParameter("@cod_campania", _CampaniasInfo.cod_campania),
         new SqlParameter("@descripcion", _CampaniasInfo.descripcion),
         new SqlParameter("@inicio", _CampaniasInfo.inicio),
         new SqlParameter("@fin", _CampaniasInfo.fin),
         new SqlParameter("@fecha_activada", _CampaniasInfo.fecha_activada),
         new SqlParameter("@publica", _CampaniasInfo.publica),
         new SqlParameter("@Action", _CampaniasInfo.Action),
         new SqlParameter("@Download", _CampaniasInfo.Download),
         new SqlParameter("@SyncID", _CampaniasInfo.SyncID)
     );
 }