public async Task <IActionResult> Edit(long id, [Bind("GarantieId,Vervaldatum,FaktuurId")] Garantie garantie)
        {
            if (id != garantie.GarantieId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(garantie);
                    TempData["SuccessMessage"] = $"De garantie <b>{garantie.FaktuurId}</b> werd gewijzigd!";
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GarantieExists(garantie.GarantieId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FaktuurId"] = new SelectList(_context.Fakturen.OrderByDescending(f => f.FaktuurNr), "FaktuurNr", "FaktuurNr", garantie.FaktuurId);
            return(View(garantie));
        }
Пример #2
0
        public void AjouterAvaliste(Garantie garantie, string nomComplet, string profession, string description, double montantParMois, Employe employe)
        {
            operationBLO = new OperationBLO();
            avalisteBLO.Add(new Avaliste(new IdentifiantBLO().IdAvaliste, garantie, nomComplet, profession, description, montantParMois));
            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, garantie.Credit.Client, new CompteClient("Indefini"), montantParMois, "toto tata");

            new IdentifiantBLO().AddIdAvaliste();
        }
Пример #3
0
        public void SupprimerGarantie(Garantie garantie, Employe employe)
        {
            operationBLO = new OperationBLO();

            garantieBLO.Remove(garantie);

            operationBLO.AjouterOperation(TypeOperation.Suppression, employe, garantie.Credit.Client, new CompteClient("Indefini"),
                                          garantie.MontantEvaluation, "Plus important");
        }
Пример #4
0
        public void AjouterFichierStocke(string nom, string fileName, Client client, Garantie garantie, StatutStockage statutStockage, Employe employe)
        {
            operationBLO = new OperationBLO();

            fichierStockeBLO.Add(new FichierStocke(new IdentifiantBLO().IdFichierStocke, DateTime.Now, nom, fileName, client, garantie, statutStockage));

            operationBLO.AjouterOperation(TypeOperation.Ajout, employe, client, new CompteClient("Indefini"), garantie.MontantEvaluation, "toto tata");

            new IdentifiantBLO().AddIdFichierStocke();
        }
Пример #5
0
        public void LibererGarantie(Garantie garantie, Employe employe)
        {
            operationBLO = new OperationBLO();
            Garantie oldGarantie = garantie;

            garantie.StatutGarantie = StatutGarantie.Retourné;

            garantieBLO[garantieBLO.IndexOf(oldGarantie)] = garantie;

            operationBLO.AjouterOperation(TypeOperation.Retour_de_garantie, employe, garantie.Credit.Client, new CompteClient("Indefini"),
                                          garantie.MontantEvaluation, "Credit rembourse");
        }
        public async Task <IActionResult> Create([Bind("GarantieId,Vervaldatum,FaktuurId")] Garantie garantie)
        {
            if (ModelState.IsValid)
            {
                _context.Add(garantie);
                await _context.SaveChangesAsync();

                TempData["SuccessMessage"] = $"De garantie <b>{garantie.FaktuurId}</b> werd toegevoegd!";
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["FaktuurId"] = new SelectList(_context.Fakturen.OrderByDescending(f => f.FaktuurNr), "FaktuurNr", "FaktuurNr", garantie.FaktuurId);
            return(View(garantie));
        }
Пример #7
0
 public Avaliste RechercherAvalistesGarantie(Garantie garantie) => avalisteBLO.Find(x =>
                                                                                    x.Garantie == garantie).FirstOrDefault();
Пример #8
0
        public void DemanderCredit(TypeCredit typeCredit, int nombreMois, Client client, Garantie garantie, double montantEmprunte,
                                   Employe employe)
        {
            operationBLO = new OperationBLO();

            creditBLO.Add(new Credit(CodeCredit, typeCredit, DateTime.Now, null, nombreMois, client, garantie, montantEmprunte,
                                     0, StatutCredit.Ouverture_du_dossier));

            operationBLO.AjouterOperation(TypeOperation.Credit, employe, garantie.Credit.Client, new CompteClient("Indefini"), montantEmprunte, "toto tata");

            new IdentifiantBLO().AddIdCredit();
        }
Пример #9
0
 public IEnumerable <FichierStocke> RechercherFichierStockesGarantie(Garantie garantie) => fichierStockeBLO.Find(x =>
                                                                                                                 x.Garantie == garantie);