Exemplo n.º 1
0
        private async void DisplayPatients()
        {
            // Get all patients from the database, and display them.
            //foreach (Patient p in _db.Patients)
            //{
            //    string patientName = p.FirstName + " " + p.LastName;
            //    patientsGridView.Rows.Add(p.PatientID, patientName);
            //}

            var servicePatients = await _client.GetAsync <List <Patients> >("patients");

            foreach (var p in servicePatients)
            {
                string patientName = p.FirstName + " " + p.LastName;
                patientsGridView.Rows.Add(p.PatientId, patientName);
            }
        }
Exemplo n.º 2
0
        private async void DisplayReviews()
        {
            string userReviews   = "";
            var    userReviewAll = await _client.GetAsync <List <UserReview> >("UserReviews");

            foreach (var p in userReviewAll)
            {
                userReviews = userReviews + "<button type='button' class='collapsible'><div class='ratings username'>" + p.StrUsername + "</div><div class='ratings ratingtype'>" + p.IntRating.StrRatingName + "</div><div class='ratings datetime'>" + p.DtmTimeSubmitted.AddHours(-4) + "</div></button><div class='content'><p>" + p.StrComment + "</p></div>";
            }

            ReviewsPanel.Controls.Add(new LiteralControl(userReviews));

            int i = 0;
            var userReviewType = await _client.GetAsync <List <UserReviewType> >("UserReviewTypes");

            foreach (var type in userReviewType)
            {
                ddlRating.Items.Insert(i, new ListItem(type.StrRatingName, type.LngRatingId.ToString()));
                i++;
            }
        }