コード例 #1
0
 public IHttpActionResult nbDoneProjects()
 {
     return(Json(ss.Doneprojects()));
 }
        public ActionResult dish()
        {
            /*dash*/
            var        clients      = ss.AllClients();
            List <int> repartition  = new List <int>();
            var        clientsNames = clients.Select(x => x.Nom).Distinct();

            foreach (var item in clientsNames)
            {
                foreach (Domain.Entity.Client c in clients)
                {
                    repartition.Add(c.NbrRessource);
                }
            }
            var rep = repartition;

            /*index2--pie*/
            int nombreResource = ss.nbResource();
            int nbUsers        = ss.nbUsers();
            int nbprojects     = ss.nbProjects();
            int nbreq          = ss.nbRequests();
            int resAV          = ss.GetMany(a => a.ressourceStates == 0).ToList().Count();
            int clientss       = ss.nbclients();



            /*dish*/
            var           projects           = ps.GetAll();
            List <int>    repartitonProjects = new List <int>();
            List <String> etatsproj          = new List <string>();
            var           projectsNames      = projects.Select(x => x.Nom).Distinct();
            int           nbprojectsDone     = ss.Doneprojects();
            int           nbprojectsNew      = ss.newprojects();
            int           nbprojectsGoing    = ss.Goingprojects();

            repartitonProjects.Add(nbprojectsNew);
            repartitonProjects.Add(nbprojectsGoing);
            repartitonProjects.Add(nbprojectsDone);

            etatsproj.Add("new");


            etatsproj.Add("On_going");

            etatsproj.Add("Done");


            ViewBag.repartitonProjects = repartitonProjects;
            ViewBag.etatsproj          = etatsproj;
            ViewBag.rep            = repartition.ToList();
            ViewBag.clientsNames   = clientsNames;
            ViewBag.resAv          = resAV;
            ViewBag.clientss       = clientss;
            ViewBag.nbUsers        = nbUsers;
            ViewBag.nombreResource = nombreResource;
            ViewBag.nbprojects     = nbprojects;



            return(View());
        }