public ActionResult UpdateRedevancesVendeur([FromUri] int idCommande)
        {
            try
            {
                var commandeAUpdate =
                    (from commande
                     in ctxt.PPHistoriquePaiements
                     where commande.NoCommande == idCommande
                     select commande).First();

                commandeAUpdate.Redevance *= -1;

                ctxt.SubmitChanges();

                DetailsRedevances details =
                    (from vendeur
                     in ctxt.PPVendeurs
                     join paiement
                     in ctxt.PPHistoriquePaiements
                     on vendeur.NoVendeur equals paiement.NoVendeur
                     into paiementsVendeur
                     where vendeur.NoVendeur == commandeAUpdate.NoVendeur
                     select new DetailsRedevances
                {
                    Paiements = paiementsVendeur.ToList(),
                    Vendeur = vendeur,
                }).First();

                return(PartialView("Gestionnaire/Redevances/_DetailsRedevances", details));
            }
            catch (InvalidOperationException e)
            {
                return(HttpBadRequest());
            }
        }
        private ActionResult Redevances(int id)
        {
            try
            {
                var redevances =
                    (from paiement
                     in ctxt.PPHistoriquePaiements
                     where paiement.NoVendeur == id && paiement.Redevance > 0
                     select paiement).ToList();

                var vendeur =
                    (from v
                     in ctxt.PPVendeurs
                     where v.NoVendeur == id
                     select v).First();

                var viewModel = new DetailsRedevances
                {
                    Vendeur   = vendeur,
                    Paiements = redevances,
                };

                return(PartialView("Gestionnaire/Redevances/_DetailsRedevances", viewModel));
            }
            catch (InvalidOperationException e)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.NotFound));
            }
        }