public ActionResult CreateGig(int?id) { Session["ExRate"] = MatchBxCommon.GetExchangeRate(); dynamic model = new ExpandoObject(); int gigid = id.GetValueOrDefault(); TempData["Category"] = objCatMod.GetList(); TempData["Tags"] = new List <TrendingTags>(); TempData["Skills"] = new List <Skills>(); //GetTagsnSkills(0); if (gigid != 0) { objGigList = objGigMod.GetGigPost(gigid); if (objGigList.Count() > 0) { TrendingTagsModel _TrendingTagsModel = new TrendingTagsModel(); SkillsModel _SkillsModel = new SkillsModel(); //TempData["Tags"] = objJobMod.GetTrendingTags(objJobList[0].JobCategoryId); //TempData["Skills"] = objJobMod.GetTopSkills(objJobList[0].JobCategoryId); if (gigid != 0) { TempData["Tags"] = _TrendingTagsModel.GetList(" * ", " JobCategoryId = " + objGigList[0].JobCategoryId); } else { TempData["Tags"] = _TrendingTagsModel.GetList(" * ", " JobCategoryId = " + objGigList[0].JobCategoryId + " and TagType = 'S'"); } TempData["Skills"] = _SkillsModel.GetList(" * ", " JobCategoryId = " + objGigList[0].JobCategoryId); objGigList.FirstOrDefault().GigSkillsMappingList = objGigMod.GetSkillsByGigId(gigid); objGigList.FirstOrDefault().GigTrendingTagsMappingList = objGigMod.GetTagsByGigId(gigid); objGigList.FirstOrDefault().GigDocumentsList = objGigMod.GetDocumentsByGigId(gigid); objGig = objGigList.FirstOrDefault(); objGig.BudgetInDollar = objGig.BudgetASP; objGig.BudgetASP = objGig.BudgetASP * (decimal)Session["ExRate"]; objGig.BudgetASPString = "$ " + objGig.BudgetASP.ToString("#,##0.00"); objGig.GigId = Convert.ToInt32(id); TempData["SelectedTags"] = objGig.GigTrendingTagsMappingList; TempData["SelectedSkills"] = objGig.GigSkillsMappingList; Session["TrendingTagsList"] = objGig.GigTrendingTagsMappingList; Session["SkillsList"] = objGig.GigSkillsMappingList; } } return(View("CreateGig", objGig)); }
public ActionResult Index(int?id, int?type) { cattype = type.GetValueOrDefault(); if (cattype != 0) { if (cattype == 2) { category = "G"; } else { category = "J"; } } else { GetCategory(); } Session["ExchangeRate"] = MatchBxCommon.GetExchangeRate(); TempData["TrendingTagsFooter"] = MatchBxCommon.GetTrendingTagsFooter(); MultipleModel modelMul = new MultipleModel(); int _loadmore = 0; JobCategoryId = id.GetValueOrDefault(); Session["JobCatId"] = JobCategoryId; dynamic model = new ExpandoObject(); objJob.JobCategoryId = JobCategoryId; objJob.FromPage = category; objJob.SortBy = "H"; if (Session["searchmodel"] != null && Session["FromDetails"] != null) { SearchCriteria _model = (SearchCriteria)Session["searchmodel"]; objJob.TrendingTagsIdList = _model.populartags; objJob.SkillsList = _model.topskills; ViewBag.budgetMin = _model.budgetMin; ViewBag.MaxBudget = _model.budgetMax; objJob.SortBy = _model.sortorder; Session["searchmodel"] = null; Session["FromDetails"] = null; } else { objJob.TrendingTagsIdList = "0"; objJob.SkillsList = "0"; } objJobList = MatchBxCommon.GenerateBadge(objJobMod.GetJobDetails(objJob).ToList().OrderByDescending(x => x.BudgetASP).ToList()); //objJobList = MatchBxCommon.GenerateBadge(objJobMod.GetJobDetails(objJob).ToList().OrderByDescending(x => x.BudgetASP).ThenByDescending(x => x.Rownumber).ToList()); TempData["JobList"] = objJobList; _TotalRecord = objJobList.Count(); if (_TotalRecord > _RecordDisplay) { _loadmore = 1; } else { _loadmore = 0; } objJobList.ForEach(s => s.Isloadmore = _loadmore); objJobList.ForEach(s => s.BudgetASPInt = Convert.ToInt32(s.BudgetASP)); model.Job = objJobList.Take(_RecordDisplay).ToList(); Session["Category"] = category; //if (category == "J") //{ // objJobList.ForEach(s => s.FromPage = "J"); // Session["Category"] = "J"; //} //else { // objJobList.ForEach(s => s.FromPage = "G"); // Session["Category"] = "G"; //} objTrending.JobCategoryId = JobCategoryId; objTrending.FromPage = category; objTrendingTagsList = objTrendingMod.GetTrendingTags(objTrending); model.TrendingTags = objTrendingTagsList; objTrendingTagsList.ForEach(s => s.Description = s.Description.Replace("#", "")); model.PopularTags = objTrendingTagsList; objSkills.JobCategoryId = JobCategoryId; Session["JobCategoryId"] = JobCategoryId; objSkills.FromPage = category; model.skills = objSkillsMod.GetTopSkills(objSkills); 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; } return(View("Index", model)); }
public ActionResult GigFeedBackReview(int?GigReviewId) { if (Session["UserType"] == null || Session["UserType"].ToString() != "4") { //TempData["gigid"] = GigReviewId.GetValueOrDefault(); return(RedirectToAction("Index", "Jobs", new { @redirecturl = "Y" })); } else { JobCategoryModel objCatMod = new JobCategoryModel(); var categoryList = objCatMod.GetList(); dynamic model = new ExpandoObject(); categoryList.ForEach(c => { var lowerCase = c.Category.ToLower(); var r = new Regex(@"(^[a-z])|\.\s+(.)", RegexOptions.ExplicitCapture); c.Category = r.Replace(lowerCase, s => s.Value.ToUpper()); }); TempData["Category"] = categoryList; TempData["message"] = string.Empty; TempData["BlockReason"] = _objUsrBlockModel.GetList(); TempData["CancelJobReason"] = _ObjJobModel.GetJobCancelList(); GigReviewModel _GigReviewModel = new GigReviewModel(); Gig _Gig = new Gig(); _Gig.JobCategoryId = 0; _Gig.SortBy = "N"; List <GigReview> _GigReviewList = new List <GigReview>(); _GigReviewList = _GigReviewModel.GigReviewAdmin("N"); if (GigReviewId.GetValueOrDefault() != 0) { _GigReviewList = _GigReviewList.Where(x => x.GigId == GigReviewId.GetValueOrDefault()).ToList <GigReview>(); } if (_GigReviewList.Count > 0) { //foreach (Job _job in _GigList) //{ //_GigReviewList.ForEach(s => s.BudgetASPInt = Convert.ToInt32(s.BudgetASP)); // } //if (!String.IsNullOrEmpty(_searchtext)) //{ // _GigList = _GigList.Where(p => p.JobDescription != null && p.JobDescription.ToLower().Contains(_searchtext.ToLower().Trim()) || p.JobTitle != null && p.JobTitle.ToLower().Contains(_searchtext.ToLower().Trim()) || p.JobCompletionDateDisplay != null && p.JobCompletionDateDisplay.ToLower().Contains(_searchtext.ToLower()) || p.TrendingTagsIdList != null && p.TrendingTagsIdList.ToLower().Contains(_searchtext.ToLower())).ToList(); //} ReviewRecord = _GigReviewList.Count(); if (ReviewRecord > recordDisplay) { reviewloadmore = 1; } else { reviewloadmore = 0; } _GigReviewList.ForEach(x => x.Isloadmore = reviewloadmore); model.GigReview = _GigReviewList.Take(recordDisplay).ToList(); } else { model.GigReview = new List <GigReview>(); } return(View("GigFeedbackReview", model.GigReview)); } }
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)); }
public PartialViewResult JobReview(int?jid) { TempData["message"] = string.Empty; dynamic model = new ExpandoObject(); JobCategoryModel objCatMod = new JobCategoryModel(); var categoryList = objCatMod.GetList(); categoryList.ForEach(c => { // start by converting entire string to lower case var lowerCase = c.Category.ToLower(); // matches the first sentence of a string, as well as subsequent sentences var r = new Regex(@"(^[a-z])|\.\s+(.)", RegexOptions.ExplicitCapture); // MatchEvaluator delegate defines replacement of setence starts to uppercase c.Category = r.Replace(lowerCase, s => s.Value.ToUpper()); }); TempData["Category"] = categoryList; TempData["CancelJobReason"] = _ObjJobModel.GetJobCancelList(); JobModel _JobModel = new JobModel(); Job _Job = new Job(); _Job.JobCategoryId = 0; _Job.SortBy = "N"; List <Job> _JobList = MatchBxCommon.GenerateBadge(_JobModel.GetJobReview(_Job)); if (jid.GetValueOrDefault() != 0) { _JobList = _JobList.Where(x => x.JobId == jid.GetValueOrDefault()).ToList(); } foreach (Job _job in _JobList) { _JobList.ForEach(s => s.BudgetASPInt = Convert.ToInt32(s.BudgetASP)); _JobList.ForEach(s => s.EndsIn = (s.JobCompletionDate.Subtract(DateTime.Now)).Days + " days, " + (s.JobCompletionDate.Subtract(DateTime.Now)).Hours + " hours"); } var objJobListFiltered = _JobList.GroupBy(x => x.JobId).Select(y => y.First()).ToList(); ReviewRecord = objJobListFiltered.Count(); if (ReviewRecord > recordDisplay) { reviewloadmore = 1; } else { reviewloadmore = 0; } objJobListFiltered.ForEach(s => s.Isloadmore = reviewloadmore); if (_JobList.Count() == 0 && jid.GetValueOrDefault() != 0) { JobModel jobmodel = new JobModel(); Job obj = jobmodel.GetARecord(jid.GetValueOrDefault()); if (obj != null) { TempData["message"] = obj.JobStatus != "F" ? "This job is already approved" : "This job is already rejected"; } else { TempData["message"] = "This job does not exist"; } } model.JobReview = objJobListFiltered.OrderByDescending(x => x.JobId).Take(recordDisplay).ToList(); return(PartialView("JobReview", model.JobReview)); }