public ActionResult Edit(string currentNode) { SA_Organization currentOrg = JSON.Deserialize <SA_Organization>(currentNode); OrganizationType orgType = EnumExtension <OrganizationType> .Parse(currentOrg.OrgType); switch (orgType) { case OrganizationType.Company: return(new PartialViewResult { ViewName = "EditCompany", Model = _service.GetOrgById(currentOrg.Id) }); case OrganizationType.Department: return(new PartialViewResult { ViewName = "EditDepartment", Model = _service.GetOrgById(currentOrg.Id) }); case OrganizationType.Position: return(new PartialViewResult { ViewName = "EditPosition", Model = _service.GetOrgById(currentOrg.Id) }); case OrganizationType.Staff: return(new PartialViewResult { ViewName = "EditStaff", Model = _service.GetUserByOrgId(currentOrg.Id) }); default: throw new NotImplementedException(); } }