public static int Insert(CiclosInfo _CiclosInfo) { //Execute the query and return the new Guid object retval= _AdoHelper.ExecuteScalar(ConnectionString,"CiclosInsert", new SqlParameter("@cod_campania", _CiclosInfo.cod_campania), new SqlParameter("@descripcion", _CiclosInfo.descripcion), new SqlParameter("@fecha_inicio", _CiclosInfo.fecha_inicio), new SqlParameter("@fecha_fin", _CiclosInfo.fecha_fin), new SqlParameter("@fecha_cierre", _CiclosInfo.fecha_cierre), new SqlParameter("@download", _CiclosInfo.download), new SqlParameter("@SyncID", _CiclosInfo.SyncID), new SqlParameter("@Action", _CiclosInfo.Action) ); return Int32.Parse(retval.ToString()); }
/// <summary> /// Creates a new instance of the Ciclos class and populates it with data from the specified SqlDataReader. /// </summary> private static CiclosInfo MakeCiclos(SqlDataReader dataReader) { CiclosInfo ciclos = new CiclosInfo(); if (dataReader.IsDBNull(Cod_ciclo) == false) ciclos.cod_ciclo = dataReader.GetInt32(Cod_ciclo); if (dataReader.IsDBNull(Cod_campania) == false) ciclos.cod_campania = dataReader.GetInt32(Cod_campania); if (dataReader.IsDBNull(Descripcion) == false) ciclos.descripcion = dataReader.GetString(Descripcion); if (dataReader.IsDBNull(Fecha_inicio) == false) ciclos.fecha_inicio = dataReader.GetDateTime(Fecha_inicio); if (dataReader.IsDBNull(Fecha_fin) == false) ciclos.fecha_fin = dataReader.GetDateTime(Fecha_fin); if (dataReader.IsDBNull(Fecha_cierre) == false) ciclos.fecha_cierre = dataReader.GetDateTime(Fecha_cierre); if (dataReader.IsDBNull(Download) == false) ciclos.download = dataReader.GetDateTime(Download); if (dataReader.IsDBNull(SyncID) == false) ciclos.SyncID = dataReader.GetGuid(SyncID); if (dataReader.IsDBNull(SyncTimeStamp) == false) ciclos.SyncTimeStamp = DateTime.MinValue; if (dataReader.IsDBNull(Action) == false) ciclos.Action = dataReader.GetString(Action); return ciclos; }
public static void Delete(CiclosInfo _CiclosInfo) { _AdoHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure, "CiclosDelete", new SqlParameter("@cod_ciclo", _CiclosInfo.cod_ciclo) ); }
public static void Update(CiclosInfo _CiclosInfo) { _AdoHelper.ExecuteNonQuery(ConnectionString,CommandType.StoredProcedure, "CiclosUpdate", new SqlParameter("@cod_ciclo", _CiclosInfo.cod_ciclo), new SqlParameter("@cod_campania", _CiclosInfo.cod_campania), new SqlParameter("@descripcion", _CiclosInfo.descripcion), new SqlParameter("@fecha_inicio", _CiclosInfo.fecha_inicio), new SqlParameter("@fecha_fin", _CiclosInfo.fecha_fin), new SqlParameter("@fecha_cierre", _CiclosInfo.fecha_cierre), new SqlParameter("@download", _CiclosInfo.download), new SqlParameter("@SyncID", _CiclosInfo.SyncID), new SqlParameter("@Action", _CiclosInfo.Action) ); }