Exemplo n.º 1
0
 //线程实例
 //用户管理类DB
 public void createUser(object obj)
 {
     try
     {
         object[]     objs  = null;
         UserGroup    user  = null;
         UserLogin    login = null;
         User         info  = null;
         UserRegister reg   = null;
         while (true)
         {
             user = regQueue.ReceiveUserGroup();
             // objs = regQueue.GetAllUserMessage();
             if (user != null)
             {
                 Console.WriteLine("消息UserGroup" + user.ID);
                 login = regQueue.ReceiveUserLogin();
                 if (login != null)
                 {
                     Console.WriteLine("消息UserLogin" + login.LoginID);
                     info = regQueue.ReceiveUser();
                     if (info != null)
                     {
                         Console.WriteLine("消息User" + info.PhoneNumber);
                         reg = regQueue.ReceiveUserRegister();
                         if (reg != null)
                         {
                             Console.WriteLine("消息UserRegister" + reg.UserId);
                             db.Create(user);
                             db.CreateOrUpdate(login);
                             db.CreateOrUpdate(info);
                             db.Create(reg);
                         }
                     }
                 }
             }
             Thread.Sleep(100);
         }
     }
     catch
     {
     }
 }