Example #1
0
        //public async void NextRecommendation()
        //{
        //    if (TinderSession.CurrentSession.Recommendations.Count > 0)
        //        _currentRec = TinderSession.CurrentSession.Recommendations.Pop();
        //    else
        //        _currentRec = null;
        //    RaisePropertyChanged("PhotoCount");
        //    RaisePropertyChanged("Name");
        //    RaisePropertyChanged("Age");
        //    RaisePropertyChanged("FriendCount");
        //    RaisePropertyChanged("LikeCount");
        //    RaisePropertyChanged("ProfilePhoto");
        //    RaisePropertyChanged("CurrentReccomendation");
        //    RaisePropertyChanged("LikesBrush");
        //    RaisePropertyChanged("FriendsBrush");
        //    RaisePropertyChanged("PhotosBrush");

        //    if (TinderSession.CurrentSession.Recommendations.Count == 0)
        //        await TinderSession.CurrentSession.GetRecommendations();
        //}

        public async void NextJobSuggestion()
        {
            if (TinderSession.CurrentSession.JobRecommendations.Count > 0)
            {
                _currentJob = TinderSession.CurrentSession.JobRecommendations.Pop();
            }
            else
            {
                _currentJob = null;
            }

            RaisePropertyChanged("Id");
            RaisePropertyChanged("Name");
            RaisePropertyChanged("DescriptionSnippet");
            RaisePropertyChanged("LocationDescription");
            //RaisePropertyChanged("LikeCount");
            //RaisePropertyChanged("ProfilePhoto");
            RaisePropertyChanged("CurrentJobReccomendation");
            //RaisePropertyChanged("LikesBrush");
            //RaisePropertyChanged("FriendsBrush");
            //RaisePropertyChanged("PhotosBrush");

            //if (TinderSession.CurrentSession.Recommendations.Count == 0)
            //    await TinderSession.CurrentSession.GetRecommendations();
        }
Example #2
0
        public JobReccommendationsViewModel()
        {
            _likeUserCommand   = new RelayCommand(LikeUser);
            _rejectUserCommand = new RelayCommand(RejectUser);

            //&& TinderSession.CurrentSession.IsAuthenticated

            if (TinderSession.CurrentSession != null &&
                TinderSession.CurrentSession.JobRecommendations.Count > 0)
            {
                _currentJob = TinderSession.CurrentSession.JobRecommendations.Pop();

                RaisePropertyChanged("Id");
                RaisePropertyChanged("Name");
                RaisePropertyChanged("DescriptionSnippet");
                RaisePropertyChanged("LocationDescription");
                //RaisePropertyChanged("LikeCount");
                //RaisePropertyChanged("LikesBrush");
                //RaisePropertyChanged("FriendsBrush");
                //RaisePropertyChanged("PhotosBrush");
                //RaisePropertyChanged("ProfilePhoto");
                RaisePropertyChanged("CurrentJobReccomendation");
                RaisePropertyChanged("JobCount");

                //[JsonProperty("company")]
                //[JsonProperty("descriptionSnippet")]
                //[JsonProperty("id")]
                //[JsonProperty("jobPoster")]
                //[JsonProperty("locationDescription")]
            }
        }
        // Insert the new Job in the LinkedinJob table.
        public void Insert(LinkedinJob newJob)
        {
            Tb_LinkedinJob j = new Tb_LinkedinJob();

            j.CompanyId          = newJob.Company.Id;
            j.CompanyName        = newJob.Company.Name;
            j.DescriptionSnippet = newJob.DescriptionSnippet;
            j.JobId = newJob.Id;
            j.JobPosterFirstName  = newJob.JobPoster.FirstName;
            j.LocationDescription = newJob.LocationDescription;

            using (var dbConn = new SQLiteConnection(DB_PATH))
            {
                dbConn.RunInTransaction(() =>
                {
                    dbConn.Insert(j);
                });
            }
        }
        //Update existing conatct
        public void UpdateJob(LinkedinJob job)
        {
            using (var dbConn = new SQLiteConnection(DB_PATH))
            {
                var existingJob = dbConn.Query <Tb_LinkedinJob>("select * from Tb_LinkedinJob where jobId =" + job.Id).FirstOrDefault();
                if (existingJob != null)
                {
                    existingJob.CompanyId          = job.Company.Id;
                    existingJob.CompanyName        = job.Company.Name;
                    existingJob.DescriptionSnippet = job.DescriptionSnippet;
                    existingJob.JobId = job.Id;
                    existingJob.JobPosterFirstName  = job.JobPoster.FirstName;
                    existingJob.LocationDescription = job.LocationDescription;

                    dbConn.RunInTransaction(() =>
                    {
                        dbConn.Update(existingJob);
                    });
                }
            }
        }
 public JobInfoViewModel(LinkedinJob data)
 {
     _data = data;
 }