public void Add(Transacao obj) { var strQuery = ""; strQuery = "insert into Transacao values ("; strQuery += String.Format("'{0}', ", obj.Tipo); strQuery += String.Format("'{0}', ", obj.Funcao); strQuery += String.Format("{0}, ", ajustar.PontoVirgula(obj.Valor)); strQuery += String.Format("'{0}', ", obj.Observacao); strQuery += String.Format("'{0}', ", obj.Agendamento.ToString("yyyy/MM/dd")); strQuery += String.Format("{0}, ", obj.ContaId); if (obj.ContaIdTransferencia == 0) { strQuery += "null, "; } else { strQuery += String.Format("{0}, ", obj.ContaIdTransferencia); } if (obj.CompraId == 0) { strQuery += "null"; } else { strQuery += String.Format("{0}", obj.CompraId); } strQuery += ")"; db.ExecutaComando(strQuery); }
public void Update(Pessoa obj) { var strQuery = ("update Pessoa set "); strQuery += String.Format("Nome = {0} ", obj.Nome); strQuery += String.Format("where PessoaId = {0}", obj.PessoaId); contexto.ExecutaComando(strQuery); }
public void Add(Conta obj) { var strQuery = ""; strQuery += String.Format("insert into Conta output inserted.ContaId values ("); strQuery += String.Format("{0},", obj.ContaId); strQuery += String.Format("{0},", ajuste.PontoVirgula(obj.SaldoDebito)); strQuery += String.Format("{0}", ajuste.PontoVirgula(obj.CreditoDisponivel)); strQuery += ")"; contexto.ExecutaComando(strQuery); }
public void Add(Compra obj) { var strQuery = ""; strQuery += "insert into Compra values ("; strQuery += String.Format("'{0}', ", obj.dbLoja); strQuery += String.Format("{0}, ", obj.dbParcelas); strQuery += String.Format("{0}, ", obj.dbParcelasQuitadas); strQuery += String.Format("{0}, ", ajustar.PontoVirgula(obj.dbValorParcela)); strQuery += String.Format("{0}", obj.dbContaId); strQuery += ")"; db.ExecutaComando(strQuery); }