예제 #1
0
        private void DefinitivePlan(Plan value, SqlConnection connection)
        {
            this.VerifierPlan(value); value.AddInteret(connection);
            Models.PretDAO          prdao = new Models.PretDAO(connection);
            Models.ClientDAO        cldao = new Models.ClientDAO(connection);
            Models.RemboursementDAO rbdao = new Models.RemboursementDAO(connection);

            Models.Pret   pret   = new Models.Pret(value.pret);
            Models.Client client = cldao.SelectOne("WHERE id='" + value.pret.client.id + "'");
            client.Solde += pret.Montant;
            pret.Id       = prdao.NextId();
            pret.Client   = client;
            prdao.Insert(pret);
            cldao.Update(client);
            foreach (Remboursement r in value.remboursements)
            {
                Models.Remboursement rb = new Models.Remboursement(r); rb.Id = rbdao.NextId(); rb.Pret = pret;
                rbdao.Insert(rb);
            }
        }
예제 #2
0
 private void SimplePlan(Plan value, SqlConnection connection)
 {
     this.VerifierPlan(value);
     value.AddInteret(connection);
 }