public ActionResult updateExpanse(Guid idExpanse)
        {
            ExpanseRepositery expRepo = new ExpanseRepositery();
            Expanses          exp     = expRepo.GetById(idExpanse);
            Guid   expRapId           = exp.ExpanseReport_ID;
            double ht  = Convert.ToInt32(Request.Form["Amount_HT"]);
            double ttc = Convert.ToInt32(Request.Form["Amount_TTC"]);
            double tva = Convert.ToInt32(Request.Form["Amount_TVA"]);

            expRepo.updateExpanses(exp, ttc, ht, tva);
            return(RedirectToAction("AllExpanses", new { idExpanseReport = expRapId }));
        }
        public ActionResult edit(Guid idExpanse)
        {
            ExpanseRepositery expRep   = new ExpanseRepositery();
            ExpansesModel     expModel = new ExpansesModel();
            Expanses          exp      = expRep.GetById(idExpanse);

            expModel.Expanse_ID       = exp.Expanse_ID;
            expModel.Project_ID       = exp.Project_ID;
            expModel.Customer_ID      = exp.Customer_ID;
            expModel.ExpanseReport_ID = exp.ExpanseReport_ID;
            expModel.Amount_HT        = exp.Amount_HT;
            expModel.Amount_TTC       = exp.Amount_TTC;
            expModel.Amount_TVA       = exp.Amount_TVA;
            expModel.Day = exp.Day;
            return(View("EditExpanses", expModel));
        }
        public ActionResult Delete(Guid id)
        {
            ExpanseRepositery        expRepo   = new ExpanseRepositery();
            ExpanseRepportRepositery expRapRep = new ExpanseRepportRepositery();
            Expanses       exp       = expRepo.GetById(id);
            Guid           idExpRapo = exp.ExpanseReport_ID;
            ExpanseReports expReport = expRapRep.GetById(idExpRapo);
            double         ttc       = expReport.Total_TTC - exp.Amount_TTC;
            double         ht        = expReport.Total_HT - exp.Amount_HT;
            double         tva       = expReport.Total_TVA - exp.Amount_TVA;

            expRapRep.updateExpanseReports(expReport, ttc, ht, tva);
            expRepo.Delete(exp);
            expRepo.Save();
            return(RedirectToAction("AllExpanses", new { idExpanseReport = idExpRapo }));
        }