//add a payer or payee to the database public bool AddPayerPayee(PayerPayee obj) { using (var context = new FinanceEDMContainer()) { //obj.UserDetailsUserId = Session.SessionID; obj.UserDetailsUserId = 1; context.PayerPayees.Add(obj); context.SaveChanges(); } return(true); }
//update a payer or payee based on the id public bool UpdatePayerPayee(PayerPayee obj) { using (var context = new FinanceEDMContainer()) { var record = context.PayerPayees.SingleOrDefault(e => e.PPId == obj.PPId); record.Name = obj.Name; record.Address = obj.Address; record.DOB = obj.DOB; record.Email = obj.Email; //obj.UserDetailsUserId = Session.SessionID; record.UserDetailsUserId = 1; context.SaveChanges(); } return(true); }