public void Delete(int idProveedor)
    {
        Proveedores Proveedor = this.GetProveedor(idProveedor);

        using (context = new BDContext())
        {
            context.Proveedores.Attach(Proveedor);
            context.Proveedores.Remove(Proveedor);
            context.SaveChanges();
        }
    }
Esempio n. 2
0
    public void Delete(int idUsuario)
    {
        Usuarios Usuario = this.GetUsuario(idUsuario);

        using (context = new BDContext())
        {
            context.Usuarios.Attach(Usuario);
            context.Usuarios.Remove(Usuario);
            context.SaveChanges();
        }
    }
Esempio n. 3
0
    public void Delete(int idAsignacion)
    {
        Asignaciones Asignacion = this.GetAsignacion(idAsignacion);

        using (context = new BDContext())
        {
            context.Asignaciones.Attach(Asignacion);
            context.Asignaciones.Remove(Asignacion);
            context.SaveChanges();
        }
    }
Esempio n. 4
0
        public void Delete(int idEstadoUsuario)
        {
            EstadoUsuarios EstadoUsuario = this.GetEstadoUsuario(idEstadoUsuario);

            using (context = new BDContext())
            {
                context.EstadoUsuarios.Attach(EstadoUsuario);
                context.EstadoUsuarios.Remove(EstadoUsuario);
                context.SaveChanges();
            }
        }
Esempio n. 5
0
    public void Delete(int idActivo)
    {
        Activos Activo = this.GetActivo(idActivo);

        using (context = new BDContext())
        {
            context.Activos.Attach(Activo);
            context.Activos.Remove(Activo);
            context.SaveChanges();
        }
    }
 public void DeleteCompra(int id)
 {
     using (context = new BDContext())
     {
         Compra compra;
         compra = (from c in context.Compra
                   where c.id_compra == id
                   select c).FirstOrDefault();
         context.Compra.Remove(compra);
         context.SaveChanges();
     }
 }
Esempio n. 7
0
 public void DeleteRol(int id)
 {
     using (context = new BDContext())
     {
         Roles rol;
         rol = (from r in context.Roles
                where r.RoleId == id
                select r).FirstOrDefault();
         context.Roles.Remove(rol);
         context.SaveChanges();
     }
 }
 public void DeleteProyeccion(int id)
 {
     using (context = new BDContext())
     {
         Proyeccion proyeccion;
         proyeccion = (from p in context.Proyeccion
                       where p.id_proyeccion == id
                       select p).FirstOrDefault();
         context.Proyeccion.Remove(proyeccion);
         context.SaveChanges();
     }
 }
 public void DeleteFormato(int id)
 {
     using (context = new BDContext())
     {
         Formato formato;
         formato = (from f in context.Formato
                    where f.id_formato == id
                    select f).FirstOrDefault();
         context.Formato.Remove(formato);
         context.SaveChanges();
     }
 }
 public void DeleteUsuario(int id_usuario)
 {
     using (context = new BDContext())
     {
         Usuario usuario;
         usuario = (from c in context.Usuario
                    where c.id_usuario == id_usuario
                    select c).FirstOrDefault();
         context.Usuario.Remove(usuario);
         context.SaveChanges();
     }
 }
Esempio n. 11
0
 public void DeleteGenero(int id)
 {
     using (context = new BDContext())
     {
         Genero genero;
         genero = (from g in context.Genero
                   where g.id_genero == id
                   select g).FirstOrDefault();
         context.Genero.Remove(genero);
         context.SaveChanges();
     }
 }
Esempio n. 12
0
 public void DeleteIntermedia(int id)
 {
     using (context = new BDContext())
     {
         Intermedia intermedia;
         intermedia = (from i in context.Intermedia
                       where i.id_intermedia == id
                       select i).FirstOrDefault();
         context.Intermedia.Remove(intermedia);
         context.SaveChanges();
     }
 }
Esempio n. 13
0
 public void DeleteClasificacion(int id)
 {
     using (context = new BDContext())
     {
         Clasificacion clasificacion;
         clasificacion = (from c in context.Clasificacion
                          where c.id_clasificacion == id
                          select c).FirstOrDefault();
         context.Clasificacion.Remove(clasificacion);
         context.SaveChanges();
     }
 }
 public void DeleteProducto(int idProducto)
 {
     using (context = new BDContext())
     {
         Producto producto;
         producto = (from c in context.Producto
                     where c.id_producto == idProducto
                     select c).Single();
         context.Producto.Remove(producto);
         context.SaveChanges();
     }
 }
Esempio n. 15
0
 public void DeleteRol(int id_Rol)
 {
     using (context = new BDContext())
     {
         Rol rol;
         rol = (from c in context.Rol
                where c.id_rol == id_Rol
                select c).Single();
         context.Rol.Remove(rol);
         context.SaveChanges();
     }
 }
 //Delete
 public void eliminarActivo(int idActivo)
 {
     //Activos Activo = this.GetActivo(idActivo);
     using (context = new BDContext())
     {
         //context.Activos.Attach(Activo);
         //context.Activos.Remove(Activo);
         //context.SaveChanges();
         context.Activos.Remove(context.Activos.Single(elActivo => elActivo.IdActivo == idActivo));
         context.SaveChanges();
     }
 }
