Пример #1
0
        public void DeleteUserOrganizationMapping(int memberId, int organizationId)
        {
            using (var context = new InThuDoEntities())
            {
                UserOrganizationMappping userOrganizationMap = context.UserOrganizationMapppings.Where(uo => uo.UserId == memberId && uo.OrganizationId == organizationId).FirstOrDefault();
                if (userOrganizationMap == null)
                {
                    return;
                }

                context.UserOrganizationMapppings.Remove(userOrganizationMap);
                context.SaveChanges();
            }
        }
Пример #2
0
        public void InsertUserOrganizationMapping(int memberId, int organizationId)
        {
            using (var context = new InThuDoEntities())
            {
                UserOrganizationMappping userOrganization = new UserOrganizationMappping()
                {
                    OrganizationId = organizationId,
                    UserId         = memberId,
                };

                context.UserOrganizationMapppings.Add(userOrganization);
                context.SaveChanges();
            }
        }
Пример #3
0
        public void InsertUserOrganizationMapping(int memberId, int organizationId)
        {
            using (var context = new InThuDoEntities())
            {
                UserOrganizationMappping userOrganization = new UserOrganizationMappping()
                {
                    OrganizationId = organizationId,
                    UserId = memberId,
                };

                context.UserOrganizationMapppings.Add(userOrganization);
                context.SaveChanges();
            }
        }