public void InsertMember(Member Member) { string sql = @"INSERT INTO [Member] (Email, CompanyName, City, Country) VALUES (@Email, @CompanyName, @City, @Country)"; Member.MemberId = db.Insert(sql, Take(Member)); }
public void UpdateMember(Member Member) { string sql = @"UPDATE [Member] SET Email = @Email, CompanyName = @CompanyName, City = @City, Country = @Country WHERE MemberId = @MemberId"; db.Update(sql, Take(Member)); }
public void UpdateMember(Member member) { memberDao.UpdateMember(member); }
public void InsertMember(Member member) { memberDao.InsertMember(member); }
public void DeleteMember(Member member) { memberDao.DeleteMember(member); }
public void InsertMember(Member member) { using (var context = new actionEntities()) { var entity = Mapper.Map<Member, MemberEntity>(member); context.MemberEntities.Add(entity); context.SaveChanges(); // update business object with new id member.MemberId = entity.MemberId; } }
public void DeleteMember(Member member) { using (var context = new actionEntities()) { var entity = context.MemberEntities.SingleOrDefault(m => m.MemberId == member.MemberId); context.MemberEntities.Remove(entity); context.SaveChanges(); } }
public void UpdateMember(Member member) { using (var context = new actionEntities()) { var entity = context.MemberEntities.SingleOrDefault(m => m.MemberId == member.MemberId); entity.Email = member.Email; entity.CompanyName = member.CompanyName; entity.Country = member.Country; entity.City = member.City; //context.Members.Attach(entity); context.SaveChanges(); } }
public void DeleteMember(Member Member) { string sql = @"DELETE FROM [Member] WHERE MemberId = @MemberId"; db.Update(sql, Take(Member)); }
// creates query parameters list from Member object object[] Take(Member Member) { return new object[] { "@MemberId", Member.MemberId, "@Email", Member.Email, "@CompanyName", Member.CompanyName, "@City", Member.City, "@Country", Member.Country }; }
public static bool UpdateMember(Member oMember) { return(EntityManager.UpdateObject <Member>("UpdateMember", oMember)); }
public static bool InsertMember(Member oMember) { return(EntityManager.InsertObject <Member>("InsertMember", oMember)); }