private void ButtonClose_Click(object sender, EventArgs e)
        {
            if (lblTaskID.Text.Trim().Length == 0)
            {
                return;
            }
            tboxNote.Text = "寻龙记感谢您的支持,谢谢!(暂不回复给玩家)";
            GSSModel.Tasks model = new GSSModel.Tasks();
            model.F_ID         = Convert.ToInt32(lblTaskID.Text);
            model.F_Note       = tboxNote.Text;
            model.F_EditMan    = Convert.ToInt32(ShareData.UserID);
            model.F_EditTime   = DateTime.Now;
            model.F_TToolUsed  = true;
            model.F_OCanRestor = true;
            model.F_Rowtype    = 6;//聊天
            string msg = string.Format("【你说:{0}】\n{1}\n", model.F_EditTime, model.F_Note);

            tboxNote.Text   = "";
            model.F_State   = 100100100;
            model.F_DutyMan = -1;
            MsgPrint(msg);
            //string back = _clienthandle.EditTaskSyn(model);

            GSSBLL.Tasks bll  = ClientRemoting.Tasks();
            int          back = bll.Edit(model);

            if (back == 0)
            {
                MsgPrint("--发送失败--");
            }
            DGVDelete();
            tboxNote.Focus();
        }
        /// <summary>
        /// 发送消息
        /// </summary>
        private void SendMSG()
        {
            if (lblTaskID.Text.Trim().Length == 0 || tboxNote.Text.Trim().Length == 0)
            {
                return;
            }
            GSSModel.Tasks model = new GSSModel.Tasks();
            model.F_ID         = Convert.ToInt32(lblTaskID.Text);
            model.F_Note       = tboxNote.Text;
            model.F_EditMan    = Convert.ToInt32(ShareData.UserID);
            model.F_EditTime   = DateTime.Now;
            model.F_TToolUsed  = true;
            model.F_OCanRestor = null;
            model.F_Rowtype    = 6;//聊天
            string msg = string.Format("【你说:{0}】\n{1}\n", model.F_EditTime, model.F_Note);

            tboxNote.Text = "";
            MsgPrint(msg);
            //string back = _clienthandle.EditTaskSyn(model);

            GSSBLL.Tasks bll  = ClientRemoting.Tasks();
            int          back = bll.Edit(model);

            if (back == 0)
            {
                MsgPrint("--发送失败--");
            }
            tboxNote.Focus();
        }
        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);
            }
        }
        /// <summary>
        /// 插入列表
        /// </summary>
        /// <param name="dr"></param>
        /// <param name="img"></param>
        public void DGVInsertF(int taskid, string rolename)
        {
            if (dgvRoleList.InvokeRequired)
            {
                delegate_DGVInsertF d = new delegate_DGVInsertF(DGVInsertF);
                object arg0           = taskid;
                object arg1           = rolename;
                this.Invoke(d, arg0, arg1);
            }
            else
            {
                string imgTips = Application.StartupPath + "\\GSSData\\Images\\numerbgClear.png";
                Image  img     = GetImage(imgTips);

                bool isRoleAdd = true;
                foreach (DataGridViewRow dgvr in dgvRoleList.Rows)
                {
                    if (Convert.ToInt32(dgvr.Cells[0].Value) == taskid)
                    {
                        isRoleAdd = false;
                        //dgvRoleList.Rows.Remove(dgvr);
                    }
                }
                if (isRoleAdd)
                {
                    try
                    {
                        GSSBLL.Tasks   bll   = ClientRemoting.Tasks();
                        GSSModel.Tasks model = new GSSModel.Tasks();
                        model.F_ID         = taskid;
                        model.F_State      = 100100101;
                        model.F_DutyMan    = int.Parse(ShareData.UserID);
                        model.F_EditMan    = int.Parse(ShareData.UserID);
                        model.F_EditTime   = DateTime.Now;
                        model.F_TToolUsed  = true;
                        model.F_OCanRestor = true;
                        model.F_Rowtype    = 6;
                        model.F_Note       = null;
                        bll.Edit(model);
                        Thread.Sleep(100);
                        dgvRoleList.Rows.Insert(0, taskid, rolename, img);
                        Application.DoEvents();
                        dgvRoleList.Rows[0].Selected = true;
                        Application.DoEvents();
                        dgvRoleList_SelectionChanged(null, null);
                        Application.DoEvents();
                    }
                    catch (System.Exception ex)
                    {
                        MsgBox.Show(LanguageResource.Language.Tip_ReceiverOnlineConsumeError, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                }
            }
        }
        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);
            }
        }
Exemple #6
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);
            }
        }
        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);
            }
        }