예제 #1
0
        private void NavigatedJobDetail(CollectJob job)
        {
            if (job == null)
            {
                return;
            }
            DetailJob detailJob = new DetailJob()
            {
                AddressDetail = job.AddressDetail,
                CompanyName   = job.CompanyName,
                IsCollected   = true,
                JobId         = job.JobId,
                StartTime     = job.StartTime,
                University    = job.University,
                Latitude      = job.Latitude,
                Longitude     = job.Longitude,
                Url           = job.Url,
                Status        = job.Status,
                NoteText      = job.NoteText,
                OfficalWeibo  = job.OfficalWeibo
            };

            if (!double.IsNaN(job.Latitude))
            {
                detailJob.IsPathAvailable = true;
            }
            else
            {
                detailJob.IsPathAvailable = false;
            }
            (App.Current as App).CurrentJob = detailJob;
            Messenger.Default.Send <string>(@"/View/JobDetailPage.xaml?jobId=" + job.JobId, "Navigate");
        }
예제 #2
0
 public JobDetailPage()
 {
     InitializeComponent();
     detailJob      = (App.Current as App).CurrentJob;
     btn0           = (ApplicationBarIconButton)ApplicationBar.Buttons[0];
     btn2           = (ApplicationBarIconButton)ApplicationBar.Buttons[2];
     btn2.Text      = detailJob.CollectBtnText;
     btn0.IsEnabled = detailJob.IsPathAvailable;
     if (string.IsNullOrEmpty(detailJob.OfficalWeibo))
     {
         tb_relativeWeiboEmpty.Visibility = Visibility.Visible;
         relativeWeiboListBox.Visibility  = Visibility.Collapsed;
     }
 }
예제 #3
0
        public Job_Share()
        {
            InitializeComponent();
            job = (App.Current as App).CurrentJob;
            List <ShareItem> ShareItemList = new List <ShareItem>();

            ShareItemList.Add(new ShareItem("短信分享", ""));
            ShareItemList.Add(new ShareItem("邮件分享", ""));
            ShareItemList.Add(new ShareItem("微博分享", ""));
            ShareListBox.ItemsSource = ShareItemList;
            shareText = job.CompanyName + Environment.NewLine + job.University + Environment.NewLine
                        + job.AddressDetail + Environment.NewLine
                        + job.StartTime + Environment.NewLine + "来自:校园招聘(http://www.ybole.com/xyzp)";
            weiShareText = job.CompanyName + "  " + job.University + " "
                           + job.AddressDetail + " "
                           + job.StartTime + " " + "来自:校园招聘(http://www.ybole.com/xyzp)";
        }
예제 #4
0
        public void Add(DetailJob job)
        {
            FavouriteTable favourtie = new FavouriteTable()
            {
                Job_ID = job.JobId,
                //Job_AddressCity = job.Address.City,
                Job_AddressDetail = job.AddressDetail,
                //Job_CompanyId = job.CompanyId,
                Job_CompanyName  = job.CompanyName,
                Job_Url          = job.Url,
                Job_StartTime    = job.StartTime,
                Fav_Remarks      = job.NoteText,
                Fav_Status       = "宣讲会",
                Job_IsRemind     = false,
                Job_University   = job.University,
                Job_OfficalWeibo = job.OfficalWeibo
                                   //Job_ID = job.Job_ID,
                                   //Job_AddressCity = job.Job_AddressCity,
                                   //Job_AddressDetail = job.Job_AddressDetail,
                                   //Job_AddressLatitude = job.Job_AddressLatitude,
                                   //Job_AddressLongitude = job.Job_AddressLongitude,
                                   //Job_CompanyId = job.Job_CompanyId,
                                   //Job_CompanyName = job.Job_CompanyName,
                                   //Job_Url = job.Job_Url,
                                   //Job_StartTime = job.Job_StartTime,
                                   //Job_University = job.Job_University,
                                   //Job_CompanyWeiboid = job.Job_CompanyWeiboid,
                                   //Fav_Remarks = "",
                                   //Fav_Status = "宣讲会",
                                   //Job_Detail = job.Job_Detail,
                                   //Job_IsRemind = false
            };

            if (favourtie.Fav_Remarks == null)
            {
                favourtie.Fav_Remarks = "";
            }
            if (job.Latitude != null && job.Longitude != null)
            {
                favourtie.Job_AddressLatitude  = job.Latitude;
                favourtie.Job_AddressLongitude = job.Longitude;
            }
            db.favouriteTable.InsertOnSubmit(favourtie);
            db.SubmitChanges();
        }
