public static void Delete(Entities.TactoProd TactoProd) { if (TactoProd != null) { SyntexLocal.Delete <Entities.TactoProd>(TactoProd.ID.ToString()); } else { SyntexLocal.Delete <Entities.TactoProd>(string.Empty); } }
public static List <Entities.TactoProd> SelectAllTactoProd() { var conn = GetConnection(); try { var tactosProd = new List <Entities.TactoProd>(); SqlCommand command = new SqlCommand("SELECT ID,ID_ANIMAL,ID_CATEGORIA,ID_ETAPA_PRODUCCION,FECHA_TACTO,RESULTADO," + "GESTACION,POT_ORIGEN,POT_DESTINO,FECHA_ALTA FROM TACTO_PROD WHERE FECHA_TACTO >= (SELECT MIN(FECHA_INICIO) FROM TEMPORADA WHERE FECHA_FIN IS NULL)", conn); command.CommandType = CommandType.Text; var reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { var tactoProd = new Entities.TactoProd(); tactoProd.ID = Convert.ToInt32(reader["ID"].ToString()); tactoProd.ID_ANIMAL = Convert.ToInt32(reader["ID_ANIMAL"].ToString()); tactoProd.ID_CATEGORIA = Convert.ToInt32(reader["ID_CATEGORIA"].ToString()); tactoProd.ID_ETAPA_PRODUCCION = Convert.ToInt32(reader["ID_ETAPA_PRODUCCION"].ToString()); tactoProd.FECHA_TACTO = Convert.ToDateTime(reader["FECHA_TACTO"].ToString()); tactoProd.RESULTADO = Convert.ToInt32(reader["RESULTADO"].ToString()); tactoProd.GESTACION = reader.IsDBNull(6) ? (int?)null : Convert.ToInt32(reader["GESTACION"].ToString()); tactoProd.POT_ORIGEN = Convert.ToInt32(reader["POT_ORIGEN"].ToString()); tactoProd.POT_DESTINO = Convert.ToInt32(reader["POT_DESTINO"].ToString()); tactoProd.FECHA_ALTA = Convert.ToDateTime(reader["FECHA_ALTA"].ToString()); tactosProd.Add(tactoProd); } } return(tactosProd); } catch (Exception) { throw; } finally { conn.Close(); } }
public static void Delete(Entities.TactoProd TactoProd) { Data.TactoProd.Delete(TactoProd); }
public static void Update(Entities.TactoProd TactoProd) { Data.TactoProd.Update(TactoProd); }
public static List <Entities.TactoProd> Select(Entities.TactoProd TactoProd) { return(Data.TactoProd.Select(TactoProd)); }
public static void Insert(Entities.TactoProd TactoProd) { Data.TactoProd.Insert(TactoProd); }
public static void Update(Entities.TactoProd TactoProd) { SyntexLocal.Update(TactoProd); }
public static List <Entities.TactoProd> Select(Entities.TactoProd TactoProd) { return(SyntexLocal.Select <Entities.TactoProd>()); }
public static void Insert(Entities.TactoProd TactoProd) { SyntexLocal.Insert(TactoProd); }