Beispiel #1
0
 public ActionResult Create(Applicant applicant)
 {
     if (ModelState.IsValid)
     {
         if (Session["WordResume"] != null)
         {
             var fileName = Session["WordResume"].ToString();
             var physicalPath = Path.Combine(Server.MapPath(Constants.Paths.TemporaryFileUploadPath), fileName);
             applicant.WordResume = Utility.ReadFile(physicalPath);
         }
         if (Session["Photo"] != null)
         {
             var fileName = Session["Photo"].ToString();
             var physicalPath = Path.Combine(Server.MapPath(Constants.Paths.TemporaryFileUploadPath), fileName);
             applicant.Photo = Utility.ReadFile(physicalPath);
         }
         applicant.LastUpdateDate = DateTime.Now;
         applicantRepository.InsertOrUpdate(applicant);
         applicantRepository.Save();
         return RedirectToAction("Index");
     }
     else
     {
         ViewBag.PossibleContactProfessionTypes = contactprofessiontypeRepository.All;
         ViewBag.PossibleExperienceLevelCategories = experiencelevelcategoryRepository.All;
         ViewBag.PossibleCountries = countryRepository.All;
         ViewBag.PossibleNationalities = ViewBag.PossibleCountries;
         ViewBag.PossibleApplicantAvailabilityStatusCategories = applicantavailabilitystatuscategoryRepository.All;
         ViewBag.PossibleApplicantSourceCategories = applicantsourcecategoryRepository.All;
         return View(applicant);
     }
 }
Beispiel #2
0
 public ActionResult Create()
 {
     Applicant applicant = new Applicant();
     ViewBag.PossibleContactProfessionTypes = contactprofessiontypeRepository.All;
     ViewBag.PossibleExperienceLevelCategories = experiencelevelcategoryRepository.All;
     ViewBag.PossibleCountries = countryRepository.All;
     ViewBag.PossibleNationalities = ViewBag.PossibleCountries;
     ViewBag.PossibleApplicantAvailabilityStatusCategories = applicantavailabilitystatuscategoryRepository.All;
     ViewBag.PossibleApplicantSourceCategories = applicantsourcecategoryRepository.All;
     applicant.CreatedDate = DateTime.Now;
     applicant.CreatedByUserID = CurrentLoggedInUser.UserID;
     return View(applicant);
 }
Beispiel #3
0
 public ViewResult Search(Applicant searchApplicant)
 {
     if (searchApplicant != null)
     {
         ViewData["ApplicantDisplayId"] = searchApplicant.ApplicantDisplayId;
         ViewData["FirstName"] = searchApplicant.FirstName;
         ViewData["LastName"] = searchApplicant.LastName;
         ViewData["ContactProfessionTypeID"] = searchApplicant.ContactProfessionTypeID;
         ViewData["ExperienceLevelCategoryID"] = searchApplicant.ExperienceLevelCategoryID;
         ViewData["ProfessionalSummary"] = searchApplicant.ProfessionalSummary;
         ViewData["City"] = searchApplicant.City;
         ViewData["CountryID"] = searchApplicant.CountryID;
         ViewData["StateID"] = searchApplicant.StateID;
         if (searchApplicant.ApplicantAvailabilityStatusCategoryID > 0)
         {
             ViewData["ApplicantAvailabilityStatusCategoryID"] = searchApplicant.ApplicantAvailabilityStatusCategoryID;
         }
         if (searchApplicant.ApplicantSourceCategoryID > 0)
         {
             ViewData["ApplicantSourceCategoryID"] = searchApplicant.ApplicantSourceCategoryID;
         }
     }
     ViewBag.PossibleContactProfessionTypes = contactprofessiontypeRepository.All;
     ViewBag.PossibleExperienceLevelCategories = experiencelevelcategoryRepository.All;
     ViewBag.PossibleCountries = countryRepository.All;
     ViewBag.PossibleNationalities = ViewBag.PossibleCountries;
     ViewBag.PossibleApplicantAvailabilityStatusCategories = applicantavailabilitystatuscategoryRepository.All;
     ViewBag.PossibleApplicantSourceCategories = applicantsourcecategoryRepository.All;
     ModelState.Clear();
     return View("Index", applicantRepository.AllIncluding(applicant => applicant.ContactProfessionType, applicant => applicant.ExperienceLevelCategory, applicant => applicant.Country, applicant => applicant.State, applicant => applicant.Nationality, applicant => applicant.ApplicantAvailabilityStatusCategory, applicant => applicant.ApplicantSourceCategory, applicant => applicant.CreatedByUser, applicant => applicant.VerifiedByUser));
 }
Beispiel #4
0
 public ActionResult Edit(Applicant applicant)
 {
     if (ModelState.IsValid)
     {
         if (Session["WordResume"] != null)
         {
             var fileName = Session["WordResume"].ToString();
             var physicalPath = Path.Combine(Server.MapPath(Constants.Paths.TemporaryFileUploadPath), fileName);
             applicant.WordResume = Utility.ReadFile(physicalPath);
         }
         if (Session["Photo"] != null)
         {
             var fileName = Session["Photo"].ToString();
             var physicalPath = Path.Combine(Server.MapPath(Constants.Paths.TemporaryFileUploadPath), fileName);
             applicant.Photo = Utility.ReadFile(physicalPath);
         }
         applicant.LastUpdateDate = DateTime.Now;
         if (applicant.ApplicantDisplayId.IsNullOrEmpty())
         {
             applicant.ApplicantDisplayId = MiscUtility.GetApplicantPersonalizedId();
         }
         applicantRepository.InsertOrUpdate(applicant);
         applicantRepository.Save();
         return RedirectToAction("Overview", new { id = applicant.ApplicantID });
     }
     else
     {
         ViewBag.PossibleContactProfessionTypes = contactprofessiontypeRepository.All;
         ViewBag.PossibleExperienceLevelCategories = experiencelevelcategoryRepository.All;
         ViewBag.PossibleCountries = countryRepository.All;
         if (applicant.CountryID.HasValue)
         {
             ViewBag.PossibleStates = stateRepository.FindAllByCountryID(applicant.CountryID.Value);
         }
         ViewBag.PossibleNationalities = ViewBag.PossibleCountries;
         ViewBag.PossibleApplicantAvailabilityStatusCategories = applicantavailabilitystatuscategoryRepository.All;
         ViewBag.PossibleApplicantSourceCategories = applicantsourcecategoryRepository.All;
         return View(applicant);
     }
 }
Beispiel #5
0
 public ApplicantViewModel()
 {
     Applicant = new Applicant();
 }
Beispiel #6
0
 public void InsertOrUpdate(Applicant applicant)
 {
     if (applicant.ApplicantID == default(int)) {
         // New entity
         context.Applicant.Add(applicant);
     } else {
         // Existing entity
         context.Entry(applicant).State = EntityState.Modified;
     }
 }