Ejemplo n.º 1
0
        public async Task ActualizarProducto(Producto producto)
        {
            var productoConsulta = _context.Producto.Where(x => x.Id == producto.Id).FirstOrDefault();

            FrammeworkTypeUtility.SetProperties(producto, productoConsulta);
            await _context.SaveChangesAsync();
        }
Ejemplo n.º 2
0
        public static bool EditarFactura(Factura factura)
        {
            bool response = false;

            try
            {
                using (var dbContextScope = new DigitalWareEntities())
                {
                    var facturaConsulta = dbContextScope.Factura.Where(x => x.Id == factura.Id).FirstOrDefault();
                    if (facturaConsulta != null)
                    {
                        FrammeworkTypeUtility.SetProperties(factura, facturaConsulta);
                        dbContextScope.SaveChanges();
                        response = true;
                    }
                }
            }
            catch (Exception ex)
            {
                response = false;
                throw ex;
            }

            return(response);
        }
Ejemplo n.º 3
0
        public static bool EditarProducto(Producto producto)
        {
            bool response = false;

            try
            {
                using (var dbContextScope = new DigitalWareEntities())
                {
                    var productoConsulta = dbContextScope.Producto.Where(x => x.Id == producto.Id).FirstOrDefault();
                    if (productoConsulta != null)
                    {
                        FrammeworkTypeUtility.SetProperties(producto, productoConsulta);
                        dbContextScope.SaveChanges();
                        response = true;
                    }
                }
            }
            catch (Exception ex)
            {
                response = false;
                throw ex;
            }

            return(response);
        }
Ejemplo n.º 4
0
        public static bool EditarCliente(Cliente cliente)
        {
            bool response = false;

            try
            {
                using (var dbContextScope = new DigitalWareEntities())
                {
                    var clienteConsulta = dbContextScope.Cliente.Where(x => x.Id == cliente.Id).FirstOrDefault();
                    if (clienteConsulta != null)
                    {
                        FrammeworkTypeUtility.SetProperties(cliente, clienteConsulta);
                        dbContextScope.SaveChanges();
                        response = true;
                    }
                }
            }
            catch (Exception ex)
            {
                response = false;
                throw ex;
            }

            return(response);
        }