private void btnDosure_Click(object sender, EventArgs e)
        {
            if (rtboxNote.Text.Trim().Length == 0)
            {
                MsgBox.Show("工具使用备注不能为空!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            try
            {
                ComitDoControl(false);


                int userid = Convert.ToInt32(_model.F_GUserID);


                if (userid.ToString().Length == 0)
                {
                    MsgBox.Show("用户都不能为空!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }


                GSSServerLibrary.ServerRemoteLib remote = ClientRemoting.ServerRemoteLib();
                string resultStr = remote.UserRoleClearOnline("寻龙记", _model.F_GameBigZone, userid);

                GSSBLL.Tasks   bll  = ClientRemoting.Tasks();
                GSSModel.Tasks task = new GSSModel.Tasks();
                task.F_ID        = _model.F_ID;
                task.F_EditMan   = int.Parse(ShareData.UserID);
                task.F_EditTime  = DateTime.Now;
                task.F_TToolUsed = true;
                task.F_TUseData  = string.Format("帐号/角色清除在线状态工具 \n{0} \n{1}", lblUR.Text, resultStr);
                task.F_Note      = rtboxNote.Text;
                _isToolUsed      = true;
                bll.Edit(task);

                MsgBox.Show(resultStr, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);

                if (resultStr.IndexOf("成功") != -1)
                {
                    this.Close();
                }
            }
            catch (System.Exception ex)
            {
                ShareData.Log.Warn(ex);
                MsgBox.Show(ex.Message, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            finally
            {
                ComitDoControl(true);
            }
        }
Exemplo n.º 2
0
        private void btnDosure_Click(object sender, EventArgs e)
        {
            //MsgBox.Show("功能完善中,暂停使用!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //return;
            if (rtboxNote.Text.Trim().Length == 0)
            {
                MsgBox.Show("工具使用备注不能为空!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            try
            {
                ComitDoControl(false);

                string newRoleName = tboxNewRoleName.Text.Trim();
                int    userid      = Convert.ToInt32(_model.F_GUserID);
                int    roleid      = Convert.ToInt32(_model.F_GRoleID);

                if (userid.ToString().Length == 0 || roleid.ToString().Length == 0)
                {
                    MsgBox.Show("用户和角色都不能为空!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (newRoleName.Length < 2 || newRoleName.Length > 7)
                {
                    MsgBox.Show("新的角色名不能小于2位,大于7位!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                GSSServerLibrary.ServerRemoteLib remote = ClientRemoting.ServerRemoteLib();
                string resultStr = remote.RoleNameChange("寻龙记", _model.F_GameBigZone, userid, roleid, _model.F_GRoleName, newRoleName);

                GSSBLL.Tasks   bll  = ClientRemoting.Tasks();
                GSSModel.Tasks task = new GSSModel.Tasks();
                task.F_ID        = _model.F_ID;
                task.F_EditMan   = int.Parse(ShareData.UserID);
                task.F_EditTime  = DateTime.Now;
                task.F_TToolUsed = true;
                task.F_TUseData  = string.Format("角色改名工具 \n{0} \n新名:{1} \n{2}", lblUR.Text, newRoleName, resultStr);
                task.F_Note      = rtboxNote.Text;
                _isToolUsed      = true;
                bll.Edit(task);

                MsgBox.Show(resultStr, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);

                if (resultStr.IndexOf("成功") != -1)
                {
                    this.Close();
                }
            }
            catch (System.Exception ex)
            {
                ShareData.Log.Warn(ex);
                MsgBox.Show(ex.Message, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            finally
            {
                ComitDoControl(true);
            }
        }