public JsonResult checkStatusWorkInvitation(Guid userId, Guid offerId) { var workinvitation = new WorkInvitationDao().findWorkInvitation(userId, offerId); if (workinvitation != null) { var user = new UserDao().FindById(userId); var offer = new OfferJobDao().findById(offerId); return(Json(new { having = true, User = user.UserName, WorkInvitation = workinvitation.WorkInvitationID, Offer = offer.OfferName, StartDay = workinvitation.StartDay, Salary = workinvitation.Salary, Address = workinvitation.Address, Note = workinvitation.Note, Status = workinvitation.Status }));; } return(Json(new { having = false })); }
public ActionResult ReturnOffer(Guid offerID) { var jbDao = new JobMajorDao(); var offer = new OfferJobDao().FindByID(offerID); var listSkill = new OfferJobSkillDao().ListByOffer(offerID); var listNameSkill = new List <string>(); foreach (var item in listSkill) { listNameSkill.Add(jbDao.NameJob(item.ChildMajor)); } if (offer == null) { return(Json(new { status = false })); } return(Json(new { offer = offer, limitDate = offer.OfferLimitDate.ToString("dd/MM/yyyy"), listSkill = listSkill, listNameSkill = listNameSkill, majorName = jbDao.NameJob(offer.OfferMajor), status = true })); }
public JsonResult checkStatusInterview(Guid userId, Guid offerId) { var interview = new InterviewDao().findInterview(userId, offerId); if (interview != null) { var user = new UserDao().FindById(userId); var employee = new EmployeeDao().FindById(interview.EmployeeID); var offer = new OfferJobDao().findById(offerId); return(Json(new { having = true, User = user.UserName, InterviewID = interview.InterviewID, Offer = offer.OfferName, Time = interview.Time, Date = interview.Date, Status = interview.Status, Employee = employee.EmployeeName, Address = interview.Address, Note = interview.Note }));; } return(Json(new { having = false })); }
public JsonResult DeleteOffer(Guid offerID) { var check = new OfferJobDao().DeleteOffer(offerID); if (!check) { return(Json(new { status = false })); } var offerJobSkill = new OfferJobSkillDao(); var listOfferSkill = offerJobSkill.ListByOffer(offerID); foreach (var item in listOfferSkill) { var checkSecond = offerJobSkill.DeleteSkill(offerID, item.ChildMajor); if (!checkSecond) { return(Json(new { status = false })); } } return(Json(new { status = true })); }
public ActionResult SearchJobForUser(string OfferName = "", int Area = 0, int OfferMajor = 0, int OfferSalary = 0, int PositionJobID = 0, string Sex = "0", int ExperienceRequest = 0, int LearningLevelRequest = 0, string OfferCreateDate = "") { ViewBag.ListJobMain = new JobMajorDao().ListJobMain(); ViewBag.ListArea = new AreaDao().ListArea(); ViewBag.ListExperience = new ExperienceDao().ListExperiences(); ViewBag.ListSalary = new SalaryDao().ListSalary(); ViewBag.ListPositionEmployee = new PositionEmployeeDao().ReturnList(); ViewBag.ListLevelLearning = new LevelLearningDao().ReturnList(); var ListJobContainer = new OfferJobDao().ReturnFilterList(OfferName, Area, OfferMajor, OfferSalary, PositionJobID, Sex, ExperienceRequest, LearningLevelRequest); return(View(ListJobContainer)); }
public ActionResult ListAndCreateOffer(int page = 1) { if (!User.Identity.IsAuthenticated) { return(RedirectToAction("Index", "Account")); } var accID = int.Parse(User.Identity.Name); var acc = new AccountDao().FindAccountById(accID); var listOffer = new OfferJobDao().ListByEmployee(acc.UserId); ViewBag.ListMajor = new JobMajorDao().ListJobMain(); ViewBag.ListSkill = new JobMajorDao().ListJobSub(); ViewBag.ListArea = new AreaDao().ListArea(); ViewBag.ListPosition = new PositionEmployeeDao().ReturnList(); ViewBag.ListSalary = new SalaryDao().ListSalary(); ViewBag.ListLearning = new LevelLearningDao().ReturnList(); ViewBag.ListExperience = new ExperienceDao().ListExperiences(); return(View(listOffer)); }
public ActionResult ResultForSearchJob(Guid OfferID) { ViewBag.ListEnterpriseName = new EnterpriseDao().ReturnList(); ViewBag.ListJobMain = new EnterpriseJobDao().ListEnterpriseJob(); ViewBag.ListArea = new AreaDao().ListArea(); ViewBag.ListOfferJob = new OfferJobDao().ReturnFilterList(); var jobMajorDao = new JobMajorDao(); var saveName = ""; var ShowDetail = new OfferJobDao().ShowDetail(OfferID); foreach (var item in ShowDetail) { for (var i = 0; i < item.listJobId.Count; i += 1) { saveName += jobMajorDao.NameJob(item.listJobId[i]) + ", "; } saveName.Remove(saveName.Length - 1); } ViewBag.ListFullJobName = saveName; return(View(ShowDetail)); }
public ActionResult AddOfferOfEmployee(FormOffer model) { if (!User.Identity.IsAuthenticated) { return(RedirectToAction("Index", "Account")); } var accID = int.Parse(User.Identity.Name); var acc = new AccountDao().FindAccountById(accID); var emp = new EmployeeDao().FindById(acc.UserId); var offerJob = new OfferJob(); if (model.typeAction == "add") { offerJob.OfferID = Guid.NewGuid(); offerJob.OfferCreateDate = DateTime.Now; offerJob.Views = 0; offerJob.Applications = 0; } else { offerJob.OfferID = model.saveID; } offerJob.EmployeeID = acc.UserId; offerJob.EnterpriseID = emp.EnterpriseID; offerJob.OfferName = model.offerName; if (model.offerDescription != null && model.offerDescription != "") { offerJob.OfferDescription = model.offerDescription; } offerJob.OfferMajor = model.offerMajor; offerJob.OfferPosition = model.offerPosition; offerJob.OfferSalary = model.offerSalary; offerJob.Area = model.offerArea; offerJob.Amount = model.offerAmount; offerJob.ExperienceRequest = model.offerExperience; offerJob.ContactEmail = model.offerEmail; offerJob.LearningLevelRequest = model.offerLearning; offerJob.OfferLimitDate = DateTime.ParseExact(model.offerLimitDate, "dd/MM/yyyy", CultureInfo.InvariantCulture); if (model.offerGender != "none") { offerJob.Sex = model.offerGender; } offerJob.JobAddress = model.offerAddress; var file = model.offerImage; if (file != null) { var fileName = Path.GetFileName(file.FileName); file.SaveAs(Server.MapPath("/Assets/Client/Img/Offer/" + fileName)); var srcImage = "/Assets/Client/Img/Offer/" + fileName; offerJob.OfferImage = srcImage; } if (model.typeAction == "add") { var check = new OfferJobDao().Insert(offerJob); } else { var check = new OfferJobDao().Edit(offerJob); } if (model.offerListSkillId != null && model.offerListSkillId.Count > 0) { for (var i = 0; i < model.offerListSkillId.Count; i++) { var offerSkill = new OfferJobSkill(); offerSkill.OfferID = offerJob.OfferID; offerSkill.ParentMajor = model.offerListSkillParent[i]; offerSkill.ChildMajor = model.offerListSkillId[i]; var checkFalse = new OfferJobSkillDao().Insert(offerSkill); if (!checkFalse) { break; } } } return(RedirectToAction("ListAndCreateOffer", "Employee")); }