Example #1
0
        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));
        }
Example #2
0
        public void Should_be_able_to_get_MemberTypeCodes()
        {
            ContextTestUtils.CreateMockHttpContext();
            var b = CodeValueModel.MemberTypeCodes();

            b.Count().ShouldBe(16);
        }
Example #3
0
 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));
 }
Example #4
0
        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));
        }
Example #5
0
        public void Should_be_able_to_get_MemberTypeCodes()
        {
            var b = CodeValueModel.MemberTypeCodes();

            b.Count().ShouldBe(16);
        }