Beispiel #1
0
        public BackEnd.Controllers.Response.CadastroPetResponse cadastrarPet(BackEnd.Controllers.Request.CadastroPetRequest request)
        {
            Models.TbPet Pet = new Models.TbPet();

            Pet.NmPet          = request.NomePet;
            Pet.TpPet          = request.TipoPet;
            Pet.DsMedicamentos = request.Medicamentos;
            Pet.DsPeso         = request.Peso;
            Pet.DsPorte        = request.Porte;
            Pet.DsRaca         = request.Raca;
            Pet.DsSexo         = request.Sexo;
            Pet.DtNascimento   = request.Nascimento;
            Pet.IdCliente      = request.IdCliente;

            ctx.Add(Pet);
            ctx.SaveChanges();

            BackEnd.Controllers.Response.CadastroPetResponse response = new BackEnd.Controllers.Response.CadastroPetResponse();

            response.IdCliente    = request.IdCliente;
            response.IdPet        = Pet.IdPet;
            response.Medicamentos = request.Medicamentos;
            response.Nascimento   = request.Nascimento;
            response.NomePet      = request.NomePet;
            response.Peso         = request.Peso;
            response.Porte        = request.Porte;
            response.Raca         = request.Raca;
            response.Sexo         = request.Sexo;
            response.TipoPet      = request.TipoPet;

            return(response);
        }
Beispiel #2
0
        public BackEnd.Controllers.Response.VacinacaoResponse AgendarVacina(BackEnd.Controllers.Request.VacinacaoRequest request)
        {
            Models.TbVacinacao tbVacina = new Models.TbVacinacao();

            tbVacina.IdCliente     = request.IdCliente;
            tbVacina.IdPet         = request.IdPet;
            tbVacina.DsLocal       = request.Local;
            tbVacina.DsObservacoes = request.Observacoes;
            tbVacina.DsVacina      = request.Vacina;
            tbVacina.DtVacinacao   = request.Data;

            ctx.TbVacinacao.Add(tbVacina);
            ctx.SaveChanges();

            BackEnd.Controllers.Response.VacinacaoResponse response = new BackEnd.Controllers.Response.VacinacaoResponse();

            response.IdCliente   = request.IdCliente;
            response.IdPet       = request.IdPet;
            response.Local       = request.Local;
            response.Observacoes = request.Observacoes;
            response.Vacina      = request.Vacina;
            response.Data        = request.Data;

            return(response);
        }
        public BackEnd.Controllers.Response.BanhoTosaResponse AgendamentoBanhoTosa(BackEnd.Controllers.Request.BanhoTosaRequest request)
        {
            Models.TbBanhoTosa tbBanhoTosa = new Models.TbBanhoTosa();

            tbBanhoTosa.DsBanho       = request.Banho;
            tbBanhoTosa.DsDentes      = request.Dentes;
            tbBanhoTosa.DsLocal       = request.Local;
            tbBanhoTosa.DsObservacoes = request.Observacoes;
            tbBanhoTosa.DsTosa        = request.Tosa;
            tbBanhoTosa.DsUnhas       = request.Unhas;
            tbBanhoTosa.DtBanhoTosa   = request.Data;
            tbBanhoTosa.IdCliente     = request.IdCliente;
            tbBanhoTosa.IdPet         = request.IdPet;

            ctx.Add(tbBanhoTosa);
            ctx.SaveChanges();

            BackEnd.Controllers.Response.BanhoTosaResponse response = new BackEnd.Controllers.Response.BanhoTosaResponse();

            response.Banho       = request.Banho;
            response.Dentes      = request.Dentes;
            response.Local       = request.Local;
            response.Observacoes = request.Observacoes;
            response.Tosa        = request.Tosa;
            response.Unhas       = request.Unhas;
            response.Data        = request.Data;
            response.IdCliente   = request.IdCliente;
            response.IdPet       = request.IdPet;

            return(response);
        }