예제 #5
0
        private void NavigatedJobDetail(Job job)
        {
            if (job == null)
            {
                return;
            }
            foreach (CollectJob collectJob in CollectJobList)
            {
                if (collectJob.JobId.Equals(job.Id))
                {
                    NavigatedJobDetail(collectJob);
                    return;
                }
            }
            DetailJob detailJob = new DetailJob()
            {
                AddressDetail = job.Address.Detail,
                CompanyName   = job.Company.Name,
                IsCollected   = false,
                JobId         = job.Id,
                StartTime     = job.StartTime,
                University    = job.Address.University,
                Url           = job.Url,
                Status        = "宣讲会",
                OfficalWeibo  = job.Company.OfficialWeibo,
                NoteText      = ""
            };

            if (job.Address.Accurate != null)
            {
                detailJob.Longitude       = job.Address.Accurate.Longitude;
                detailJob.Latitude        = job.Address.Accurate.Latitude;
                detailJob.IsPathAvailable = true;
            }
            else
            {
                detailJob.IsPathAvailable = false;
            }

            (App.Current as App).CurrentJob = detailJob;
            Messenger.Default.Send <string>(@"/View/JobDetailPage.xaml?jobId=" + job.Id, "Navigate");
        }
예제 #6
0
        public bool WriteHeight(ref JobHandle handle, NativeArray <double> heights, NativeArray <double3> vectors)
        {
            if (splatData.IsCreated == true)
            {
                var job = new DetailJob();

                job.Heights   = heights;
                job.Vectors   = vectors;
                job.Data      = splatData;
                job.Size      = splatSize;
                job.Scale     = splatSize / new double2(math.PI * 2.0, math.PI);
                job.Style     = Style;
                job.Frequency = frequency;
                job.Octaves   = octaves;
                job.Strength  = strength;

                handle = job.Schedule(vectors.Length, math.max(1, vectors.Length / SgtDynamicPlanetChunk.Config.BATCH_SPLIT), handle);

                return(true);
            }

            return(false);
        }
예제 #7
0
 public void Delete(DetailJob job)
 {
     db.favouriteTable.DeleteOnSubmit(db.favouriteTable.SingleOrDefault(c => c.Job_ID.Equals(job.JobId)));
     db.SubmitChanges();
 }
