public static List <Entities.Potrero> Select(Entities.Potrero potrero) { if (potrero == null) { return(SyntexLocal.Select <Entities.Potrero>()); } else { return(SyntexLocal.Select <Entities.Potrero>().Where(x => x.ID == potrero.ID).ToList()); } }
public static void Delete(Entities.Potrero Potrero) { if (Potrero != null) { SyntexLocal.Delete <Entities.Potrero>(Potrero.ID.ToString()); } else { SyntexLocal.Delete <Entities.Potrero>(string.Empty); } }
public static List <Entities.Potrero> SelectAllPotrero() { var conn = GetConnection(); try { var potreros = new List <Entities.Potrero>(); SqlCommand command = new SqlCommand("SELECT ID,NOMBRE,SUPERFICIE,COMENTARIO,FECHA_ALTA,FECHA_BAJA FROM POTRERO", conn); command.CommandType = CommandType.Text; var reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { var potrero = new Entities.Potrero(); potrero.ID = Convert.ToInt32(reader["ID"].ToString()); potrero.Nombre = reader["NOMBRE"].ToString(); potrero.Superficie = Convert.ToDecimal(reader["SUPERFICIE"].ToString()); potrero.Comentario = reader["COMENTARIO"].ToString(); potrero.FechaAlta = reader.IsDBNull(4) ? (DateTime?)null : Convert.ToDateTime(reader["FECHA_ALTA"].ToString()); potrero.FechaBaja = reader.IsDBNull(5) ? (DateTime?)null : Convert.ToDateTime(reader["FECHA_BAJA"].ToString()); potreros.Add(potrero); } } return(potreros); } catch (Exception) { throw; } finally { conn.Close(); } }
public static void Update(Entities.Potrero Potrero) { SyntexLocal.Update(Potrero); }
public static void Insert(Entities.Potrero Potrero) { SyntexLocal.Insert(Potrero); }
public static void Delete(Entities.Potrero Potrero) { Data.Potrero.Delete(Potrero); }
public static void Update(Entities.Potrero Potrero) { Data.Potrero.Update(Potrero); }
public static List <Entities.Potrero> Select(Entities.Potrero Potrero) { return(Data.Potrero.Select(Potrero)); }
public static void Insert(Entities.Potrero Potrero) { Data.Potrero.Insert(Potrero); }