Exemple #1
0
#pragma warning disable RECS0165 // Asynchronous methods should return a Task instead of void
        private async void GetJobDetails()
#pragma warning restore RECS0165 // Asynchronous methods should return a Task instead of void
        {
            if (!string.IsNullOrEmpty(this.jobTitle) && !(this.jobTitle.Equals("NoContent")))
            {
                this.titleLabel.Text = this.jobTitle;
            }
            else
            {
                this.titleLabel.Hidden = true;
            }
            if (!string.IsNullOrEmpty(this.isNew))
            {
                this.lblNew.Hidden = false;
            }
            else
            {
                this.lblNew.Hidden        = true;
                this.favorateButton.Frame = new CGRect(315, 20, 30, 30);
            }

            if (aJob.isFavorote)
            {
                favorateButton.SetImage(UIImage.FromFile("heart-icon-selected.png"), UIControlState.Normal);
            }

            else
            {
                favorateButton.SetImage(UIImage.FromFile("fav-icon.png"), UIControlState.Normal);
            }


            if (!string.IsNullOrEmpty(this.loaction) && !(this.loaction.Equals("NoContent")))
            {
                this.locationLabel.Text = this.loaction;
            }
            else
            {
                this.locationLabel.Text = "No Content";
                //this.locationLabel.Hidden = true;
                //this.btnLocation.Hidden = true;
            }

            //if (!string.IsNullOrEmpty(this.salary) && !(this.salary.Equals("NoContent")))
            //{
            //	this.salaryLabel.Text = this.salary;
            //}
            //else
            //{
            //	this.salaryLabel.Hidden = true;
            //	this.btnSalary.Hidden = true;

            //}
            if (!string.IsNullOrEmpty(this.jobCategory) && !(this.jobCategory.Equals("NoContent")))
            {
                this.categoryLabel.Text = this.jobCategory;
            }
            else
            {
                this.categoryLabel.Text = "N/A";
                //this.btnCategory.Hidden = true;
            }

            if (!string.IsNullOrEmpty(aJob.ContractTypeTitle) && !(aJob.ContractTypeTitle.Equals("NoContent")))
            {
                this.ContractTypeLabel.Text = aJob.ContractTypeTitle;
            }
            else
            {
                this.ContractTypeLabel.Hidden = true;
                this.btnContractType.Hidden   = true;
            }

            if (Constants.JobDetailSiteName.Equals("adecco.fr"))
            {
            }



            try
            {
                NetworkStatus remoteHostStatus = Reachability.RemoteHostStatus();
                if (remoteHostStatus == NetworkStatus.NotReachable)
                {
                    var alert = UIAlertController.Create("Network Error", "Please check your internet connection", UIAlertControllerStyle.Alert);
                    alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
                    PresentViewController(alert, animated: true, completionHandler: null);

                    return;
                }

                BTProgressHUD.Show("Loading...", -1, ProgressHUD.MaskType.Black);

                aJobDetail = new JobCIS();

                ServiceManager jobService = new ServiceManager();
                this.aJobDetail = await jobService.GetJobDetails(this.JobId);

                loadData(aJobDetail);
            }
            catch (Exception ex)
            {
                string str = ex.Message;
            }
        }