//Remoção de clientes no banco de dados


        public static void RemoverVeiculosLeves(int Id)
        {
            VeiculoLeve veiculoLeve = GetVeiculoLeve(Id);
            Context     db          = new Context();

            db.VeiculosLeves.Remove(veiculoLeve);
            db.SaveChanges();
        }
        public static VeiculoLeve AtualizarVeiculoLeve(
            VeiculoLeve veiculoLeve
            )
        {
            Context db = new Context();

            db.VeiculosLeves.Update(veiculoLeve);
            db.SaveChanges();
            return(veiculoLeve);
        }
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (obj.GetType() != this.GetType())
            {
                return(false);
            }
            VeiculoLeve veiculoLeve = (VeiculoLeve)obj;

            return(this.GetHashCode() == veiculoLeve.GetHashCode());
        }
Example #4
0
        public LocacaoVeiculoLeve(
            Locacao Locacao,
            VeiculoLeve VeiculoLeve
            )
        {
            Context db = new Context();

            this.Locacao       = Locacao;
            this.IdLocacao     = Locacao.Id;
            this.VeiculoLeve   = VeiculoLeve;
            this.IdVeiculoLeve = VeiculoLeve.Id;

            db.LocacaoVeiculoLeves.Add(this);
            db.SaveChanges();
        }