示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }