Example #1
0
 public void UpdateMembershiptype(MembershipTypeModel membershipTypeModel)
 {
     Models.DBObjects.MembershipType exisitngmembershipType = dbContext.MembershipTypes.FirstOrDefault(x => x.IDMembershipType == membershipTypeModel.IDMembershipType);
     if (exisitngmembershipType != null)
     {
         exisitngmembershipType.UpdateObject(membershipTypeModel);
         dbContext.SubmitChanges();
     }
 }
Example #2
0
 public void DeleteMembershipType(Guid ID)
 {
     Models.DBObjects.MembershipType membershipTypeToDelete = clubmembershipDataContext.MembershipTypes.FirstOrDefault
                                                                  (x => x.IDMembershipType == ID);
     if (membershipTypeToDelete != null)
     {
         clubmembershipDataContext.MembershipTypes.DeleteOnSubmit(membershipTypeToDelete);
         clubmembershipDataContext.SubmitChanges();
     }
 }
Example #3
0
        public void DeleteMembershipType(Guid ID)
        {
            Models.DBObjects.MembershipType membershipTypeToDelete = dbContext.MembershipTypes.FirstOrDefault(x => x.IDMembershipType == ID);

            if (membershipTypeToDelete != null)
            {
                dbContext.Memberships.DeleteAllOnSubmit <Models.DBObjects.Membership>(membershipTypeToDelete.Memberships);
                dbContext.MembershipTypes.DeleteOnSubmit(membershipTypeToDelete);
                dbContext.SubmitChanges();
            }
        }
Example #4
0
        public MembershipTypeModel GetMembershipTypeByID(Guid ID)
        {
            Models.DBObjects.MembershipType existingMember = dbContext.MembershipTypes.FirstOrDefault(x => x.IDMembershipType == ID);

            if (existingMember != null)
            {
                return(existingMember.MapObject <MembershipTypeModel>());
            }
            else
            {
                return(null);
            }
        }
Example #5
0
        public void UpdateMembershipType(MembershipTypeModel membershipTypeModel)
        {
            Models.DBObjects.MembershipType existingAnnouncement = clubmembershipDataContext.MembershipTypes.FirstOrDefault
                                                                       (x => x.IDMembershipType == membershipTypeModel.IDMembershipType);
            if (existingAnnouncement != null)
            {
                existingAnnouncement.IDMembershipType           = membershipTypeModel.IDMembershipType;
                existingAnnouncement.Name                       = membershipTypeModel.Name;
                existingAnnouncement.Description                = membershipTypeModel.Description;
                existingAnnouncement.SubscriptionLengthInMonths = membershipTypeModel.SubscriptionLengthInMonths;

                clubmembershipDataContext.SubmitChanges();
            }
        }