示例#1
0
        /// <summary>
        /// 保存群组信息
        /// </summary>
        /// <param name="keyValue"></param>
        /// <param name="entity"></param>
        public void Save(string keyValue, IMGroupEntity entity, List <string> userIdList)
        {
            if (!string.IsNullOrEmpty(keyValue))
            {
                entity.Modify(keyValue);
                this.BaseRepository().Update <IMGroupEntity>(entity);
            }
            else
            {
                IDatabase db = DbFactory.Base().BeginTrans();
                try
                {
                    entity.Create();
                    db.Insert <IMGroupEntity>(entity);

                    foreach (string userOne in userIdList)
                    {
                        IMUserGroupEntity msgusergroupentity = new IMUserGroupEntity();
                        msgusergroupentity.GroupId        = entity.GroupId;
                        msgusergroupentity.UserId         = userOne;
                        msgusergroupentity.CreateUserId   = entity.CreateUserId;
                        msgusergroupentity.CreateUserName = entity.CreateUserName;
                        db.Insert <IMUserGroupEntity>(msgusergroupentity);
                    }
                    db.Commit();
                }
                catch (Exception)
                {
                    db.Rollback();
                    throw;
                }
            }
        }
示例#2
0
文件: IMGroupBLL.cs 项目: radtek/-
        /// <summary>
        /// 增加一个组员到群组里面
        /// </summary>
        /// <param name="groupId"></param>
        /// <param name="userId"></param>
        public void AddUserId(string groupId, string userId, string createUserId, string createUesrName)
        {
            IMUserGroupEntity entity = new IMUserGroupEntity();

            entity.GroupId        = groupId;
            entity.UserId         = userId;
            entity.CreateUserId   = createUserId;
            entity.CreateUserName = createUesrName;
            service.AddUserId(entity);
        }
示例#3
0
 /// <summary>
 /// 群里增加一个用户
 /// </summary>
 /// <param name="entity"></param>
 public void AddUserId(IMUserGroupEntity entity)
 {
     entity.Create();
     this.BaseRepository().Insert <IMUserGroupEntity>(entity);
 }