예제 #1
0
        public Demographic()
        {
            Member = new Member();
            HomeContact = new Contact();

            StateList = new List<SelectListItem>();
        }
        public void Save(Member member)
        {
            if(member.MemberID!=0)
                Members.Remove(Members.Where(m => m.MemberID == member.MemberID).Single());

            Members.Add(member);
        }
 public void Save(Member member)
 {
     if (member.MemberID == 0)
     {
         TheDemoDBContext.Members.Add(member);
     }
     else
     {
         TheDemoDBContext.Members.Attach(member);
         TheDemoDBContext.Entry(member).State = System.Data.Entity.EntityState.Modified;
     }
 }