public ActionResult AddJobs(Job Model) { try { Model.QuestionairId = 1; ATSEntities db = new ATSEntities(); using (db) { if (Model.JobId > 0) { //edit case //db code for saving date Model.UpdateDate = DateTime.Now; db.Jobs.Attach(Model); db.Entry(Model).State = EntityState.Modified; db.SaveChanges(); } else { //insert case //db code for saving date Model.CreateDate = DateTime.Now; db.Jobs.Add(Model); db.SaveChanges(); } } } catch (Exception ex) { string st = ex.Message; } return(RedirectToAction("Jobs", "Recruiter")); }
public ActionResult Sourcing(string Search = "") { try { ATSEntities db = new ATSEntities(); using (db) { var currentUser = LoginHelper.GetCurrentLoginUser(); var Jobs = db.Jobs.Where(x => x.RecId == currentUser.Id).Select(x => new SelectListItem() { Text = x.JobName, Value = x.JobId.ToString() }).ToList(); ViewBag.Jobslist = Jobs; var Sourcing = db.Candidates.Where(x => x.RecId == currentUser.Id && x.IsActive == true).ToList(); if (!string.IsNullOrEmpty(Search)) { Sourcing = Sourcing.Where(x => x.FirstName.Contains(Search) || x.LastName.Contains(Search) || x.FatherName.Contains(Search)).Where(x => x.IsActive == true).ToList(); } return(View(Sourcing)); } } catch (Exception ex) { string st = ex.Message; } ViewBag.Search = Search; return(View(new List <Candidate>())); }
public ActionResult Jobs() { try { ATSEntities db = new ATSEntities(); using (db) { //job list all var currentUser = LoginHelper.GetCurrentLoginUser(); var Jobs = db.Jobs.Where(x => x.RecId == currentUser.Id).ToList(); //To Get Jobs List filter //var Jobs = db.Jobs.Where(x => x.IsActive == true).ToList(); //To get object //var JobObj = db.Jobs.FirstOrDefault(x => x.JobId == 1);//Where 1 is job id //code for delete //db.Jobs.Remove(JobObject); //db.SaveChanges(); return(View(Jobs)); } } catch (Exception ex) { string st = ex.Message; } return(View(new List <Job>())); }
public ActionResult AssignToJob(int CandidateId, int JobId) { ATSEntities db = new ATSEntities(); using (db) { var jobObj = db.Jobs.FirstOrDefault(x => x.JobId == JobId); var CandidateObj = db.Candidates.FirstOrDefault(x => x.CanId == CandidateId); CandidateObj.IsActive = false; db.Candidates.Attach(CandidateObj); db.Entry(CandidateObj).State = EntityState.Modified; db.SaveChanges(); if (jobObj != null && CandidateObj != null) { Applicant ApplicantObj = new Applicant(); ApplicantObj.ApplicantFullName = CandidateObj.FirstName + " " + CandidateObj.LastName; ApplicantObj.CanId = CandidateObj.CanId; ApplicantObj.CreateDate = DateTime.Now; ApplicantObj.IsShortlisted = true; ApplicantObj.JobId = jobObj.JobId; db.Applicants.Add(ApplicantObj); db.SaveChanges(); } } return(RedirectToAction("Sourcing", "Recruiter")); }
public ActionResult AddCandidate(Candidate Model) { try { Model.RecId = LoginHelper.GetCurrentLoginUser().Id; Model.ResumeSourceId = 1; ATSEntities db = new ATSEntities(); if (Model.CanId > 0) { //edit case //db code for saving date Model.UpdateDate = DateTime.Now; db.Candidates.Attach(Model); db.Entry(Model).State = EntityState.Modified; db.SaveChanges(); } else { //insert case //db code for saving date Model.CreateDate = DateTime.Now; db.Candidates.Add(Model); db.SaveChanges(); } } catch (Exception ex) { string st = ex.Message; } return(RedirectToAction("Sourcing", "Recruiter")); }
public ActionResult JobApplicationPage(JobApplicationPageViewModel Model) { int Marks = 0; try { ATSEntities db = new ATSEntities(); using (db) { foreach (var item in Model.AnswerList) { var obj = db.Answers.FirstOrDefault(x => x.AnswerId == item.AnswerId); if (obj.IsRight) { Marks += 1; } } Model.CandidateObj.MarksObtained = Marks; int totalanswer = Model.AnswerList.Count; totalanswer = totalanswer / 2; if (Marks >= totalanswer) { Model.CandidateObj.IsQualified = true; } else { Model.CandidateObj.IsQualified = false; } Model.CandidateObj.ResumeSourceId = 1; Model.CandidateObj.RecId = Model.RecruiterObj.RecId; if (Model.CandidateObj.CanId > 0) { //edit case //db code for saving date Model.CandidateObj.UpdateDate = DateTime.Now; db.Candidates.Attach(Model.CandidateObj); db.Entry(Model.CandidateObj).State = EntityState.Modified; db.SaveChanges(); } else { //insert case //db code for saving date Model.CandidateObj.IsActive = true; Model.CandidateObj.CreateDate = DateTime.Now; db.Candidates.Add(Model.CandidateObj); db.SaveChanges(); } } } catch (Exception ex) { string st = ex.Message; } return(RedirectToAction("JobApplicationPage", "Home", new { Recruiter = Model.RecruiterObj.RecId, Job = Model.JobObj.JobId })); }
public IQueryable <Employee> GetEmployees() { db = new ATSEntities(); //var employees = db.Employees.Where(p=>p.IsActive==1).Select(p => p); var employees = db.Employees.Where(p => p.IsActive == true).Select(p => p); return(employees); }
public ActionResult RecruiterSetting() { ATSEntities db = new ATSEntities(); using (db) { var currentUser = LoginHelper.GetCurrentLoginUser(); Recruiter recruiter = db.Recruiters.FirstOrDefault(x => x.RecId == currentUser.Id); return(View(recruiter)); } }
public ActionResult Answers(int QuestionId) { ViewBag.QuestionId = QuestionId; ATSEntities db = new ATSEntities(); using (db) { var Answers = db.Answers.Where(x => x.QuestionId == QuestionId).ToList(); return(View(Answers)); } }
public ActionResult Index() { var profiler = MiniProfiler.Current; using (profiler.Step("Count")) using (var context = new ATSEntities()) { ViewBag.Count = context.T_Binding.Count(); } return(View()); }
public ActionResult Questions(int QuestionairId) { ViewBag.QuestionairId = QuestionairId; ATSEntities db = new ATSEntities(); using (db) { var Questions = db.Questions.Where(x => x.QuestionairId == QuestionairId).ToList(); return(View(Questions)); } }
public ActionResult Questioner() { var currentUser = LoginHelper.GetCurrentLoginUser(); ATSEntities db = new ATSEntities(); List <Questionair> Queslist = new List <Questionair>(); using (db) { Queslist = db.Questionairs.Where(x => x.RecId == currentUser.Id).ToList(); return(View(Queslist)); } }
public ActionResult AddCandidate(int id = 0) { Candidate Model = new Candidate(); if (id > 0) { ATSEntities db = new ATSEntities(); Model = db.Candidates.FirstOrDefault(x => x.CanId == id); } Model.RecId = LoginHelper.GetCurrentLoginUser().Id; // Model.ResumeSourceId = LoginHelper.GetCurrentLoginUser().Id; return(View(Model)); }
public ActionResult RecruiterSetting(Recruiter Model, FormCollection fm, HttpPostedFileBase LogoFile) { ATSEntities db = new ATSEntities(); using (db) { if (Model.RecId > 0) { var currentUser = LoginHelper.GetCurrentLoginUser(); Recruiter recruiter = db.Recruiters.FirstOrDefault(x => x.RecId == currentUser.Id); try { //Check if File is available. if (LogoFile != null && LogoFile.ContentLength > 0) { //Save the File. string DirectoryPath = Server.MapPath("~/Content/Images/RecLogo/" + Model.RecId + "/"); string filePath = DirectoryPath + LogoFile.FileName; Model.Logo = LogoFile.FileName; if (!System.IO.Directory.Exists(DirectoryPath)) { System.IO.Directory.CreateDirectory(DirectoryPath); } if (System.IO.Directory.Exists(DirectoryPath)) { LogoFile.SaveAs(filePath); } } } catch (Exception ex) { } recruiter.Username = Model.Username; recruiter.Password = Model.Password; recruiter.CompanyName = Model.CompanyName; recruiter.CompanyAddress = Model.CompanyAddress; recruiter.City = Model.City; recruiter.State = Model.State; recruiter.Logo = Model.Logo; //recruiter.ExternalLogo = Model.ExternalLogo; db.Recruiters.Attach(recruiter); db.Entry(recruiter).State = EntityState.Modified; db.SaveChanges(); } return(RedirectToAction("RecruiterSetting", "Recruiter")); } }
public ActionResult IsRightAnswers(int QuestionId, int AnswerId, bool Value) { ATSEntities db = new ATSEntities(); using (db) { var Answer = db.Answers.FirstOrDefault(x => x.AnswerId == AnswerId); Answer.IsRight = Value; db.Answers.Attach(Answer); db.Entry(Answer).State = EntityState.Modified; db.SaveChanges(); } return(RedirectToAction("Answers", "Recruiter", new { QuestionId = QuestionId })); }
public ActionResult AddJobs(int id = 0) { Job model = new Job(); if (id > 0) { ATSEntities db = new ATSEntities(); using (db) { model = db.Jobs.FirstOrDefault(x => x.JobId == id); } } model.RecId = LoginHelper.GetCurrentLoginUser().Id; return(View(model)); }
public ActionResult CareerPage() { var currentUser = LoginHelper.GetCurrentLoginUser(); ATSEntities db = new ATSEntities(); using (db) { var careerPageObj = db.CareerPages.FirstOrDefault(x => x.RecId == currentUser.Id); if (careerPageObj == null) { careerPageObj = new CareerPage(); careerPageObj.RecId = currentUser.Id; } careerPageObj.CreatedDate = DateTime.Now; return(View(careerPageObj)); } }
public ActionResult Campaigns(int JobId = 0) { ATSEntities db = new ATSEntities(); try { var currentUser = LoginHelper.GetCurrentLoginUser(); var Jobs = db.Jobs.Where(x => x.RecId == currentUser.Id).Select(x => new SelectListItem() { Text = x.JobName, Value = x.JobId.ToString() }).ToList(); ViewBag.Jobslist = Jobs; } catch (Exception ex) { string st = ex.Message; } return(View()); }
public ActionResult PostJob(int id = 0) { if (id > 0) { Job model = new Job(); ATSEntities db = new ATSEntities(); using (db) { model = db.Jobs.FirstOrDefault(x => x.JobId == id); model.IsPosted = true; model.UpdateDate = DateTime.Now; db.Jobs.Attach(model); db.Entry(model).State = EntityState.Modified; db.SaveChanges(); } } return(RedirectToAction("Jobs", "Recruiter")); }
public ActionResult Login(string UserName, string Password, bool IsRemember = false) { //Code 1 here Recruiter user = new Recruiter(); ATSEntities db = new ATSEntities(); user = db.Recruiters.FirstOrDefault(x => x.Password == Password && x.Username == UserName); if (user != null) { UserLoginData UserLogin = new UserLoginData() { Id = user.RecId, Password = user.Password, Username = user.Username, PlanId = user.UserPlanId }; var UserData = JsonConvert.SerializeObject(UserLogin); FormsAuthentication.SetAuthCookie(UserData, false); return(RedirectToAction("Jobs", "Recruiter")); } ViewBag.Error = "Login Incorrect"; return(RedirectToAction("Login", "Recruiter")); }
private string UpdateLocalEmployee(DataTable dataTable) { string result = ""; try { db = new ATSEntities(); var param = new SqlParameter("@DataTable", SqlDbType.Structured); param.Value = dataTable; param.TypeName = "LocalEmployee"; db.Database.ExecuteSqlCommand("EXEC USP_IMPORT_LOCALEMPLOYEE @DataTable", param); result = "success"; } catch (Exception ex) { result = "Could please choose excel file of employee local!"; } return(result); }
public ActionResult Applicants(Applicant model, int jobid) { ATSEntities DB = new ATSEntities(); Job job = new Job(); job.JobId = 1; using (DB) { if (job.JobId == 1) { DB.Applicants.Add(model); DB.SaveChanges(); } else { string st = "Enter the Jobid"; } return(View()); } }
public ActionResult SignUp(FormCollection fm, Recruiter Newrecruiter) { try { ATSEntities db = new ATSEntities(); using (db) { Newrecruiter.AdminId = 1; db.Recruiters.Add(Newrecruiter); db.SaveChanges(); } ModelState.Clear(); //return Content("Signup Confimed"); } catch (Exception ex) { string st = ex.Message; } return(RedirectToAction("Login", "Recruiter")); }
public ActionResult Questioner(Questionair Model) { Model.RecId = LoginHelper.GetCurrentLoginUser().Id; ATSEntities db = new ATSEntities(); using (db) { if (Model.QuestionairId > 0) { db.Questionairs.Attach(Model); db.Entry(Model).State = EntityState.Modified; db.SaveChanges(); } else { db.Questionairs.Add(Model); db.SaveChanges(); } } return(RedirectToAction("Questioner", "Recruiter")); }
public ActionResult AddAnswer(Answer Model) { ATSEntities db = new ATSEntities(); using (db) { if (Model.AnswerId > 0) { //Edit db.Answers.Attach(Model); db.Entry(Model).State = EntityState.Modified; db.SaveChanges(); } else { db.Answers.Add(Model); db.SaveChanges(); } } return(RedirectToAction("Answers", "Recruiter", new { QuestionId = Model.QuestionId })); }
public ActionResult AddQuestions(Question Model) { //Model.QuestionairId = 1; ATSEntities db = new ATSEntities(); using (db) { if (Model.QuestionId > 0) { db.Questions.Attach(Model); db.Entry(Model).State = EntityState.Modified; db.SaveChanges(); } else { db.Questions.Add(Model); db.SaveChanges(); } } return(RedirectToAction("Questions", "Recruiter", new { QuestionairId = Model.QuestionairId })); }
public ActionResult CareerPage(int Recruiter) { CareerPageViewModel Model = new CareerPageViewModel(); ATSEntities db = new ATSEntities(); try { using (db) { if (Recruiter > 0) { var RecruiterObj = db.Recruiters.FirstOrDefault(x => x.RecId == Recruiter); var CareerObj = db.CareerPages.FirstOrDefault(x => x.RecId == Recruiter); var JobsList = db.Jobs.Where(x => x.RecId == Recruiter && x.IsPosted == true /*&& x.IsActive==true*/).ToList(); if (RecruiterObj != null) { Model.RecruiterObj = RecruiterObj; } if (CareerObj != null) { Model.CareerPageObj = CareerObj; } if (JobsList != null) { Model.JobsList = JobsList; } } } } catch (Exception ex) { string st = ex.Message; } return(View(Model)); }
public ActionResult JobApplicationPage(int Recruiter, int Job) { JobApplicationPageViewModel Model = new JobApplicationPageViewModel(); try { ATSEntities db = new ATSEntities(); if (Recruiter > 0) { var CareerObj = db.CareerPages.FirstOrDefault(x => x.RecId == Recruiter); var RecruiterObj = db.Recruiters.FirstOrDefault(x => x.RecId == Recruiter); var JobObj = db.Jobs.FirstOrDefault(x => x.JobId == Job); if (RecruiterObj != null) { Model.RecruiterObj = RecruiterObj; } if (JobObj != null) { Model.JobObj = JobObj; } if (CareerObj != null) { Model.CareerPageObj = CareerObj; } } } catch (Exception ex) { string st = ex.Message; } return(View(Model)); }
public ActionResult Applicants(int JobId = 0) { ATSEntities DB = new ATSEntities(); using (DB) { //List of All Applicants // var Applicant = DB.Applicants.ToList(); //To Get Applicant List Filters List <Applicant> Applicants = new List <Applicant>(); if (JobId > 0) { Applicants = DB.Applicants.Where(x => x.JobId == JobId).ToList(); } else { Applicants = DB.Applicants.ToList(); } var currentUser = LoginHelper.GetCurrentLoginUser(); var JobList = DB.Jobs.Where(x => x.RecId == currentUser.Id).ToList(); ViewBag.JobList = JobList; //To get object //var ApplicantObj = DB.Applicants.Where(x => x.JobId == JobId);//Where 1 is job id //Code for saving or insert //DB.Jobs.Add(new Job()); //DB.SaveChanges(); //code for delete //DB.Jobs.Remove(ApplicantObj); //DB.SaveChanges(); return(View(Applicants)); } }
private string UpdateGlobalEmployee(DataTable dataTable) { try { db = new ATSEntities(); dataTable.Columns[0].ColumnName = "UserID"; dataTable.Columns[1].ColumnName = "EmpStatus"; dataTable.Columns[2].ColumnName = "EmpType"; dataTable.Columns[3].ColumnName = "JobLocation"; dataTable.Columns[4].ColumnName = "JobCode"; dataTable.Columns[5].ColumnName = "DomainID"; dataTable.Columns[7].ColumnName = "UserName"; dataTable.Columns[11].ColumnName = "State"; dataTable.Columns[12].ColumnName = "PostsalCode"; dataTable.Columns[15].ColumnName = "HireDate"; dataTable.Columns[17].ColumnName = "Email"; dataTable.Columns[18].ColumnName = "HasAccess"; dataTable.Columns[20].ColumnName = "RegionID"; dataTable.Columns[21].ColumnName = "RoleID"; dataTable.Columns[22].ColumnName = "ProfileStatus"; dataTable.Columns[23].ColumnName = "PositionID"; dataTable.Columns[24].ColumnName = "IsFullTime"; dataTable.Columns[25].ColumnName = "NativeDeeplinkUser"; dataTable.Columns[25].ColumnName = "GamificationUserID"; dataTable.Columns[25].ColumnName = "Regular"; var param = new SqlParameter("@DataTable", SqlDbType.Structured); param.Value = dataTable; param.TypeName = "GlobalEmployee"; db.Database.ExecuteSqlCommand("EXEC USP_IMPORT_GLOBALEMPLOYEE @DataTable", param); return("success"); } catch (Exception ex) { return("Please choose global employee file excel"); } }