Beispiel #1
0
        public ActionResult Index(int?id)
        {
            if (Session["IsEmailAlready"] != null)
            {
                ViewBag.IsEmailAlready    = "Y";
                Session["IsEmailAlready"] = null;
            }
            else
            {
                //Session["IsEmailAlready"] = "N";
                ViewBag.IsEmailAlready    = "N";
                Session["IsEmailAlready"] = null;
            }
            dynamic model = new ExpandoObject();

            if (Session["FromDetails"] != null && Session["DynModel"] != null)
            {
                model = (dynamic)Session["DynModel"];
                model.TopJobPosters    = (List <Job>)Session["TopJobPosters"];
                model.VerifiedPartners = (List <Job>)Session["VerifiedPartners"];
                model.TrendingTags     = (List <TrendingTags>)Session["TrendingTags"];
                Session["FromDetails"] = null;
                Session["DynModel"]    = null;
            }
            else
            {
                if (id.GetValueOrDefault() == 0)
                {
                    objJob.TrendingTagsIdList = "0";
                }
                else
                {
                    objJob.TrendingTagsIdList = id.GetValueOrDefault().ToString();
                    ViewBag.CurrentTag        = id.GetValueOrDefault().ToString();
                }
                objJob.SkillsList = "0";
                List <Job> _JobList = new List <Job>();
                objJob.SortBy = "B";
                GetCategory();
                objJob.FromPage = category;
                //if (Session["UserId"] != null)
                //{
                //    objJob.FromPage = "J";
                //}
                //else
                //{
                //    objJob.FromPage = "B";
                //}

                _JobList = objJobMod.GetJobDetails(objJob).OrderByDescending(x => x.Rownumber).ToList();

                if (_JobList.Count == 1)
                {
                    ViewBag.MetaTag = HomeMetaTags(_JobList[0].JobTitle.ToString(), _JobList[0].JobDescription.ToString());
                }
                else if (_JobList.Count > 1)
                {
                    ViewBag.MetaTag = HomeMetaTags("Hire freelancers, pay in cryptocurrency", "Complete jobs to earn AXPR, or post a job and have great freelancers come to you");
                }

                _TotalRecord = _JobList.Count();
                if (_TotalRecord > _RecordDisplay)
                {
                    _loadmore = 1;
                }
                else
                {
                    _loadmore = 0;
                }


                _JobList.ForEach(x => x.Isloadmore = _loadmore);
                _JobList                 = _JobList.Take(_RecordDisplay).ToList();
                model.Job                = MatchBxCommon.GenerateBadge(_JobList);
                model.TopJobPosters      = objJobMod.GetTopJobPosters(objJob);
                model.VerifiedPartners   = objJobMod.GetVerifiedPartners(objJob);
                Session["TopJobPosters"] = model.TopJobPosters;
                //if (Session["UserId"] != null)
                //{
                //    objTrending.FromPage = "J";
                //}
                //else
                //{
                //    objTrending.FromPage = "B";
                //}
                // GetCategory();
                objTrending.FromPage       = category;
                model.TrendingTags         = objTrendingMod.GetTrendingTags(objTrending);
                Session["TrendingTags"]    = model.TrendingTags;
                Session["JobCategoryName"] = "";
                Session["JobCategoryId"]   = 0;
                //TempData["TrendingTagsFooter"] = MatchBxCommon.GetTrendingTagsFooter();
            }
            List <JobCategory> _JobcategoryList = new List <JobCategory>();
            JobCategoryModel   JobModel         = new JobCategoryModel();

            _JobcategoryList       = JobModel.GetList();
            Session["JobCategory"] = _JobcategoryList;
            model.messageSender    = 0;
            if (Request.QueryString["mailMessagId"] != null)
            {
                string _messageSender = Request.QueryString["mailMessagId"].ToString();
                model.messageSender     = Convert.ToInt32(_messageSender);
                Session["mailMessagId"] = _messageSender;
            }

            TempData["TrendingTagsFooter"] = MatchBxCommon.GetTrendingTagsFooter(objTrending.FromPage);
            return(View("Index", model));
        }