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); }
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); } }
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; } }
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)); }