public JXTNextResumeController(IJobApplicationService jobApplicationService, IBusinessLogicsConnector blConnector) { _jobApplicationService = jobApplicationService; _blConnector = blConnector; resumeList = new List <ProfileResumeJsonModel>(); Email = SitefinityHelper.GetLoggedInUserEmail(); }
private IMemberUpsertJobAlertResponse GetUpsertResponse(JobAlertViewModel model, bool update = false) { JobAlertSalaryFilterReceiver salary = null; if (!model.SalaryStringify.IsNullOrEmpty()) { salary = JsonConvert.DeserializeObject <JobAlertSalaryFilterReceiver>(model.SalaryStringify); } if (salary != null) { model.Salary = salary; } var epochTime = ConversionHelper.GetUnixTimestamp(SitefinityHelper.GetSitefinityApplicationTime(), true); model.LastModifiedTime = (long)epochTime; // Remove null value filters List <JobAlertFilters> Filters = new List <JobAlertFilters>(); if (model != null && model.Filters != null && model.Filters.Count > 0) { foreach (var item in model.Filters) { if (item.Values != null && item.Values.Count > 0) { Filters.Add(item); } } } model.Filters = Filters; if (model != null && model.Email.IsNullOrEmpty()) { model.Email = SitefinityHelper.GetLoggedInUserEmail(); } var response = _jobAlertService.MemberJobAlertUpsert(model, update); return(response); }
public ActionResult Create(JobAlertViewModel model) { List <JobAlertEditFilterRootItem> filtersVMList = GetJobFilterData(); if (model.SalaryStringify != null) { model.Salary = JsonConvert.DeserializeObject <JobAlertSalaryFilterReceiver>(model.SalaryStringify); } if (String.IsNullOrEmpty(model.Email)) { model.Email = SitefinityHelper.GetLoggedInUserEmail(); } model.Data = JobAlertUtility.ConvertJobAlertViewModelToSearchModel(model, filtersVMList); // Create Email Notification EmailNotificationSettings jobAlertEmailNotificationSettings = null; if (this.JobAlertEmailTemplateId != null) { jobAlertEmailNotificationSettings = new EmailNotificationSettings(new EmailTarget(this.JobAlertEmailTemplateSenderName, this.JobAlertEmailTemplateSenderEmailAddress), new EmailTarget(string.Empty, model.Email), SitefinityHelper.GetCurrentSiteEmailTemplateTitle(this.JobAlertEmailTemplateId), SitefinityHelper.GetCurrentSiteEmailTemplateHtmlContent(this.JobAlertEmailTemplateId), null); if (!this.JobAlertEmailTemplateCC.IsNullOrEmpty()) { foreach (var ccEmail in this.JobAlertEmailTemplateCC.Split(';')) { jobAlertEmailNotificationSettings?.AddCC(String.Empty, ccEmail); } } if (!this.JobAlertEmailTemplateBCC.IsNullOrEmpty()) { foreach (var bccEmail in this.JobAlertEmailTemplateBCC.Split(';')) { jobAlertEmailNotificationSettings?.AddBCC(String.Empty, bccEmail); } } } model.EmailNotifications = jobAlertEmailNotificationSettings; var response = GetUpsertResponse(model); var stausMessage = "A Job Alert has been created successfully."; var alertStatus = JobAlertStatus.SUCCESS; if (!response.Success) { stausMessage = response.Errors.First(); alertStatus = JobAlertStatus.CREATE_FAILED; } TempData["StatusCode"] = alertStatus; TempData["StatusMessage"] = stausMessage; // Why action name is empty? // Here we need to call Index action, if we are providing action name as Index here // It is appending in the URL, but we dont want to show that in URL. So, sending it as empty // Will definity call defaut action i,.e Index return(RedirectToAction("")); }