Exemple #1
0
        public List <Raca> Create(Raca a)
        {
            cmd.Connection  = con.Connect();
            cmd.CommandText =
                "INSERT INTO Raca(NomeRaca) " +
                "VALUES(@NomeRaca)"
            ;
            cmd.Parameters.AddWithValue("NomeRaca", a.NomeRaca);

            SqlDataReader data = cmd.ExecuteReader();

            con.Desconnect();
            return(ReadAll());
        }
        public List <Tipo> Create(Tipo a)
        {
            cmd.Connection  = con.Connect();
            cmd.CommandText =
                "INSERT INTO Tipo(NomeTipo) " +
                "VALUES(@NomeTipo)"
            ;
            cmd.Parameters.AddWithValue("NomeTipo", a.NomeTipo);

            SqlDataReader data = cmd.ExecuteReader();


            con.Desconnect();
            return(ReadAll());
        }
Exemple #3
0
        public List <Atendimento> Create(Atendimento a)
        {
            cmd.Connection  = con.Connect();
            cmd.CommandText =
                "INSERT INTO Atendimento(DataAtendimento,Descricao,IdVet,IdPet) " +
                "VALUES(@DataAtendimento,@Descricao,@IdVet,@IdPet)"
            ;
            cmd.Parameters.AddWithValue("DataAtendimento", a.DataAtendimento);
            cmd.Parameters.AddWithValue("Descricao", a.Descricao);
            cmd.Parameters.AddWithValue("IdVet", a.IdVet);
            cmd.Parameters.AddWithValue("IdPet", a.IdPet);

            SqlDataReader data = cmd.ExecuteReader();


            con.Desconnect();
            return(ReadAll());
        }