Exemplo n.º 1
0
        public async Task <IActionResult> ProcessStage(string stageId, string returnUrl = null)
        {
            var myId = _userManager.GetUserId(HttpContext.User);
            ApplicationStageBase stage = null;

            try
            {
                stage = await _applicationStageService.GetApplicationStageBaseToProcessStage(stageId, myId);
            }
            catch (CustomRecruiterException ex)
            {
                TempData["Error"] = ex.Message;
                return(RedirectToLocalOrToApplicationsStagesToReview(returnUrl));
            }

            switch (stage?.GetType().Name)
            {
            case "ApplicationApproval":
                return(RedirectToAction(nameof(ApplicationStageController.ProcessApplicationApproval), new { stageId, returnUrl }));

            case "PhoneCall":
                return(RedirectToAction(nameof(ApplicationStageController.ProcessPhoneCall), new { stageId, returnUrl }));

            case "Homework":
                return(RedirectToAction(nameof(ApplicationStageController.ProcessHomework), new { stageId, returnUrl }));

            case "Interview":
                return(RedirectToAction(nameof(ApplicationStageController.ProcessInterview), new { stageId, returnUrl }));

            default:
                TempData["Error"] = _stringLocalizer["Couldn't process stage: Unknown Application Stage type with ID:{0}.", stageId].ToString();
                return(RedirectToLocalOrToApplicationsStagesToReview(returnUrl));
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> ShowApplicationStageDetails(string stageId, string returnUrl = null)
        {
            ViewData["ReturnUrl"] = returnUrl;

            var myId = _userManager.GetUserId(HttpContext.User);
            ApplicationStageBase stage = null;

            try
            {
                stage = await _applicationStageService.GetApplicationStageBase(stageId, myId);
            }
            catch (CustomRecruiterException ex)
            {
                TempData["Error"] = ex.Message;
                return(RedirectToLocalOrToHomeIndex(returnUrl));
            }

            switch (stage?.GetType().Name)
            {
            case "ApplicationApproval":
                return(RedirectToAction(nameof(ApplicationStageController.ApplicationStageBaseDatails),
                                        new { stageId = stage.Id, returnUrl }));

            case "PhoneCall":
                return(RedirectToAction(nameof(ApplicationStageController.ApplicationStageBaseDatails),
                                        new { stageId = stage.Id, returnUrl }));

            case "Homework":
                return(RedirectToAction(nameof(ApplicationStageController.HomeworkStageDetails),
                                        new { stageId = stage.Id, returnUrl }));

            case "Interview":
                return(RedirectToAction(nameof(ApplicationStageController.InterviewStageDetails),
                                        new { stageId = stage.Id, returnUrl }));

            default:
                if (stage != null)
                {
                    TempData["Warning"] = _stringLocalizer["Couldn't find well known application stage type with ID:{0}, below showed primary ApplicationStageBase.", stageId].ToString();
                    return(RedirectToAction(nameof(ApplicationStageController.ApplicationStageBaseDatails),
                                            new { stageId = stage.Id, returnUrl }));
                }
                else
                {
                    TempData["Error"] = _stringLocalizer["Couldn't find application stage details: Unknown stage with ID:{0}.", stageId].ToString();
                    return(RedirectToLocalOrToHomeIndex(returnUrl));
                }
            }
        }
Exemplo n.º 3
0
 public Task SendEmailNotificationProcessPhoneCallAsync(string email, string link, ApplicationStageBase stage)
 {
     return(Task.CompletedTask);
 }
Exemplo n.º 4
0
 public Task SendEmailNotificationAddHomeworkSpecificationAsync(/*string email, */ string link, ApplicationStageBase stage)
 {
     return(Task.CompletedTask);
 }
Exemplo n.º 5
0
        public Task SendEmailNotificationProcessPhoneCallAsync(string email, string link, ApplicationStageBase stage)
        {
            string subject = _stringLocalizer["{0} - Application state notification", stage.Application.JobPosition.Name];
            string title   = _stringLocalizer["Application state notification"];
            string content = "";

            if (stage.Accepted)
            {
                content += _stringLocalizer["Your telephone conversation has ended positively. <br/><br/>"];
            }
            else
            {
                content += _stringLocalizer["We regret to inform you that your telephone conversation has ended negatively. <br/><br/>"];
            }
            content += _stringLocalizer["Check details by clicking this link: <a href='{0}'>link</a>", HtmlEncoder.Default.Encode(link)];

            //return Task.CompletedTask;
            return(SendEmailAsync(email, subject, GetEmailTemplate(title, content)));
        }
Exemplo n.º 6
0
        public Task SendEmailNotificationProcessInterviewStageAsync(string email, string link, ApplicationStageBase stage)
        {
            string subject = _stringLocalizer["{0} - Recruitment process was finished", stage.Application.JobPosition.Name];
            string title   = _stringLocalizer["Recruitment process was finished"];
            string content = "";

            if (stage.Accepted)
            {
                content += _stringLocalizer["Congratulations! Your interview has ended positively. <br/>We invite you to the office of the company in order to sign the contract.<br/><br/>"];
            }
            else
            {
                content += _stringLocalizer["We regret to inform you that your interview has ended negatively. <br/><br/>"];
            }

            //return Task.CompletedTask;
            return(SendEmailAsync(email, subject, GetEmailTemplate(title, content)));
        }
Exemplo n.º 7
0
        public Task SendEmailNotificationAddHomeworkSpecificationAsync(/*string email, */ string link, ApplicationStageBase stage)
        {
            string subject = _stringLocalizer["{0} - Application state notification", stage.Application.JobPosition.Name];
            string title   = _stringLocalizer["Application state notification"];
            string content = "";

            content += _stringLocalizer["Homework specification was added. <br/><br/>"];
            content += _stringLocalizer["Now you can read your homework details by clicking this link: <a href='{0}'>link</a>", HtmlEncoder.Default.Encode(link)];

            //return Task.CompletedTask;
            return(SendEmailAsync(stage.Application.User.Email, subject, GetEmailTemplate(title, content)));
        }