Ejemplo n.º 1
0
        //[SessionExpire]
        public ActionResult Index(int?id)
        {
            TempData["TrendingTagsFooter"] = MatchBxCommon.GetTrendingTagsFooter();
            TempData["RecordDisplay"]      = _RecordDisplay;
            //Session["ProfilePic"] = "/Content/images/client_pic_1.png";
            int userid = id.GetValueOrDefault();

            if (userid.ToString() != null)
            {
                Session["MemberNo"]        = userid;
                Session["PublicProfileId"] = userid;

                // Gus: 2FA
                TwoFactorAuthenticator tfa = new TwoFactorAuthenticator();
                string useruniquekey       = Convert.ToString(userid) + Session["UserName"];
                Session["Useruniquekey"] = useruniquekey;
                var setupinfo = tfa.GenerateSetupCode("MatchBX-" + Session["email"], useruniquekey, 280, 280);
                ViewBag.qrcode     = setupinfo.QrCodeSetupImageUrl;
                ViewBag.manualcode = setupinfo.ManualEntryKey;
            }

            objProfile = objProfileMod.LoadUserProfile(userid).FirstOrDefault();

            try
            {
                string rating = Adjust(decimal.ToDouble(objProfile.Rating)).ToString();
                if (rating.Contains('.'))
                {
                    string[] parts = rating.Split('.');
                    TempData["RatingWhole"] = parts[0];
                    if (parts[1] != null)
                    {
                        TempData["RatingFraction"] = parts[1];
                    }
                    else
                    {
                        TempData["RatingFraction"] = 0;
                    }
                }
                else
                {
                    TempData["RatingWhole"]    = rating;
                    TempData["RatingFraction"] = 0;
                }
            }
            catch (Exception ex)
            {
            }

            model.Profile = objProfile;

            objUserSkillList = objUserSkill.SkillsByUserId(userid);
            objUserSkillList.ToList().ForEach(x => x.Description = "#" + x.Description.ToString());

            string userskilllist = "";

            foreach (var item in objUserSkillList)
            {
                if (objUserSkillList.IndexOf(item) == objUserSkillList.Count - 1)
                {
                    userskilllist += item.Description;
                }
                else
                {
                    userskilllist += item.Description + ", ";
                }
            }

            model.UserSkill = objUserSkillList;
            model.Skill     = userskilllist;

            if (userid != 0)
            {
                objJob.TrendingTagsIdList          = "0";
                objJob.SkillsList                  = "0";
                objJob.UserId                      = userid;
                Session["PublicProfileId"]         = userid;
                objCompletedJob.TrendingTagsIdList = "0";
                objCompletedJob.SkillsList         = "0";
                objCompletedJob.JobSeekerId        = userid;
                objCompletedJob.FromPage           = "J";
                objJob.FromPage                    = "J";
                //objGig.TrendingTagsIdList = "0";
                //objGig.SkillsList = "0";
                objGig.UserId           = userid;
                objGig.LoginUserId      = Convert.ToInt32(Session["UserId"]);
                objPurchasedGig.UserId  = userid;
                objCompletedJobList     = objJobMod.GetJobDetails(objCompletedJob);
                model.CompletedJobCount = objCompletedJobList.Count();
                model.CompletedJob      = MatchBxCommon.GenerateBadge(objCompletedJobList.Take(_RecordDisplay).ToList());
                objJobList           = objJobMod.GetJobDetails(objJob);
                model.ListedJobCount = objJobList.Count();
                model.ListedJob      = MatchBxCommon.GenerateBadge(objJobList.Take(_RecordDisplay).ToList());
                objGigList           = objGigMod.GetGigDetailsProfile(objGig);
                model.ListedGigCount = objGigList.Count();
                model.ListedGig      = MatchBxCommon.GenerateBadgeForGig(objGigList.Take(_RecordDisplay).ToList());
                //model.UserSkill = objUserSkill.LoadSkillsByUserId(userid);
                objPurchasedGigList     = objGigMod.GetPurchasedGig(objPurchasedGig);
                model.PurchasedGigCount = objPurchasedGigList.Count();
                model.PurchasedGig      = MatchBxCommon.GenerateBadgeForGig(objPurchasedGigList.Take(_RecordDisplay).ToList());
                model.WithID            = "Y";
            }
            else
            {
                model.WithID = "N";
            }
            model.messageSender = 0;
            //model.Job.messageSender=0;
            return(View("Index", model));
        }
Ejemplo n.º 2
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));
        }