Beispiel #1
0
        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));
            
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
 public void UpdateMember(Member member)
 {
     memberDao.UpdateMember(member);
 }
Beispiel #4
0
 public void InsertMember(Member member)
 {
     memberDao.InsertMember(member);
 }
Beispiel #5
0
 public void DeleteMember(Member member)
 {
     memberDao.DeleteMember(member);
 }
Beispiel #6
0
        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;
            }
            
        }
Beispiel #7
0
 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();
     }
 }
Beispiel #8
0
        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();
             
            }
        }
Beispiel #9
0
        public void DeleteMember(Member Member)
        {
            string sql =
            @"DELETE FROM [Member]
               WHERE MemberId = @MemberId";

            db.Update(sql, Take(Member));
        }
Beispiel #10
0
        // 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
            };
        }
Beispiel #11
0
 public static bool UpdateMember(Member oMember)
 {
     return(EntityManager.UpdateObject <Member>("UpdateMember", oMember));
 }
Beispiel #12
0
 public static bool InsertMember(Member oMember)
 {
     return(EntityManager.InsertObject <Member>("InsertMember", oMember));
 }