public ActionResult Create() { RequisitionOrganization requisitionorganization = new RequisitionOrganization(); ViewBag.PossibleRequisitions = requisitionRepository.All; ViewBag.PossibleOrganizations = organizationRepository.All; ViewBag.PossibleOrganizationProjects = organizationprojectRepository.All; ViewBag.PossibleOrganizationDepartments = organizationdepartmentRepository.All; ViewBag.PossibleOrganizationPositions = organizationpositionRepository.All; return View(requisitionorganization); }
public ActionResult Create(RequisitionOrganization requisitionorganization) { if (ModelState.IsValid) { requisitionorganizationRepository.InsertOrUpdate(requisitionorganization); requisitionorganizationRepository.Save(); return RedirectToAction("Index"); } else { ViewBag.PossibleRequisitions = requisitionRepository.All; ViewBag.PossibleOrganizations = organizationRepository.All; ViewBag.PossibleOrganizationProjects = organizationprojectRepository.All; ViewBag.PossibleOrganizationDepartments = organizationdepartmentRepository.All; ViewBag.PossibleOrganizationPositions = organizationpositionRepository.All; return View(requisitionorganization); } }
public void InsertOrUpdate(RequisitionOrganization requisitionorganization) { if (requisitionorganization.RequisitionOrganizationID == default(int)) { // New entity context.RequisitionOrganization.Add(requisitionorganization); } else { // Existing entity context.Entry(requisitionorganization).State = EntityState.Modified; } }
public ViewResult Search(RequisitionOrganization searchRequisitionOrganization) { if(searchRequisitionOrganization!=null) { } return View("Index",requisitionorganizationRepository.AllIncluding(requisitionorganization => requisitionorganization.Requisition, requisitionorganization => requisitionorganization.Organization, requisitionorganization => requisitionorganization.OrganizationProject, requisitionorganization => requisitionorganization.OrganizationDepartment, requisitionorganization => requisitionorganization.OrganizationPosition)); }