Esempio n. 1
0
 public static void Delete(Entities.Servicio Servicio)
 {
     if (Servicio != null)
     {
         SyntexLocal.Delete <Entities.Servicio>(Servicio.ID.ToString());
     }
     else
     {
         SyntexLocal.Delete <Entities.Servicio>(string.Empty);
     }
 }
Esempio n. 2
0
        public static List <Entities.Servicio> SelectAllServicio()
        {
            var conn = GetConnection();

            try
            {
                var servicios = new List <Entities.Servicio>();

                SqlCommand command = new SqlCommand("SELECT ID,ID_ANIMAL,ID_CATEGORIA,FECHA_ENTRADA,FECHA_SALIDA," +
                                                    "ENTRADA_PRODUCCION,CAUSA_BAJA_SERVICIO,COMENTARIOS,FECHA_ALTA FROM SERVICIO WHERE FECHA_SALIDA IS NULL AND FECHA_ENTRADA >= (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 servicio = new Entities.Servicio();
                        servicio.ID                  = Convert.ToInt32(reader["ID"].ToString());
                        servicio.ID_ANIMAL           = Convert.ToInt32(reader["ID_ANIMAL"].ToString());
                        servicio.ID_CATEGORIA        = Convert.ToInt32(reader["ID_CATEGORIA"].ToString());
                        servicio.FECHA_ENTRADA       = Convert.ToDateTime(reader["FECHA_ENTRADA"].ToString());
                        servicio.FECHA_SALIDA        = reader.IsDBNull(4) ? (DateTime?)null : Convert.ToDateTime(reader["FECHA_SALIDA"].ToString());
                        servicio.ENTRADA_PRODUCCION  = Convert.ToInt32(reader["ENTRADA_PRODUCCION"].ToString());
                        servicio.CAUSA_BAJA_SERVICIO = reader.IsDBNull(6) ? (int?)null : Convert.ToInt32(reader["CAUSA_BAJA_SERVICIO"].ToString());
                        servicio.COMENTARIOS         = reader["COMENTARIOS"].ToString();
                        servicio.FECHA_ALTA          = Convert.ToDateTime(reader["FECHA_ALTA"].ToString());

                        servicios.Add(servicio);
                    }
                }
                return(servicios);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                conn.Close();
            }
        }
Esempio n. 3
0
 public static void Delete(Entities.Servicio Servicio)
 {
     Data.Servicio.Delete(Servicio);
 }
Esempio n. 4
0
 public static void Update(Entities.Servicio Servicio)
 {
     Data.Servicio.Update(Servicio);
 }
Esempio n. 5
0
 public static List <Entities.Servicio> Select(Entities.Servicio Servicio)
 {
     return(Data.Servicio.Select(Servicio));
 }
Esempio n. 6
0
 public static void Insert(Entities.Servicio Servicio)
 {
     Data.Servicio.Insert(Servicio);
 }
Esempio n. 7
0
 public static void Update(Entities.Servicio Servicio)
 {
     SyntexLocal.Update(Servicio);
 }
Esempio n. 8
0
 public static List <Entities.Servicio> Select(Entities.Servicio Servicio)
 {
     return(SyntexLocal.Select <Entities.Servicio>());
 }
Esempio n. 9
0
 public static void Insert(Entities.Servicio Servicio)
 {
     SyntexLocal.Insert(Servicio);
 }