Esempio n. 17
0
 public void DeleteBitacora(int id_bitacora)
 {
     using (context = new BDContext())
     {
         BackEnd.ENTITIES.Bitacora bitacora;
         bitacora = (from c in context.Bitacora
                     where c.id_bitacora == id_bitacora
                     select c).Single();
         context.Bitacora.Remove(bitacora);
         context.SaveChanges();
     }
 }
Esempio n. 18
0
 public void DeletePelicula(int id)
 {
     using (context = new BDContext())
     {
         Pelicula pelicula;
         pelicula = (from p in context.Pelicula
                     where p.id_pelicula == id
                     select p).FirstOrDefault();
         context.Pelicula.Remove(pelicula);
         context.SaveChanges();
     }
 }
Esempio n. 19
0
 public void DeleteSala(int id)
 {
     using (context = new BDContext())
     {
         Sala sala;
         sala = (from s in context.Sala
                 where s.id_sala == id
                 select s).FirstOrDefault();
         context.Sala.Remove(sala);
         context.SaveChanges();
     }
 }
Esempio n. 20
0
 public void DeleteCategoria(int idCategoria)
 {
     using (context = new BDContext())
     {
         Categoria categoria;
         categoria = (from c in context.Categoria
                      where c.id_categoria == idCategoria
                      select c).Single();
         context.Categoria.Remove(categoria);
         context.SaveChanges();
     }
 }
 public void DeleteFactura(int idfactura)
 {
     using (context = new BDContext())
     {
         Factura factura;
         factura = (from c in context.Factura
                    where c.id_factura == idfactura
                    select c).Single();
         context.Factura.Remove(factura);
         context.SaveChanges();
     }
 }
Esempio n. 22
0
 public void DeleteProducto(int id)
 {
     using (context = new BDContext())
     {
         Producto producto;
         producto = (from s in context.Producto
                     where s.id_comida == id
                     select s).FirstOrDefault();
         context.Producto.Remove(producto);
         context.SaveChanges();
     }
 }
Esempio n. 23
0
 public void DeleteUsuario(int id)
 {
     using (context = new BDContext())
     {
         Users user;
         user = (from c in context.Users
                 where c.UserId == id
                 select c).FirstOrDefault();
         context.Users.Remove(user);
         context.SaveChanges();
     }
 }
Esempio n. 24
0
 public void DeleteAsiento(int id)
 {
     using (context = new BDContext())
     {
         Asiento asiento;
         asiento = (from s in context.Asiento
                    where s.id_asiento == id
                    select s).FirstOrDefault();
         context.Asiento.Remove(asiento);
         context.SaveChanges();
     }
 }
Esempio n. 25
0
 public void DeletePrivilegio(int idprivilegio)
 {
     using (context = new BDContext())
     {
         Privilegios privilegios;
         privilegios = (from c in context.Privilegios
                        where c.id_privilegio == idprivilegio
                        select c).Single();
         context.Privilegios.Remove(privilegios);
         context.SaveChanges();
     }
 }
 public bool Complete()
 {
     try
     {
         context.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         string msj = e.Message;
         return(false);
     }
 }
Esempio n. 27
0
        public ActionResult Registrar(string username, string password, string name)
        {
            {
                BackEnd.Entities.Users oUser = new BackEnd.Entities.Users();
                oUser.UserName = username;
                oUser.Password = Encrypt.GetSHA256(password);
                oUser.nombre   = name;
                bd.Users.Add(oUser);
                bd.SaveChanges();
            }

            return(RedirectToAction("Index", "Login"));
        }
Esempio n. 28
0
        public bool UpdateOrderStatus(int ID, string status)
        {
            using (var context = new BDContext())
            {
                var order = context.Orders.Find(ID);

                order.Status = status;

                context.Entry(order).State = EntityState.Modified;

                return(context.SaveChanges() > 0);
            }
        }
Esempio n. 29
0
        public BDController(BDContext context)
        {
            _context = context;

            if (_context.BDItems.Count() == 0)
            {
                // Create a new BDItem if collection is empty,
                // which means you can't delete all BDItems.
                _context.BDItems.Add(new BDItem {
                    Name = "Name1"
                });
                _context.SaveChanges();
            }
        }
Esempio n. 30
0
        public void DeleteProdProveedor(int idprodproveedor)
        {
            ProdProvedor prodProvedor = this.GetProdProveedor(idprodproveedor);

            using (context = new BDContext())
            {
                ProdProvedor prodproveedor;
                prodproveedor = (from c in context.ProdProvedor
                                 where c.id_prodprovedor == idprodproveedor
                                 select c).Single();
                context.ProdProvedor.Remove(prodproveedor);
                context.SaveChanges();
            }
        }