public void TestCreate()
 {
     var dao = "IIMDao".GetInstance<IMDao>();
     var user = new IMUser();
     user.TcpAddress = "sdfsdf";
     user.Groups = new List<IMUserGroup>()
                       {
                           new IMUserGroup()
                               {
                                   Type = IMGroupTypes.�Լ�,
                                   Icon = "sdfsdfsdf",
                                   Name = "��Ц˹�ٷҼ��",
                                   Members = new List<IMUserSetting>()
                                                 {
                                                     new IMUserSetting()
                                                         {
                                                             Name = "sdfsdf"
                                                         }
                                                 }
                               }
                       };
     //dao.Add(user);
 }
Beispiel #2
0
        public IMUser Join(Guid id, States state)
        {
            var m = Session.Get<IMUser>(id);
            if(m == null)
            {
                m = new IMUser();
                var groups = new List<IMUserGroup>
                                 {
                                     new IMUserGroup()
                                         {
                                             Type = IMGroupTypes.�Լ�
                                         }
                                 };
                m.Groups = groups;
                Session.Save(m);
                Session.Flush();
            }

            //m.Groups.Where(g => g.Type == IMGroupTypes.�Լ�).First().Members.First().State = state;

            if(OnLineUsers.ContainsKey(m.Id))
            {
                OnLineUsers[m.Id] = m;
            }
            else
            {
                OnLineUsers.Add(m.Id, m);
            }

            return m;
        }