Beispiel #1
0
        public override void RowSelected(UITableView tableView, Foundation.NSIndexPath indexPath)
        {
            var cell = tableView.CellAt(indexPath) as RefineCell;

            PresentationFacetResult facets = _presentationFacetResultList[(int)indexPath.Section];
            FacetValue aFacetValue         = facets.ListFacetValues[(int)indexPath.Row];

            string filterUrl = (!string.IsNullOrEmpty(aFacetValue.ValueChecked)) ? aFacetValue.ValueChecked : aFacetValue.ValueUnChecked;

            bool isSelected = !aFacetValue.isSelected;

            if (isSelected)
            {
                //filterUrl = aFacetValue.ValueChecked;
                cell.checkBoxButton.SetImage(UIImage.FromBundle("check.png"), UIControlState.Normal);
                cell.label.TextColor = UIColor.Red;
            }
            else
            {
                //filterUrl = aFacetValue.ValueUnChecked;
                cell.checkBoxButton.SetImage(UIImage.FromBundle("uncheck.png"), UIControlState.Normal);
                cell.label.TextColor = UIColor.DarkGray;
            }

            Constants.FilterURL = Constants.JobBaseAddress + filterUrl;
            tableView.DeselectRow(indexPath, true);

            aFacetValue.isSelected = isSelected;

            _refineViewController.GetJobSearchData();
        }
Beispiel #2
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            var cell = tableView.DequeueReusableCell(RefineCell.Key, indexPath) as RefineCell;

            PresentationFacetResult facets = _presentationFacetResultList[(int)indexPath.Section];
            FacetValue aFacetValue         = facets.ListFacetValues[(int)indexPath.Row];

            cell.label.Text = aFacetValue.ValueName + "(" + aFacetValue.ValueCount + ")";

            // If ValueUnChecked is not null that means filter is selected.
            if (string.IsNullOrEmpty(aFacetValue.ValueChecked) || aFacetValue.isSelected)
            {
                //cell.imageView.Image = UIImage.FromBundle("arrow-down-icon.png");
                cell.label.TextColor = UIColor.Red;
                cell.checkBoxButton.SetImage(UIImage.FromBundle("check.png"), UIControlState.Normal);
            }
            else
            {
                //cell.imageView.Image = UIImage.FromBundle("arrow-down.png");
                cell.label.TextColor = UIColor.DarkGray;
                cell.checkBoxButton.SetImage(UIImage.FromBundle("uncheck.png"), UIControlState.Normal);
            }


            return(cell);
        }
Beispiel #3
0
        public override UIView GetViewForHeader(UITableView tableView, nint section)
        {
            PresentationFacetResult facet = _presentationFacetResultList[(int)section];

            HeaderCell header = tableView.DequeueReusableHeaderFooterView(HeaderCell.Key) as HeaderCell;

            header.label.Text = facet.FacetDisplayName;


            if (_isSectionOpen[(int)section])
            {
                header.arrowBuuton.SetImage(UIImage.FromBundle("grey_arrow-down-icon.png"), UIControlState.Normal);
            }
            else
            {
                header.arrowBuuton.SetImage(UIImage.FromBundle("grey_arrow-right-icon.png"), UIControlState.Normal);
            }



            foreach (var view in header.Subviews)
            {
                if (view is HiddenHeaderButton)
                {
                    view.RemoveFromSuperview();
                }
            }
            var hiddenButton = CreateHiddenHeaderButton(header.Bounds, section);

            header.AddSubview(hiddenButton);
            return(header);
        }
Beispiel #4
0
        public override nint RowsInSection(UITableView tableview, nint section)
        {
            PresentationFacetResult facets = _presentationFacetResultList[(int)section];

            return(_isSectionOpen[(int)section] ? facets.ListFacetValues.Count : 0);
        }
