示例#1
0
 public ActionResult Create()
 {
     Requisition requisition = new Requisition();
     ViewBag.PossibleCreatedByUsers = userRepository.All;
     ViewBag.PossibleRequisitionJDLibraryCategories = requisitionjdlibrarycategoryRepository.All;
     ViewBag.PossibleEmploymentTypes = employmenttypeRepository.All;
     ViewBag.PossibleExperienceLevelCategories = experiencelevelcategoryRepository.All;
     ViewBag.PossibleCurrencies = currencyRepository.All;
     ViewBag.PossibleSalaryRateTypes = salaryratetypeRepository.All;
     ViewBag.PossibleCountries = countryRepository.All;
     ViewBag.PossibleStates = stateRepository.All;
     ViewBag.PossibleRequisitionStatusCategories = requisitionstatuscategoryRepository.All;
     return View(requisition);
 }
示例#2
0
 public ActionResult Create(Requisition requisition)
 {
     if (ModelState.IsValid) {
         requisitionRepository.InsertOrUpdate(requisition);
         requisitionRepository.Save();
         return RedirectToAction("Index");
     } else {
         ViewBag.PossibleCreatedByUsers = userRepository.All;
         ViewBag.PossibleRequisitionJDLibraryCategories = requisitionjdlibrarycategoryRepository.All;
         ViewBag.PossibleEmploymentTypes = employmenttypeRepository.All;
         ViewBag.PossibleExperienceLevelCategories = experiencelevelcategoryRepository.All;
         ViewBag.PossibleCurrencies = currencyRepository.All;
         ViewBag.PossibleSalaryRateTypes = salaryratetypeRepository.All;
         ViewBag.PossibleCountries = countryRepository.All;
         ViewBag.PossibleStates = stateRepository.All;
         ViewBag.PossibleRequisitionStatusCategories = requisitionstatuscategoryRepository.All;
         return View(requisition);
     }
 }
示例#3
0
 public void InsertOrUpdate(Requisition requisition)
 {
     if (requisition.RequisitionID == default(int)) {
         // New entity
         context.Requisition.Add(requisition);
     } else {
         // Existing entity
         context.Entry(requisition).State = EntityState.Modified;
     }
 }
示例#4
0
 public ViewResult Search(Requisition searchRequisition)
 {
     if(searchRequisition!=null)
     {
                     ViewData["RequisitionDisplayId"]=searchRequisition.RequisitionDisplayId;
                     ViewData["JobTitle"]=searchRequisition.JobTitle;
                     ViewData["NumberOfOpenings"]=searchRequisition.NumberOfOpenings;
                     ViewData["EmploymentTypeID"]=searchRequisition.EmploymentTypeID;
                     ViewData["ExperienceLevelCategoryID"]=searchRequisition.ExperienceLevelCategoryID;
                     ViewData["HireByDate"]=searchRequisition.HireByDate;
                     ViewData["CountryID"]=searchRequisition.CountryID;
                     ViewData["StateID"]=searchRequisition.StateID;
                     ViewData["City"]=searchRequisition.City;
                     ViewData["ZipCode"]=searchRequisition.ZipCode;
                     ViewData["RequisitionStatusCategoryID"]=searchRequisition.RequisitionStatusCategoryID;
                     }
                 ViewBag.PossibleEmploymentTypes = employmenttypeRepository.All;
                 ViewBag.PossibleExperienceLevelCategories = experiencelevelcategoryRepository.All;
                 ViewBag.PossibleCountries = countryRepository.All;
                 ViewBag.PossibleStates = stateRepository.All;
                 ViewBag.PossibleRequisitionStatusCategories = requisitionstatuscategoryRepository.All;
                 return View("Index",requisitionRepository.AllIncluding(requisition => requisition.CreatedByUser, requisition => requisition.RequisitionJDLibraryCategory, requisition => requisition.EmploymentType, requisition => requisition.ExperienceLevelCategory, requisition => requisition.Currency, requisition => requisition.SalaryRateType, requisition => requisition.Country, requisition => requisition.State, requisition => requisition.RequisitionStatusCategory));
 }