Beispiel #4
0
        public BackEnd.Controllers.Response.CirurgiaResponse AgendarCirurgia(BackEnd.Controllers.Request.CirurgiaRequest request)
        {
            Models.TbCirurgia tbCirurgia = new Models.TbCirurgia();

            tbCirurgia.DsLocal       = request.Local;
            tbCirurgia.DsObservacoes = request.Observacoes;
            tbCirurgia.DtCirurgia    = request.Data;
            tbCirurgia.IdCliente     = request.IdCliente;
            tbCirurgia.IdPet         = request.IdPet;
            tbCirurgia.DsCirurgia    = request.Cirurgia;

            ctx.Add(tbCirurgia);
            ctx.SaveChanges();

            BackEnd.Controllers.Response.CirurgiaResponse response = new BackEnd.Controllers.Response.CirurgiaResponse();

            response.Local       = request.Local;
            response.Observacoes = request.Observacoes;
            response.Data        = request.Data;
            response.IdCliente   = request.IdCliente;
            response.IdPet       = request.IdPet;
            response.Cirurgia    = request.Cirurgia;

            return(response);
        }
Beispiel #5
0
        public BackEnd.Controllers.Response.HotelResponse AgendarHotel(BackEnd.Controllers.Request.HotelRequest request)
        {
            Models.TbHotel tbHotel = new Models.TbHotel();

            tbHotel.IdCliente  = request.IdCliente;
            tbHotel.IdPet      = request.IdPet;
            tbHotel.DsDelivery = request.Delivery;
            tbHotel.DsLocal    = request.Local;
            tbHotel.DtEntrada  = request.DataEntrada;
            tbHotel.DtSaida    = request.DataSaida;

            ctx.Add(tbHotel);
            ctx.SaveChanges();

            BackEnd.Controllers.Response.HotelResponse response = new BackEnd.Controllers.Response.HotelResponse();

            response.IdCliente   = request.IdCliente;
            response.IdPet       = request.IdPet;
            response.Delivery    = request.Delivery;
            response.Local       = request.Local;
            response.DataEntrada = request.DataEntrada;
            response.DataSaida   = request.DataSaida;

            return(response);
        }
        public Models.Response.CadastroClienteResponse Salvar(Models.Request.CadastroClienteRequest request)
        {
            Models.veterinarioContext ctx = new Models.veterinarioContext();

            Models.TbLogin login = new Models.TbLogin();

            login.DsEmail = request.Email;
            login.DsSenha = request.Senha;

            ctx.TbLogin.Add(login);
            ctx.SaveChanges();

            Models.TbCliente cliente = new Models.TbCliente();

            cliente.NmCliente     = request.Nome;
            cliente.DsEmail       = request.Email;
            cliente.DsRg          = request.Rg;
            cliente.DsCpf         = request.Cpf;
            cliente.DsTelefone    = request.Telefone;
            cliente.DsEndereco    = request.Endereco;
            cliente.DsComplemento = request.Complemento;
            cliente.DsCep         = request.Cep;
            cliente.DtNascimento  = request.Nascimento;
            cliente.DsSexo        = request.Sexo;
            cliente.IdLogin       = login.IdLogin;

            ctx.TbCliente.Add(cliente);
            ctx.SaveChanges();

            Models.Response.CadastroClienteResponse response = new Models.Response.CadastroClienteResponse();

            response.Nome        = cliente.NmCliente;
            response.Email       = cliente.DsEmail;
            response.Senha       = login.DsSenha;
            response.Rg          = cliente.DsRg;
            response.Cpf         = cliente.DsCpf;
            response.Telefone    = cliente.DsTelefone;
            response.Endereco    = cliente.DsEndereco;
            response.Complemento = cliente.DsComplemento;
            response.Cep         = cliente.DsCep;
            response.Nascimento  = cliente.DtNascimento;
            response.Sexo        = cliente.DsSexo;
            response.IdLogin     = login.IdLogin;
            response.IdCliente   = cliente.IdCliente;

            return(response);
        }
        public Models.TbCliente AlterarPerfil(BackEnd.Controllers.Request.AlterarPerfilRequest request)
        {
            Models.veterinarioContext ctx = new Models.veterinarioContext();

            Models.TbCliente cliente = ctx.TbCliente
                                       .FirstOrDefault(x => x.IdCliente == request.idPerfil);

            cliente.NmCliente     = request.Nome;
            cliente.DsEmail       = request.Email;
            cliente.DsRg          = request.Rg;
            cliente.DsCpf         = request.Cpf;
            cliente.DsTelefone    = request.Telefone;
            cliente.DsEndereco    = request.Endereco;
            cliente.DsComplemento = request.Complemento;
            cliente.DsCep         = request.Cep;
            cliente.DtNascimento  = request.Nascimento;
            cliente.DsSexo        = request.Sexo;

            ctx.SaveChanges();

            return(cliente);
        }