protected void btnSubmit_Click(object sender, EventArgs e) { string username = txtUsername.Text; string code = txtCode.Text; Jobseeker js = null; try { BLLRecruiterWebsiteManager BLLMngr = new BLLRecruiterWebsiteManager(); List<Jobseeker> JSList = BLLMngr.ListOfJobseekers(); foreach(Jobseeker j in JSList) { if(j.JobseekerUsername == username) { js = j; } } if(js != null) { if(js.JobseekerActivationKey == code) { js.JobseekerAccountActive = true; bool result = BLLMngr.ActivateJSProfile(js); if (result) { Session["JobseekerID"] = js.JobseekerID; //Response.Redirect("~/JobseekerProfile.aspx"); Response.Redirect("~/RegisterJobInterest.aspx"); } } } } catch(Exception ex) { throw; } }
public void CreateJob() { string jobCategory; string company; string title; string location; string description; string requirements ; string type; string terms; decimal salary; string link = string.Empty; jobCategory = drplstCreateJobCategory.SelectedItem.ToString(); company = txtCompany.Text; title = txtCreateJobTitle.Text; location = drplstCreateJobLocation.SelectedItem.ToString(); description = txtCreateJobDescription.Text; requirements = txtCreateJobRequirements.Text; type = drplstCreateJobType.SelectedItem.ToString(); terms = drplstCreateJobTerms.SelectedItem.ToString(); bool isValid = decimal.TryParse(txtCreateJobSalary.Text, out salary); if (!IsValid) { txtCreateJobSalary.Text = "Invalid entry"; } if(isValid) { Job job = new Job(jobCategory, company, title, location, description, requirements, type, terms, salary, link); job.EmpID = (int)Session["EmployerID"]; // job.Link = string.Format(("~/Job.aspx?id={0}&empId={1}"), job.JobID.ToString(), job.EmpID.ToString()); job.DateCreated = DateTime.Now; try { BLLRecruiterWebsiteManager BLLMngr = new BLLRecruiterWebsiteManager(); job.Link = string.Format(("~/Job.aspx?id={0}&empId={1}"), job.JobID.ToString(), job.EmpID.ToString()); bool result = BLLMngr.InsertJob(job); if (result == true) { job.Link = string.Format(("~/Job.aspx?id={0}&empId={1}"), job.JobID.ToString(), job.EmpID.ToString()); //NEW CODE I'VE ENTERED FOR EMAILER List<WatchedJob> watchJobList = BLLMngr.GetListOfWatchedJobsFromDAL(); List<Jobseeker> jobseekerList = BLLMngr.ListOfJobseekers(); Jobseeker getJobsseeker = null; foreach (WatchedJob wj in watchJobList) { foreach (Jobseeker j in jobseekerList) { if (j.JobseekerID == wj.JobseekerID) { getJobsseeker = j; } } if (jobCategory == "Finance") { if (wj.Finance == true) { SendNotificationOfNewJobMail(getJobsseeker.JobseekerEmail, getJobsseeker.JobseekerUsername, jobCategory, title, description); } } else if (jobCategory == "Computing") { if (wj.Computing == true) { SendNotificationOfNewJobMail(getJobsseeker.JobseekerEmail, getJobsseeker.JobseekerUsername, jobCategory, title, description); } } else if (jobCategory == "Retail") { if (wj.Retail == true) { SendNotificationOfNewJobMail(getJobsseeker.JobseekerEmail, getJobsseeker.JobseekerUsername, jobCategory, title, description); ; } } else if (jobCategory == "Sales") { if (wj.Sales == true) { SendNotificationOfNewJobMail(getJobsseeker.JobseekerEmail, getJobsseeker.JobseekerUsername, jobCategory, title, description); } } else if (jobCategory == "Engineering") { if (wj.Engineering == true) { SendNotificationOfNewJobMail(getJobsseeker.JobseekerEmail, getJobsseeker.JobseekerUsername, jobCategory, title, description); } } else if (jobCategory == "Legal") { if (wj.Legal == true) { SendNotificationOfNewJobMail(getJobsseeker.JobseekerEmail, getJobsseeker.JobseekerUsername, jobCategory, title, description); } } else if (jobCategory == "Tourism") { if (wj.Tourism == true) { SendNotificationOfNewJobMail(getJobsseeker.JobseekerEmail, getJobsseeker.JobseekerUsername, jobCategory, title, description); } } else if (jobCategory == "Publishing") { if (wj.Publishing == true) { SendNotificationOfNewJobMail(getJobsseeker.JobseekerEmail, getJobsseeker.JobseekerUsername, jobCategory, title, description); } } else if (jobCategory == "Telecoms") { if (wj.Telecoms == true) { SendNotificationOfNewJobMail(getJobsseeker.JobseekerEmail, getJobsseeker.JobseekerUsername, jobCategory, title, description); } } else if (jobCategory == "Manufacturing") { if (wj.Manufacturing == true) { SendNotificationOfNewJobMail(getJobsseeker.JobseekerEmail, getJobsseeker.JobseekerUsername, jobCategory, title, description); } } } /* Computing Retail Sales Engineering Legal Tourism Publishing Telecoms Manufacturing * */ //END OF NEW CODE DataRow row = dt.NewRow(); /* dt.Columns.Add("jobID"); dt.Columns.Add("empID"); * */ row["jobID"] = job.JobID; job.Link = string.Format(("~/JobApply.aspx?id={0}&empId={1}"), job.JobID.ToString(), job.EmpID.ToString()); row["empID"] = job.EmpID; row["jobCategory"] = job.Category; row["company"] = job.Company; row["title"] = job.Title; row["location"] = job.Location; row["description"] = job.Description; row["requirements"] = job.Requirements; row["terms"] = job.Terms; row["salary"] = job.Salary; row["link"] = job.Link; row["dateCreated"] = job.DateCreated; dt.Rows.Add(row); ds.AcceptChanges(); ds.WriteXml(Server.MapPath("~/XML/Jobs.xml")); Response.Redirect("~/JobSearch.aspx?Type=" + job.Category.ToString() + "&loc=" + job.Location.ToString() + ""); } } catch (Exception ex) { throw; } } /* Validations validate = new Validations(); string isValid = validate.ValidateXMLUsingXSD(); if(isValid == string.Empty) { }*/ }