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 bigzoneid = Convert.ToInt32(ClientCache.GetBigZoneGameID(_model.F_GameBigZone)); string bigzoneCFID = ClientCache.GetGameConfigID(_model.F_GameBigZone); int zoneid = Convert.ToInt32(ClientCache.GetZoneGameID(bigzoneCFID, _model.F_GameZone)); string sql = string.Format("update OPENQUERY ([LKSV] ,'select * from T_Role_Base where F_ID={0} and F_UserID={1}') set F_DepotPass='******'", _model.F_GRoleID, _model.F_GUserID); GSSBLL.Tasks bll = ClientRemoting.Tasks(); int result = bll.GSSTool_CustomExec(bigzoneid, zoneid, 6, sql); string info = ""; if (result != 0) { info = "操作执行成功"; } else { info = "此角色已经不存在"; } 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, info); task.F_Note = rtboxNote.Text; _isToolUsed = true; bll.Edit(task); MsgBox.Show(info, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information); if (result != 0) { 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); } }
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); GSSModel.Tasks model = new GSSModel.Tasks(); model.F_GRoleID = _model.F_GRoleID; model.F_GUserID = _model.F_GUserID; model.F_GameBigZone = ClientCache.GetBigZoneGameID(_model.F_GameBigZone); string bigzoneCFID = ClientCache.GetGameConfigID(_model.F_GameBigZone); model.F_GameZone = ClientCache.GetZoneGameID(bigzoneCFID, _model.F_GameZone); GSSBLL.Tasks bll = ClientRemoting.Tasks(); int codeResult = bll.GSSTool_RoleRecover(model); string info = ""; if (codeResult == 0) { info = "操作执行成功"; } else if (codeResult == 1801) { info = "用户在该战区下已经有3个角色"; } else if (codeResult == 1800) { info = "删除表中无此角色"; } else { info = "操作执行失败"; } 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, info); task.F_Note = rtboxNote.Text; _isToolUsed = true; bll.Edit(task); MsgBox.Show(info, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information); if (codeResult == 0) { 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); } }