//[UserAuthentication(Constants.AllRoles)] public IActionResult JobDetails(int jobid) { JobPostViewModel jobdetail = new JobPostViewModel(); var user = HttpContext.Session.Get <UserViewModel>(Constants.SessionKeyUserInfo); user = user ?? new UserViewModel(); try { jobdetail = jobpastHandler.GetJobDetails(jobid); //string imgname = Path.GetFileName(jobdetail.CompanyLogo); //jobdetail.CompanyLogo = $@"/ProfilePic/" + imgname; if (user != null) { List <int> appliedjobs = homeHandler.GetAplliedJobs(user.UserId); //if(jobid == appliedjobs.) for (int i = 0; i < appliedjobs.Count; i++) { //getting the all the jobs applied by user only if the user logged in if (appliedjobs[i] == jobid) { jobdetail.IsApplied = true; break; } } } } catch (DataNotFound ex) { Logger.Logger.WriteLog(Logger.Logtype.Error, ex.Message, user.UserId, typeof(JobController), ex); //result = ex.Message; ModelState.AddModelError("ErrorMessage", string.Format("{0}", ex.Message)); } return(View(jobdetail)); }
//[UserAuthentication(Constants.AllRoles)] public IActionResult JobDetails(int jobid) { JobPostViewModel jobdetail = new JobPostViewModel(); var user = HttpContext.Session.Get <UserViewModel>(Constants.SessionKeyUserInfo); user = user ?? new UserViewModel(); try { var basePath = string.Format("{0}://{1}{2}", Request.Scheme, URLprotocol, Request.Host); //var basePath = string.Format("{0}", "http://18.221.113.108:83"); var pageLink = "/Job/JobDetails/?jobid="; var fbUrl = "https://www.facebook.com/sharer/sharer.php?u="; var twitterUrl = "https://twitter.com/home?status="; var whatsAppUrl = "https://wa.me/?text="; var encodedlink = System.Web.HttpUtility.UrlEncode(basePath + pageLink); ViewBag.FBUrl = string.Format("{0}{1}", fbUrl, basePath + pageLink); ViewBag.TwitterUrl = string.Format("{0}{1}", twitterUrl, basePath + pageLink); ViewBag.WhatsAppUrl = string.Format("{0}{1}", whatsAppUrl, encodedlink); jobdetail = jobpastHandler.GetJobDetails(jobid); ViewBag.jDetails = Regex.Replace(jobdetail.JobDetails, "<.*?>", String.Empty); if (user != null) { List <int> appliedjobs = homeHandler.GetAplliedJobs(user.UserId); //if(jobid == appliedjobs.) for (int i = 0; i < appliedjobs.Count; i++) { //getting the all the jobs applied by user only if the user logged in if (appliedjobs[i] == jobid) { jobdetail.IsApplied = true; break; } } } } catch (DataNotFound ex) { Logger.Logger.WriteLog(Logger.Logtype.Error, ex.Message, user.UserId, typeof(JobController), ex); //result = ex.Message; ModelState.AddModelError("ErrorMessage", string.Format("{0}", ex.Message)); } return(View(jobdetail)); }