public ActionResult ApplyJob(JobDetailModel model)
        {
            var alert = HtmlHelper.Vertex().Alert();

            if (string.IsNullOrEmpty(model.ApplyJob.Email))
            {
                return(Json(alert.Text("Email can not be emty.").Color(BootstrapColor.Warning).ToHtmlString(), JsonRequestBehavior.AllowGet));
            }

            if (ModelState.IsValid)
            {
                ApplyJob applyJob = new ApplyJob();
                applyJob.FullName     = model.ApplyJob.FullName;
                applyJob.Email        = model.ApplyJob.Email;
                applyJob.Phone        = model.ApplyJob.Phone;
                applyJob.Message      = model.ApplyJob.Message;
                applyJob.JobId        = model.ApplyJob.JobId;
                applyJob.ApplyDateUtc = DateTime.UtcNow;
                applyJob.IsActive     = true;

                var result = applyJobService.Save(applyJob);
                if (result)
                {
                    return(Json(alert.Text("Thank you, your email successfully added.").Color(BootstrapColor.Success).ToHtmlString(), JsonRequestBehavior.AllowGet));
                }
            }

            return(Json(alert.Text("Something is wrong, please try again.").Color(BootstrapColor.Danger).ToHtmlString(), JsonRequestBehavior.AllowGet));
        }
        public JobDetailModel Get([Required] string jobId)
        {
            var job     = jobRepository.Get(jobId);
            var stages  = stateRepository.Get(jobId);
            var results = new JobDetailModel {
                Job = job, Stages = stages
            };

            return(results);
        }
        public ActionResult JobDetail(int?Id)
        {
            if (!Id.HasValue)
            {
                return(HomePage());
            }

            var job = jobService.GetById(Id.Value);

            if (job == null)
            {
                return(NotFound());
            }


            if (!job.IsActive || job.IsDelete)
            {
                return(NotFound());
            }

            string cookieKey = string.Format(CookieConstant.PORTFOLIO_VIEW, job.Id);

            if (!CookieHelper.Exists(cookieKey))
            {
                CookieHelper.Set(cookieKey, WebHelper.IpAddress, 1);
                job.ViewCount += 1;
                jobService.Update(job);
            }

            var model = new JobDetailModel
            {
                Id           = job.Id,
                Title        = job.Title,
                Description  = job.Description,
                Url          = job.Url,
                CreateDate   = job.CreateDateUtc,
                UpdateDate   = job.UpdateDateUtc,
                ViewCount    = job.ViewCount,
                SallaryMax   = job.SallaryMax,
                SallaryMin   = job.SallaryMin,
                Location     = job.Location,
                WorkType     = job.JobType,
                CategoryName = job.Category.Name
            };

            model.ApplyJob       = new ApplyJobModel();
            model.ApplyJob.JobId = job.Id;

            return(View(model));
        }
Exemple #4
0
        public async Task <IActionResult> JobDetail(int id)
        {
            var job = _jobService.GetJobDetail(id);

            var jobDetail = new JobDetailModel();

            jobDetail.Job = job;

            var tags = _jobService.GetTags();

            jobDetail.Tags = tags.OrderBy(x => Guid.NewGuid()).Take(8).ToList();

            if (User.Identity.IsAuthenticated)
            {
                var name = User.Identity.Name;
                var user = await _userService.GetUserByName(name);

                jobDetail.IsInWishlist = _wishlistService.IsInWishlist(id, user.Id.ToString());
            }
            return(View(jobDetail));
        }
