public void Inserir(Beneficio entidade)
 {
     var strQuery = "";
     strQuery += " INSERT INTO Beneficio (numero, pessoa_id, salario, dataCompetencia) ";
     strQuery += string.Format(" VALUES ('{0}','{1}', '{2}', '{3}') ",
         entidade.Numero, entidade.IdCliente, entidade.Salario, entidade.DataCompetencia);
     _context.ExecutaComando(strQuery);
 }
 public void Alterar(Beneficio entidade)
 {
     var strQuery = "";
     strQuery += " UPDATE Beneficio SET ";
     strQuery += string.Format(" salario = '{0}', ", entidade.Salario);
     strQuery += string.Format(" dataCompetencia = '{0}' ", entidade.DataCompetencia);
     strQuery += string.Format(" WHERE numero = '{0}' AND pessoa_id = '{1}' ", entidade.Numero,
         entidade.DataCompetencia);
     _context.ExecutaComando(strQuery);
 }
 private List<Beneficio> TransformaReaderEmListaDeObjeto(SqlDataReader reader)
 {
     var usuarios = new List<Beneficio>();
     while (reader.Read())
     {
         var temObjeto = new Beneficio()
         {
             Numero = int.Parse(reader["numero"].ToString()),
             IdCliente = int.Parse(reader["pessoa_id"].ToString()),
             Salario = float.Parse(reader["salario"].ToString()),
             DataCompetencia = DateTime.Parse(reader["dataCompetencia"].ToString())
         };
         usuarios.Add(temObjeto);
     }
     reader.Close();
     return usuarios;
 }
Beispiel #4
0
 public Cliente()
 {
     Beneficio = new Beneficio();
     Emprestimos = new List<Emprestimo>();
     Emprestimos.Add(new Emprestimo());
 }
 public void Excluir(Beneficio entidade)
 {
     var strQuery = string.Format(" DELETE FROM Usuario WHERE numero = '{0}' AND pessoa_id = '{1}' ", entidade.Numero,
         entidade.DataCompetencia);
     _context.ExecutaComando(strQuery);
 }