public ActionResult Edit(int id, int pid) { ViewData["MemberTypes"] = CodeValueModel.ConvertToSelect(CodeValueModel.MemberTypeCodes(), "Id"); var om = DbUtil.Db.OrganizationMembers.Single(m => m.PeopleId == pid && m.OrganizationId == id); return(View(om)); }
public void Should_be_able_to_get_MemberTypeCodes() { ContextTestUtils.CreateMockHttpContext(); var b = CodeValueModel.MemberTypeCodes(); b.Count().ShouldBe(16); }
public ActionResult Update(OrgMemberModel m) { try { m.UpdateModel(); } catch (Exception) { ViewData["MemberTypes"] = CodeValueModel.ConvertToSelect(CodeValueModel.MemberTypeCodes(), "Id"); return(View("Edit", m)); } return(View("Display", m)); }
public ActionResult Update(int id, int pid) { var om = DbUtil.Db.OrganizationMembers.Single(m => m.PeopleId == pid && m.OrganizationId == id); try { UpdateModel(om); om.ShirtSize = om.ShirtSize.MaxString(20); DbUtil.Db.SubmitChanges(); } catch (Exception) { ViewData["MemberTypes"] = CodeValueModel.ConvertToSelect(CodeValueModel.MemberTypeCodes(), "Id"); return(View("Edit", om)); } return(View("Display", om)); }
public void Should_be_able_to_get_MemberTypeCodes() { var b = CodeValueModel.MemberTypeCodes(); b.Count().ShouldBe(16); }