コード例 #1
0
        // GET: DoctorHome
        public ActionResult Index()
        {
            if (!string.IsNullOrEmpty(Session["firstName"] as string))
            {
                //get doctors number
                ViewBag.doctornumber = statService.getdoctornumber();


                //get patient number
                ViewBag.patientnumber = statService.getpatientnumber();

                //get rdv number
                ViewBag.rdvnumber = statService.getrdvnumber();

                //get medicalpath number
                ViewBag.medicalpathnumber = statService.getmedicalpathnumber();

                //the confirmed and cancled rdv
                List <int> confirmedCancledRDV = new List <int>();
                confirmedCancledRDV = statService.getStat();
                ViewBag.confirmed   = confirmedCancledRDV[0];
                ViewBag.cancled     = confirmedCancledRDV[1];

                //get top rank doctors
                List <object>  listuser    = statService.getrankdoc();
                string         output      = JsonConvert.SerializeObject(listuser);
                List <rankdoc> rankdoclist = JsonConvert.DeserializeObject <List <rankdoc> >(output);
                ViewBag.rankDoc = rankdoclist;

                return(View());
            }
            else
            {
                return(Redirect("../Home/Login"));
            }
        }
コード例 #2
0
        // GET: BackOfficeHome
        public ActionResult Index()
        {
            if (!string.IsNullOrEmpty(Session["firstName"] as string))
            {
                //get doctors number
                ViewBag.doctornumber = statService.getdoctornumber();


                //get patient number
                ViewBag.patientnumber = statService.getpatientnumber();

                //get rdv number
                ViewBag.rdvnumber = statService.getrdvnumber();

                //get medicalpath number
                ViewBag.medicalpathnumber = statService.getmedicalpathnumber();

                //the confirmed and cancled rdv
                List <int> confirmedCancledRDV = new List <int>();
                confirmedCancledRDV = statService.getStat();
                ViewBag.confirmed   = confirmedCancledRDV[0];
                ViewBag.cancled     = confirmedCancledRDV[1];

                //get top rank doctors
                List <object>  listuser    = statService.getrankdoc();
                string         output      = JsonConvert.SerializeObject(listuser);
                List <rankdoc> rankdoclist = JsonConvert.DeserializeObject <List <rankdoc> >(output);
                ViewBag.rankDoc = rankdoclist;

                //foreach(rankdoc e in rankdoclist)
                //{
                //    System.Diagnostics.Debug.WriteLine(e.firstName);
                //    System.Diagnostics.Debug.WriteLine(e.lastName);
                //    System.Diagnostics.Debug.WriteLine(e.speciality);
                //    System.Diagnostics.Debug.WriteLine(e.rating);
                //}



                //get all demands
                HttpClient Client = new HttpClient();
                Client.BaseAddress = new Uri("http://localhost:18080/");
                Client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                HttpResponseMessage response = Client.GetAsync("JAVAEE-web/rest/admin/demandes").Result;

                if (response.IsSuccessStatusCode)
                {
                    ViewBag.demands = response.Content.ReadAsAsync <IEnumerable <DemandViewModel> >().Result;
                }
                else
                {
                    ViewBag.demands = "error";
                }

                return(View());
            }
            else
            {
                return(Redirect("../Home/Login"));
            }
        }