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

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