Пример #1
0
 protected void btnUpLevel_Click(object sender, EventArgs e)
 {
     try
     {
         if (CheckManager())
         {
             var level = ConvertHelper.ConvertToInt(txtLevel.Text);
             if (level < 1)
             {
                 ShowMessage("等级不能小于1");
                 return;
             }
             if (level > 80)
             {
                 ShowMessage("等级不能超过80");
                 return;
             }
             var exp     = ConvertHelper.ConvertToInt(txtExp.Text);
             var manager = NbManagerMgr.GetById(_account.ManagerId, _account.ZoneId);
             manager.Level = level;
             manager.EXP   = exp;
             if (NbManagerMgr.Update(manager, null, _account.ZoneId))
             {
                 SaveAdminLog(EnumAdminOperationType.UpLevel, string.Format("Level:{0}", level));
                 ShowMessage("修改等级成功");
             }
             else
             {
                 ShowMessage("修改等级失败");
             }
         }
     }
     catch (Exception ex)
     {
         LogHelper.Insert(ex);
         ShowMessage(ex.Message);
     }
 }