public ActionResult PersonFind(int id, OnlineRegModel m) { m.HistoryAdd("PersonFind id=" + id); if (id >= m.List.Count) { return(FlowList(m, "PersonFind")); } DbUtil.Db.SetNoLock(); var p = m.List[id]; if (p.IsValidForNew) { return(ErrorResult(m, new Exception("Unexpected onlinereg state: IsValidForNew is true and in PersonFind"), "PersonFind, unexpected state")); } if (p.classid.HasValue) { m.Orgid = p.classid; m.classid = p.classid; p.orgid = p.classid; } p.PeopleId = null; OnlineRegPersonModelValidator.ValidateModelForFind(p, ModelState, m, id); if (p.Found == true && m.org != null) { var setting = settings[m.org.OrganizationId]; if (setting.AllowReRegister) { var om = m.org.OrganizationMembers.SingleOrDefault(mm => mm.PeopleId == p.PeopleId); if (om != null) { m.ConfirmReregister(); DbUtil.Db.SubmitChanges(); return(View("ConfirmReregister", m)); } } } if (p.ManageSubscriptions() || p.OnlinePledge() || p.ManageGiving() || m.ChoosingSlots()) { p.OtherOK = true; } else if (p.org != null) { p.IsFilled = p.org.RegLimitCount(DbUtil.Db) >= p.org.Limit; if (p.IsFilled) { ModelState.AddModelError(m.GetNameFor(mm => mm.List[id].DateOfBirth), "Sorry, but registration is closed."); } if (p.Found == true) { p.FillPriorInfo(); } } if (p.org != null && p.ShowDisplay() && p.ComputesOrganizationByAge()) { p.classid = p.org.OrganizationId; } p.CheckSetFee(); return(FlowList(m, "PersonFind")); }