Exemple #5
0
        async void GetJob(int EmpID)
        {
            ActivitySpinner.IsVisible = true;

            HttpClient client = new HttpClient();
            string     url    = Constants.URL + "/job/GetActiveJobByEmp/" + Constants.EmpID;
            var        result = await client.GetAsync(url);

            var json = await result.Content.ReadAsStringAsync();

            try
            {
                job = Newtonsoft.Json.JsonConvert.DeserializeObject <JobDetailModel>(json);
                lblJobHeader.Text      = job.CompanyName;
                lblJobDescription.Text = job.Description;
                lblJobLocation.Text    = job.Address;
                lblClientName.Text     = job.ClientDetails;
                lblComment.Text        = job.Comment;
                jobid = job.id;
                lblViewOnMaps.Text        = job.Coordinates;
                ActivitySpinner.IsVisible = false;

                string[] arraypoints;
                string   location = job.Coordinates;
                arraypoints = location.Split(',');

                string lat = arraypoints[0];
                lattitude = Convert.ToDouble(lat, CultureInfo.InvariantCulture);
                string lng = arraypoints[1];
                longitude = Convert.ToDouble(arraypoints[1], CultureInfo.InvariantCulture);
            }
            catch (Exception ex)
            {
                await DisplayAlert("Jobs", "No Active Job", "Okay");

                btnConfirm.IsEnabled = false;
                lblNoItems.IsVisible = true;
            }
        }
        public async Task <IActionResult> Detail(int id)
        {
            var job  = _jobs.GetById(id);
            var user = await _userManager.GetUserAsync(User);

            var EC = false;

            if (user != null)
            {
                EC = user.EmailConfirmed;
            }
            var ThisJobAppliances  = _jobapps.GetThisJobAppliances(id);
            var AlreadyAppliedThis = false;

            foreach (var applicant in ThisJobAppliances)
            {
                if (applicant.AppliedBy == user)
                {
                    AlreadyAppliedThis = true;
                }
            }
            var model = new JobDetailModel
            {
                JobId            = id,
                Title            = job.Title,
                Description      = job.Description,
                Price            = job.Price,
                Status           = job.Status,
                DateCreated      = job.DateCreated,
                DateExpire       = job.DateExpire,
                ListOfAppliances = ThisJobAppliances,
                User             = job.ApplicationUser,
                IsEmailConfirmed = EC,
                AlreadyApplied   = AlreadyAppliedThis,
                CurrentUser      = user
            };

            return(View(model));
        }
        public async Task <IActionResult> JobInProgress(int id)
        {
            var job  = _jobs.GetById(id);
            var user = await _userManager.GetUserAsync(User);

            var model = new JobDetailModel
            {
                JobId          = id,
                Title          = job.Title,
                Description    = job.Description,
                Price          = job.Price,
                Status         = job.Status,
                DateCreated    = job.DateCreated,
                DateExpire     = job.DateExpire,
                RequiredSkills = job.RequiredSkills,
                User           = job.ApplicationUser,
                CurrentUser    = user,
                Employer       = job.Employer
            };

            return(View(model));
        }
 public ActionResult ViewJobDetail(Guid id)
 {
     try
     {
         if (id != Guid.Empty)
         {
             JobDetailModel vrm = GetJobById(id).ToList <JobDetailModel>().FirstOrDefault();
             if (vrm != null)
             {
                 return(View(vrm));
             }
             TempData["Error"] = "Job does not exits.";
             return(Redirect("/Error/Index"));
         }
         TempData["Error"] = "Job does not exits.";
         return(Redirect("/Error/Index"));
     }
     catch (Exception ex)
     {
         // Exception
         TempData["Error"] = ex.Message;
         return(Redirect("/Error/Index"));
     }
 }
Exemple #9
0
        public async Task <IActionResult> Details(int id)
        {
            BackupJob job = await backupJobRepository.Get(id);

            if (job == null)
            {
                return(NotFound());
            }

            var providers = job.Providers.OrderBy(p => p.Order);

            JobDetailModel model = CreateModel <JobDetailModel>("Scheduled Backup");

            model.ID                 = id;
            model.Name               = job.Name;
            model.HasChangedModel    = job.HasChangedModel;
            model.BackupProvider     = providers.FirstOrDefault().Provider.Name;
            model.StorageProvider    = providers.LastOrDefault().Provider.Name;
            model.TransformProviders = providers.Where(p => p.Provider.Type == ProviderType.Transform).Select(tp => tp.Provider.Name);

            model.CronSchedule = await schedulerService.GetCronSchedule(id);

            return(View(model));
        }