コード例 #1
0
        public static CotizacionesDetalles Buscar(int?detalleCotizacionId)
        {
            CotizacionesDetalles detalle = null;

            using (var conexion = new CotizacionDb())
            {
                try
                {
                    detalle = conexion.CotDetalle.Find(detalleCotizacionId);
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(detalle);
        }
コード例 #2
0
        public static List <Cotizaciones> Listar()
        {
            List <Cotizaciones> listado = null;

            using (var conexion = new CotizacionDb())
            {
                try
                {
                    listado = conexion.Cotizacion.ToList();
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(listado);
        }
コード例 #3
0
        public static Cotizaciones Buscar(int?cotizacionId)
        {
            Cotizaciones cotizacion = null;

            using (var conexion = new CotizacionDb())
            {
                try
                {
                    cotizacion = conexion.Cotizacion.Find(cotizacionId);
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(cotizacion);
        }
コード例 #4
0
        public static bool Eliminar(CotizacionesDetalles detalle)
        {
            bool resultado = false;

            using (var conexion = new CotizacionDb())
            {
                try
                {
                    conexion.Entry(detalle).State = EntityState.Deleted;
                    conexion.SaveChanges();
                    resultado = true;
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(resultado);
        }
コード例 #5
0
        public static bool Guardar(CotizacionesDetalles detalle)
        {
            bool resultado = false;

            using (var conexion = new CotizacionDb())
            {
                try
                {
                    conexion.CotDetalle.Add(detalle);
                    conexion.SaveChanges();
                    resultado = true;
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(resultado);
        }
コード例 #6
0
        public static bool Modificar(Cotizaciones cotizacion)
        {
            bool resultado = false;

            using (var conexion = new CotizacionDb())
            {
                try
                {
                    conexion.Entry(cotizacion).State = EntityState.Modified;
                    conexion.SaveChanges();
                    resultado = true;
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(resultado);
        }