Example #1
0
 public void UpdateMember(Member member)
 {
     using (var context = new IWNContext())
     {
         context.Members.Attach(member);
         context.Entry(member).State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }
Example #2
0
 public void SavePayment(Payment payment)
 {
     if (payment.TransactionId == 0)
     {
         AddPayment(payment);
     }
     using (IWNContext context = new IWNContext())
     {
         context.Payments.Attach(payment);
         context.Entry(payment).State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }
Example #3
0
        public void DeleteMembers(int memberId)
        {
            using (var context = new IWNContext())
            {
                var memberToDelete = context.Members.First(member => member.MemberId == memberId);
                if (memberToDelete == null)
                {
                    return;
                }

                memberToDelete.State = State.Deleted;
                context.Entry(memberToDelete).State = System.Data.Entity.EntityState.Modified;


                context.SaveChanges();
            }
        }