Beispiel #5
0
        //Dictionary<string, List<string>>


        public async System.Threading.Tasks.Task <Dictionary <string, dynamic> > AsyncJobSearch(JobRequest jobRequest)
        {
            var responseDict = new Dictionary <string, dynamic>();


            List <JobCMS> jobList = new List <JobCMS>();


            var baseAddress = new Uri(Constants.JobBaseAddress);
            var values      = new Dictionary <string, string>();

            values.Add("filterUrl", jobRequest.FilterURL);
            values.Add("sfr", Constants.JobDetailSiteName);
            //Adecco USA	values.Add("facetSettingId", "{D4739C3F-3DAB-49DE-9C6E-7215979C15BF}");
            values.Add("facetSettingId", Constants.JobSearchFacetSettingID);

            values.Add("currentLanguage", Constants.JobDetailCurrentLanguage);
            values.Add("IsJobPage", "1");
            values.Add("clientId", "");
            values.Add("clientName", "");
            values.Add("branchId", "");
            var content         = new FormUrlEncodedContent(values);
            var cookieContainer = new CookieContainer();


            CFNetworkHandler networkHandler = new CFNetworkHandler();

            networkHandler.UseSystemProxy  = true;
            networkHandler.CookieContainer = cookieContainer;

            HttpClientHandler handler = new HttpClientHandler()
            {
                AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate,
                CookieContainer        = cookieContainer
            };


            //using (var handler = new HttpClientHandler() { CookieContainer = cookieContainer })
            using (var client = new HttpClient(handler))
            {
                try
                {
                    cookieContainer.Add(baseAddress, new Cookie("sitenameForRegister", Constants.JobDetailSiteName));
                    //Adecco USA cookieContainer.Add(baseAddress, new Cookie("ASP.NET_SessionId", "wejofxxqheshv4gzya35sakr"));
                    cookieContainer.Add(baseAddress, new Cookie("ASP.NET_SessionId", "01pypyigge22sem4bd5mmjba"));

                    cookieContainer.Add(baseAddress, new Cookie("Locale", Constants.JobDetailCurrentLanguage));                    //ja-JP
                    cookieContainer.Add(baseAddress, new Cookie("userstatus", "candidate"));
                    cookieContainer.Add(baseAddress, new Cookie("IsJobPage", "1"));

                    var httpResponse = await client.PostAsync(Constants.JobSearchURL, content);


                    if (httpResponse.StatusCode == HttpStatusCode.OK)
                    {
                        string responseContent = await httpResponse.Content.ReadAsStringAsync();

                        dynamic responseObj = Newtonsoft.Json.JsonConvert.DeserializeObject(responseContent);

                        //if(responseObj == null)
                        //	return null;

                        dynamic jobitems   = responseObj["Items"];
                        dynamic jobsCount  = responseObj["Count"];
                        dynamic TotalCount = responseObj["TotalCount"];

                        Constants.TotalJobCount = TotalCount.ToObject <string>();
                        Constants.JobCount      = jobsCount.ToObject <string>();

                        Constants.JobCount = Constants.JobCount.Replace("xx", Constants.TotalJobCount);
                        JobCMS job = null;
                        jobList = new List <JobCMS>();
                        foreach (JObject jcontent in jobitems.Children <JObject>())
                        {
                            job = new JobCMS();
                            job = jcontent.ToObject <JobCMS>();

                            if (Constants.JobDetailSiteName.Equals("adecco.fr"))
                            {
                                job.ContractTypeTitle = job.EmploymentTypeTitle;
                            }
                            jobList.Add(job);
                        }

                        responseDict.Add("jobList", jobList);


                        dynamic presentationFacetResults = responseObj["PresentationFacetResults"];

                        List <PresentationFacetResult> presentationFacetResultList = new List <PresentationFacetResult>();
                        PresentationFacetResult        _presentationFacetResult    = new PresentationFacetResult();

                        foreach (JObject jcontent in presentationFacetResults.Children <JObject>())
                        {
                            //presentationFacetResult.ListFacetValues = new List<FacetValue>();
                            _presentationFacetResult = jcontent.ToObject <PresentationFacetResult>();
                            presentationFacetResultList.Add(_presentationFacetResult);
                        }
                        //Console.WriteLine("ListPresentationFacetResult =={0}", presentationFacetResultList);
                        responseDict.Add("presentationFacetResultList", presentationFacetResultList);


                        dynamic _SelectedFacets = responseObj["SelectedFacets"];
                        List <SelectedFacets> selectedFacetsList = new List <SelectedFacets>();
                        SelectedFacets        aSelectedFacets    = new SelectedFacets();

                        foreach (JObject jcontent in _SelectedFacets.Children <JObject>())
                        {
                            aSelectedFacets = jcontent.ToObject <SelectedFacets>();
                            selectedFacetsList.Add(aSelectedFacets);
                        }

                        Console.WriteLine("selectedFacetsList =={0}", selectedFacetsList);
                        responseDict.Add("selectedFacetsList", selectedFacetsList);



                        return(responseDict);
                    }
                    return(responseDict);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.ToString());
                }
            }
            return(responseDict);
        }