public ActionResult Edit(Guid?ID) { Person CU; if (ID == null) { CU = new Person { Country = Country.DK, Memberships = new List <NRMembership>(), Causes = new List <CausePartisipant>() }; } else { CU = reposetory.GetPersonComplete((Guid)ID); if (CU == null) { return(RedirectToAction("Index")); } } List <AssociationListModel> tmp = reposetory.GetAssociationList(); //.RemoveAll(item => CU.Memberships.ToList().Exists(p => p.Association.AssociationID == item.AssociationID)); ViewBag.Attach = new SelectList(tmp, "AssociationID", "Name"); return(View(CU)); }
public ActionResult Edit(Guid?ID) { Lead lead; if (ID == null) { lead = new Lead(); } else { lead = reposetory.GetLead((Guid)ID); if (lead == null) { return(RedirectToAction("Index")); } } List <AssociationListModel> tmp = reposetory.GetAssociationList(); ViewBag.Attach = new SelectList(tmp, "AssociationID", "Name"); return(View(lead)); }