public ActionResult Create(int organizationId)
 {
     OrganizationPosition organizationposition = new OrganizationPosition();
     organizationposition.OrganizationID = organizationId;
     ViewBag.PossibleOrganizationBusinessDivisions = organizationbusinessdivisionRepository.All;
     ViewBag.PossibleOrganizationDepartments = organizationdepartmentRepository.All;
     return View(organizationposition);
 }
 public ActionResult Create(OrganizationPosition organizationposition,int organizationId)
 {
     if (ModelState.IsValid) {
         organizationpositionRepository.InsertOrUpdate(organizationposition);
         organizationpositionRepository.Save();
         return RedirectToAction("Index",new { organizationId=organizationId });
     } else {
         ViewBag.PossibleOrganizationBusinessDivisions = organizationbusinessdivisionRepository.All;
         ViewBag.PossibleOrganizationDepartments = organizationdepartmentRepository.All;
         return View(organizationposition);
     }
 }
 public void InsertOrUpdate(OrganizationPosition organizationposition)
 {
     if (organizationposition.OrganizationPositionID == default(int)) {
         // New entity
         context.OrganizationPosition.Add(organizationposition);
     } else {
         // Existing entity
         context.Entry(organizationposition).State = EntityState.Modified;
     }
 }
 public ViewResult Search(OrganizationPosition searchOrganizationPosition,int organizationId)
 {
     if(searchOrganizationPosition!=null)
     {
                     }
                 return View("Index",organizationpositionRepository.AllIncluding(organizationId,organizationposition => organizationposition.Organization, organizationposition => organizationposition.OrganizationBusinessDivision, organizationposition => organizationposition.OrganizationDepartment));
 }