예제 #8
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel()
        {
            //string c = (string)Isolated.Get("CurrentCity");
            // string cookie = (string)Isolated.Get("cookiesName");
            JobsList       = new ObservableCollection <Job>();
            HotCityList    = new ObservableCollection <Citys>();
            UList          = new ObservableCollection <string>();
            JobNewsList    = new ObservableCollection <JobNews>();
            CollectJobList = new ObservableCollection <CollectJob>(CollectJobDal.Instance.GetCollectJobList());
            CityDal.Instance.GetHotCitys(GetHotCityListEnd);
            JobNewsDal.Instance.GetJobNewsList(getCurrentTime(), GetJobNewsListEnd);


            var immediate = new ImmediateLocation(x => { Get_CityNameOnMap(x); });

            immediate.GetLocation();


            SelectJobCommand        = new RelayCommand <Job>((job) => NavigatedJobDetail(job));
            SelectCollectJobCommand = new RelayCommand <CollectJob>((job) => NavigatedJobDetail(job));
            SelectCityCommand       = new RelayCommand <Citys>((city) => OnChangeCity(city));
            SelectJobNewsCommand    = new RelayCommand <JobNews>((jobNews) =>
            {
                if (jobNews != null)
                {
                    Messenger.Default.Send <string>(@"/View/JobNewsDetailPage.xaml?id=" + jobNews.Id + "&name=" + jobNews.Title, "NavigateToJobNewsDetail");
                }
            });
            SelectMoreItemCommand = new RelayCommand <int>((index) => DealWithMoreItem(index));

            ChangeSchoolCommand = new RelayCommand <int>((i) =>
            {
                string city = (string)Isolated.Get("CurrentCity");
                if (i >= 0 && i < UList.Count && !string.IsNullOrEmpty(UList[i]))
                {
                    OnChangeSchool(city, UList[i]);
                }
            });
            Messenger.Default.Register <string>(this, "collectJobCompleted",
                                                jobId =>
            {
                if (jobId != null)
                {
                    CollectJobList.Add(CollectJobDal.Instance.GetNewInsertCollectJobItem(jobId));
                    //foreach(Job job in JobsList)
                    //    if(job.Id.Equals(jobId))
                    //    {
                    //        JobsList.Remove(job);
                    //        break;
                    //    }
                }
            }
                                                );
            Messenger.Default.Register <string>(this, "UpdateCollectJobList",
                                                empty =>
            {
                if (empty != null)
                {
                    DetailJob detailJob = (App.Current as App).CurrentJob;
                    foreach (CollectJob job  in CollectJobList)
                    {
                        if (job.JobId.Equals(detailJob.JobId))
                        {
                            job.AddressDetail = detailJob.AddressDetail;
                            job.StartTime     = detailJob.StartTime;
                            job.Status        = detailJob.Status;
                            job.University    = detailJob.University;
                            job.NoteText      = detailJob.NoteText;
                        }
                    }
                }
            }
                                                );
            Messenger.Default.Register <string>(this, "UnCollectJobCompleted",
                                                jobId =>
            {
                if (jobId != null)
                {
                    DetailJob detailJob = (App.Current as App).CurrentJob;
                    foreach (CollectJob job in CollectJobList)
                    {
                        if (detailJob.JobId.Equals(job.JobId))
                        {
                            CollectJobList.Remove(job);
                            break;
                        }
                    }
                }
            }
                                                );
            Messenger.Default.Register <string>(this, "Refresh",
                                                empty =>
            {
                JobDal.Instance.GetJobslist(getCurrentTime(), CurrentCity, null
                                            , GetJobListEnd);
                JobNewsDal.Instance.GetJobNewsList(getCurrentTime(), GetJobNewsListEnd);
            }
                                                );
            Messenger.Default.Register <string>(this, "SearchCityCompleted",
                                                cityName =>
            {
                OnChangeCity(new Citys()
                {
                    City = cityName, Count = "0"
                });
            }
                                                );
            Messenger.Default.Register <string>(this, "ShareJobList",
                                                empty =>
            {
                string shareContent = "大家快来关注";
                if (CurrentCity != null)
                {
                    shareContent += CurrentCity;
                }
                if (CurrentUniversity != null)
                {
                    shareContent += " " + CurrentUniversity;
                }
                shareContent += "的宣讲会吧!(来自 @歪伯乐校园招聘 http://www.ybole.com/xyzp";
                SinaShareDal.Instance.SinaShareWithCityAndUniversity(CurrentCity, CurrentUniversity, shareContent, () =>
                {
                    DispatcherHelper.CheckBeginInvokeOnUI(() =>
                    {
                        MessageBox.Show("宣讲会分享成功");
                    });
                });
            }
                                                );
            Messenger.Default.Register <string>(this, "JobListBoxRefresh",
                                                empty =>
            {
                JobDal.Instance.GetJobslist(getCurrentTime(), CurrentCity, CurrentUniversity
                                            , GetJobListEnd);
            }
                                                );
            Messenger.Default.Register <string>(this, "JobListBoxLoad",
                                                empty =>
            {
                JobDal.Instance.GetJobslist(JobsList[JobsList.Count - 1].startTime, CurrentCity, CurrentUniversity
                                            , GetAddJobListEnd);
            }
                                                );
            Messenger.Default.Register <Job>(this, "JobListSelectionChange",
                                             job =>
            {
                SelectJobCommand.Execute(job);
            }
                                             );
        }
