예제 #1
0
        private async void PopulateRecruiterList()
        {
            progressBar.Visibility = ViewStates.Visible;
            string        fileName_pastQs = "pastqs_" + myAttributes.attribute1;
            var           firebase        = new FirebaseClient(FirebaseURL);
            List <int>    studentIds      = new List <int>();
            List <string> studentNames    = new List <string>();
            List <string> studentRatings  = new List <string>();

            var pastQs = await firebase.Child("pastqs").Child(fileName_pastQs).OnceAsync <PastQ>();

            foreach (var pastq in pastQs)
            {
                if (pastq.Object.rating != "0")
                {
                    studentIds.Add(Convert.ToInt32(pastq.Object.studentid));
                    studentNames.Add(pastq.Object.name);
                    studentRatings.Add(pastq.Object.rating);
                }
            }

            PastQueuesListViewAdapter adapter = new PastQueuesListViewAdapter(mContainer.Context, studentIds, "Profile", studentNames, studentRatings);

            lv_favorites.Adapter   = adapter;
            progressBar.Visibility = ViewStates.Invisible;
        }
예제 #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            mContainer = container;
            string dbPath_attributes = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "attributes.db3");
            var    db_attributes     = new SQLiteConnection(dbPath_attributes);

            myAttributes = db_attributes.Get <MyAttributes>(1);

            string type = myAttributes.type;

            if (type == "Student")
            {
                View     view        = inflater.Inflate(Resource.Layout.StudentProfileTab, container, false);
                TextView name        = view.FindViewById <TextView>(Resource.Id.myName);
                TextView email       = view.FindViewById <TextView>(Resource.Id.myEmail);
                TextView school      = view.FindViewById <TextView>(Resource.Id.myUniversity);
                TextView major       = view.FindViewById <TextView>(Resource.Id.myMajor);
                TextView gpa         = view.FindViewById <TextView>(Resource.Id.myGPA);
                TextView gradterm    = view.FindViewById <TextView>(Resource.Id.myGradterm);
                TextView editProfile = view.FindViewById <TextView>(Resource.Id.editProfile);
                favListView = view.FindViewById <ListView>(Resource.Id.favoritesList);
                progressBar = view.FindViewById <ProgressBar>(Resource.Id.circularProgress);

                name.Text     = myAttributes.name;
                email.Text    = myAttributes.email;
                school.Text   = myAttributes.attribute1;
                gradterm.Text = myAttributes.attribute2;
                major.Text    = myAttributes.attribute3;
                gpa.Text      = myAttributes.attribute4;

                editProfile.Click += EditProfile_Click;

                int myCFID = myAttributes.cfid;
                if (myCFID != 0)
                {
                    PopulateList();
                }

                return(view);
            }

            else if (type == "Recruiter")
            {
                View     view        = inflater.Inflate(Resource.Layout.RecruiterProfileTab, container, false);
                TextView name        = view.FindViewById <TextView>(Resource.Id.myName);
                TextView email       = view.FindViewById <TextView>(Resource.Id.myEmail);
                TextView company     = view.FindViewById <TextView>(Resource.Id.myCompany);
                TextView editProfile = view.FindViewById <TextView>(Resource.Id.editProfile);

                name.Text    = myAttributes.name;
                email.Text   = myAttributes.email;
                company.Text = myAttributes.attribute1;

                editProfile.Click += EditProfile_Click;

                int myCFID = myAttributes.cfid;

                if (myCFID != 0)
                {
                    string           fileName_pastqs = "pastqs_" + myAttributes.attribute1 + ".db3";
                    string           dbPath_pastqs   = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), fileName_pastqs);
                    SQLiteConnection db_pastqs       = new SQLiteConnection(dbPath_pastqs);
                    int numpastqs = db_pastqs.Table <SQLite_Tables.PastQueue>().Count();

                    string           dbPath_login = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "user.db3");
                    SQLiteConnection db_login     = new SQLiteConnection(dbPath_login);

                    ListView   lv_favorites = view.FindViewById <ListView>(Resource.Id.favoritesList);
                    List <int> students     = new List <int>();

                    for (int i = 1; i <= numpastqs; i++)
                    {
                        SQLite_Tables.PastQueue thisPastQueue = db_pastqs.Get <SQLite_Tables.PastQueue>(i);
                        if (thisPastQueue.rating != 0)
                        {
                            int newStudentid = thisPastQueue.studentid;
                            students.Add(newStudentid);
                        }

                        PastQueuesListViewAdapter adapter = new PastQueuesListViewAdapter(container.Context, students, "Profile");
                        lv_favorites.Adapter = adapter;
                    }
                }
                return(view);
            }
            else
            {
                throw new NotImplementedException();
            }
        }