Пример #1
0
        async void ViewProfile(object sender, ItemTappedEventArgs e)
        {
            double rate     = 0;
            int    divide   = 0;
            string admin    = null;
            var    feedback = await entmanager.GetAllEntFeedback(enterprise.Username);

            foreach (EntFeedback entfeedback in feedback)
            {
                if (entfeedbacks.All(b => b.Id != entfeedback.Id))
                {
                    divide++;
                    rate = rate + entfeedback.Rating;
                }
            }
            rate = rate / divide;
            await Navigation.PushModalAsync(new ProfileEnterprise(enterprise, jobseeker, rate, admin));
        }
Пример #2
0
        async void getreview()
        {
            var feedback = await entmanager.GetAllEntFeedback(enterprise.Username);

            foreach (EntFeedback entfeedback in feedback)
            {
                if (entfeedbacks.All(b => b.Id != entfeedback.Id))
                {
                    entfeedbacks.Add(entfeedback);
                    count++;
                }
            }

            if (count == 0)
            {
                Label noreview = new Label
                {
                    Text            = "No review available right now",
                    BackgroundColor = Color.Red
                };
                parent.Children.Add(noreview);
            }
            else
            {
                Label[] comment = new Label[count];
                Label[] name    = new Label[count];

                for (int i = 0; i < count; i++)
                {
                    name[i] = new Label
                    {
                        Text = entfeedbacks[i].SeekerName + " - " + entfeedbacks[i].Rating + "/5"
                    };

                    comment[i] = new Label
                    {
                        Text = entfeedbacks[i].Review,
                    };
                    parent.Children.Add(name[i]);
                    parent.Children.Add(comment[i]);
                }
            }
        }