Example #1
0
 public Boolean AddLock()
 {
     if (Session[Keys.SESSION_ADMIN_INFO] == null)
     {
         return(false);
     }
     else
     {
         Master master = Session[Keys.SESSION_ADMIN_INFO] as Master;
         if (rcm.GetRoleCompetence(master.RoleId, 1341))
         {
             string Lock     = Request["LockInfo"];
             string LockInfo = "Ip锁定";
             try
             {
                 int      s = 0;
                 string[] a = DESEncrypt.Decrypt(Lock).Split('|');
                 string   b = a[0];
                 string   c = a[1];
                 if (int.TryParse(a[0], out s) && int.TryParse(a[1], out s))
                 {
                     GameUser gu = new GameUser();
                     gu = gum.GetGameUser(int.Parse(a[0]));
                     Games g = gm.GetGame(int.Parse(a[1]));
                     if (gu != null)
                     {
                         if (gu.IsSpreader > 0)
                         {
                             LockInfo = gu.UserName + "的" + g.Name + "链接";
                         }
                     }
                 }
             }
             catch (Exception)
             {
             }
             if (!string.IsNullOrEmpty(Lock) && !alm.IsLock(Lock))
             {
                 return(alm.AddLock(Lock, master.UserName, LockInfo));
             }
         }
     }
     return(false);
 }