예제 #9
0
        public JobDetailViewModel()
        {
            currentJob = (App.Current as App).CurrentJob;
            ObservableCollection <StatusTile> statusList = IsolateFile.Get <ObservableCollection <StatusTile> >("statusList.xml");

            RelativeWeiboList = new ObservableCollection <RelativeWeibo>();

            if (statusList != null)
            {
                StatusList = statusList;
            }
            else
            {
                StatusList = new ObservableCollection <StatusTile>();
                StatusList.Add(new StatusTile("宣讲会", "#e5927d"));
                StatusList.Add(new StatusTile("网申", "#e5927d"));
                StatusList.Add(new StatusTile("笔试", "#e97c65"));
                StatusList.Add(new StatusTile("一面", "#5db5e6"));
                StatusList.Add(new StatusTile("二面", "#5db5e6"));
                StatusList.Add(new StatusTile("三面", "#5db5e6"));
                StatusList.Add(new StatusTile("拿Offer", "#77c47f"));
                StatusList.Add(new StatusTile("添加", "#77c47f"));
                IsolateFile.Set <ObservableCollection <StatusTile> >("statusList.xml", StatusList);
            }
            ObservableCollection <StatusTile> stList = IsolateFile.Get <ObservableCollection <StatusTile> >("statusList.xml");

            Messenger.Default.Register <string>(this, "SendJobToDetail",
                                                (empty) =>
            {
                DetailJob job = (App.Current as App).CurrentJob;
                Status        = job.Status;
                University    = job.University;
                Address       = job.AddressDetail;
                StartTime     = job.StartTime;
                CompanyName   = job.CompanyName;
                NoteText      = job.NoteText;
                //if (date == null && time=!= null)
                {
                    Date = DateTime.Parse(StartTime).ToLongDateString();
                    Time = DateTime.Parse(StartTime).ToLongTimeString();
                }
                // Debug.WriteLine(CompanyName + "     " + Address);
                JobDal.Instance.GetJobDetail(job.JobId, (html) =>
                {
                    Detail = html;
                    if (!string.IsNullOrEmpty(html))
                    {
                        Messenger.Default.Send <string>(Detail, "job_detail");
                    }
                    else
                    {
                        Messenger.Default.Send <string>(job.Url, "job_detail");
                    }
                });
            }
                                                );
            ChangeStatusCommand = new RelayCommand(() =>
            {
                Messenger.Default.Send <string>("", "changeStatus");
            });
            Messenger.Default.Register <string>(this, "RelativeWeiboListBoxRefresh",
                                                empty =>
            {
                if (!string.IsNullOrEmpty(currentJob.OfficalWeibo))
                {
                    WeiboDal.Instance.GetRelativeWeiboList(20, 1, currentJob.OfficalWeibo, GetRelativeWeiboListEnd);
                }
            }
                                                );

            Messenger.Default.Register <string>(this, "RelativeWeiboListBoxLoad",
                                                empty =>
            {
                if (!string.IsNullOrEmpty(currentJob.OfficalWeibo))
                {
                    WeiboDal.Instance.GetRelativeWeiboList(20, ++currentPage, currentJob.OfficalWeibo, GetRelativeWeiboListEnd);
                }
            }
                                                );
            Messenger.Default.Register <string>(this, "CollectJob",
                                                jobId =>
            {
                if (jobId != null)
                {
                    // JobTable job = JobDal.Instance.GetJobById(jobId);
                    DetailJob job = (App.Current as App).CurrentJob;
                    CollectJobDal.Instance.Add(job);

                    Messenger.Default.Send <string>(job.JobId, "collectJobCompleted");
                }
            }
                                                );
            Messenger.Default.Register <string>(this, "AddJobStatusCompleted",
                                                statusName =>
            {
                StatusList.RemoveAt(statusList.Count - 1);
                StatusList.Add(new StatusTile(statusName, "#5db5e6"));
                StatusList.Add(new StatusTile("添加", "#77c47f"));
                //int count = 0;
                //if (Isolated.Get("StatusCount") != null) count = (int)Isolated.Get("StatusCount");
                //Isolated.Set("StatusCount", count  + 1);
                //Isolated.Set(count + "", statusName);
                IsolateFile.Set <ObservableCollection <StatusTile> >("statusList.xml", StatusList);
                Messenger.Default.Send <string>(statusName, "ChangeStatusCompleted");
            }
                                                );
            Messenger.Default.Register <string>(this, "UnCollectJob",
                                                jobId =>
            {
                if (jobId != null)
                {
                    // JobTable job = JobDal.Instance.GetJobById(jobId);
                    DetailJob job = (App.Current as App).CurrentJob;
                    CollectJobDal.Instance.Delete(job);
                    Messenger.Default.Send <string>(job.JobId, "UnCollectJobCompleted");
                }
            }
                                                );
            Messenger.Default.Register <bool>(this, "UpdateCollectJobData",
                                              isCollected =>
            {
                DetailJob job = (App.Current as App).CurrentJob;

                if (isCollected && isValueChange)
                {
                    isValueChange = false;
                    //(App.Current as App).isCurrentJobChange = false;
                    job.NoteText      = NoteText;
                    job.Status        = Status;
                    job.AddressDetail = Address;
                    job.University    = University;
                    job.StartTime     = Date.Substring(Date.IndexOf("年") + 1) + Time;
                    job.Date          = Date;
                    job.Time          = Time;
                    CollectJobDal.Instance.Update(job.JobId, Status, job.University, job.AddressDetail, job.StartTime, NoteText);

                    Messenger.Default.Send <string>("", "UpdateCollectJobList");
                }
                address    = null;
                status     = null;
                noteText   = null;
                date       = null;
                time       = null;
                university = null;
            }
                                              );
            StatusChangeCompletedCommand = new RelayCommand <StatusTile>((item) =>
            {
                if (item == null)
                {
                    return;
                }

                Messenger.Default.Send <string>(item.Name, "ChangeStatusCompleted");
                if (!item.Name.Equals("添加"))
                {
                    Status = item.Name;
                }
                else
                {
                    Messenger.Default.Send <string>("", "AddJobStatus");
                }
            });

            if (!string.IsNullOrEmpty(currentJob.OfficalWeibo))
            {
                WeiboDal.Instance.GetRelativeWeiboList(20, 1, currentJob.OfficalWeibo, GetRelativeWeiboListEnd);
            }
        }