예제 #1
0
        public Models.TbCarro InserirCarro(Models.TbCarro carro)
        {
            bd.Add(carro);
            bd.SaveChanges();

            return(carro);
        }
        public Models.TbAgendamento CadastrarAgendamento(Models.TbAgendamento dados)
        {
            bd.Add(dados);
            bd.SaveChanges();

            return(dados);
        }
예제 #3
0
        public Models.TbCliente InserirCliente(Models.TbCliente cliente)
        {
            bd.Add(cliente);
            bd.SaveChanges();

            return(cliente);
        }
예제 #4
0
 public Models.TbCliente Cadastrar(Models.TbCliente client, string senha, string email)
 {
     Models.TbLogin Login = new Models.TbLogin {
         DsEmail   = email,
         DsSenha   = senha,
         TbCliente = new List <Models.TbCliente> {
             client
         }
     };
     Console.WriteLine("Database");
     ctx.TbLogin.Add(Login);
     ctx.SaveChanges();
     Console.WriteLine("Ta Salvo");
     return(client);
 }
        public Models.TbFuncionario AlterarFuncionario(Models.TbFuncionario funcionario)
        {
            bd.Add(funcionario);
            bd.SaveChanges();

            return(funcionario);
        }
예제 #6
0
        public Models.TbAgendamento AlterarStatus(int id, string status)
        {
            Models.TbAgendamento ag = this.ConsultarAgendamento(id);
            ag.DsStatus = status;

            if (status == "concluido" || status == "cancelado")
            {
                Models.TbVeiculo veiculo = ctx.TbVeiculo.FirstOrDefault(x => x.IdVeiculo == ag.IdVeiculo);
                veiculo.BtDisponivel = true;
            }

            ctx.SaveChanges();
            return(ag);
        }
예제 #7
0
 public Models.TbNotificacao Cadastrar(Models.TbNotificacao tb)
 {
     ctx.TbNotificacao.Add(tb);
     ctx.SaveChanges();
     return(tb);
 }
예제 #8
0
 public void Cadastrar(Models.TbLogin tb)
 {
     ctx.TbLogin.Add(tb);
     ctx.SaveChanges();
 }
예제 #9
0
 public Models.TbVeiculo Deletar(Models.TbVeiculo tb)
 {
     ctx.TbVeiculo.Remove(tb);
     ctx.SaveChanges();
     return(tb);
 }