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);
            }
        }
        /// <summary>
        /// 提交工单
        /// </summary>
        private void CommitTask()
        {
            string   Title       = tboxTitle.Text.Trim();
            string   gpeoplename = tboxCreator.Text.Trim();
            string   telephone   = tboxTelephone.Text.Trim();
            string   Note        = rboxNote.Text.Trim();
            int      From        = SystemConfig.AppID;//客服中心
            int      VipLevel    = int.Parse(cboxVIP.SelectedValue.ToString());
            DateTime?LimitTime   = GetLimitTime();
            int      LimitType   = int.Parse(cboxLimitTime.SelectedValue.ToString());
            int?     Type        = _tasktype;           //帐号封停工单
            int      State       = 100100102;           //处理中
            int      GameName    = SystemConfig.GameID; //寻龙记
            int?     DutyMan     = Convert.ToInt32(ShareData.UserID);
            int?     PreDutyMan  = null;
            int      CreatMan    = int.Parse(ShareData.UserID);
            DateTime CreatTime   = DateTime.Now;
            int      EditMan     = int.Parse(ShareData.UserID);
            DateTime EditTime    = DateTime.Now;
            string   bigzonename = ddlGBigzone.SelectedValue.ToString();


            int Rowtype = 0;
            //string ReceivArea = GetTreeValue();


            string strErr = "";

            if (Title.Length == 0)
            {
                strErr += "工单标题不能为空!\n";
            }
            if (gpeoplename.Length == 0)
            {
                strErr += LanguageResource.Language.LblInitiatorNameIsRequire + "!\n";
            }
            if (telephone.Trim().Length < 6)
            {
                strErr += LanguageResource.Language.LblTelFormIsError + "!\n";
            }

            if (Note.Trim().Length == 0)
            {
                strErr += LanguageResource.Language.Tip_RemarkNoEmpty + "!\n";
            }
            if (DGVGameUser.Rows.Count == 0)
            {
                strErr += LanguageResource.Language.Tip_GameUseNotIsRequire + "!\n";
            }


            if (strErr != "")
            {
                MsgBox.Show(strErr, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            ComitDoControl(false);



            try
            {
                GSSBLL.Tasks bll = ClientRemoting.Tasks();

                if (tboxInfo.Text.Trim().Length == 0)
                {
                    foreach (DataGridViewRow dr in DGVGameUser.Rows)
                    {
                        string userid   = dr.Cells[0].Value.ToString();
                        string username = dr.Cells[1].Value.ToString();

                        string result = bll.GSSTool_SetUserLock(userid, username, "0", cboxTime.SelectedValue.ToString());
                        tboxInfo.Text += string.Format(" {0},{1},{2}\n", userid, username, result);
                        tboxInfo.ScrollToCaret();
                    }
                }


                GSSModel.Tasks model = new GSSModel.Tasks();
                model.F_Title       = Title;
                model.F_GPeopleName = gpeoplename;
                model.F_Telphone    = telephone;
                model.F_Note        = Note;
                model.F_From        = From;
                model.F_VipLevel    = VipLevel;
                model.F_LimitType   = LimitType;
                model.F_LimitTime   = LimitTime;
                model.F_Type        = Type;
                model.F_State       = State;
                model.F_GameName    = GameName;
                model.F_DutyMan     = DutyMan;
                model.F_PreDutyMan  = PreDutyMan;
                model.F_CreatMan    = CreatMan;
                model.F_CreatTime   = CreatTime;
                model.F_EditMan     = EditMan;
                model.F_EditTime    = EditTime;
                model.F_GameBigZone = bigzonename;
                model.F_COther      = "";
                model.F_Rowtype     = 0;
                model.F_GUserID     = "0";
                model.F_GUserName   = "******";
                // model.F_URInfo = tboxInfo.Text;
                model.F_Note = Note + "\n用户列表:\n" + tboxInfo.Text;


                if (bll.AddP(model) > 0)
                {
                    MsgBox.Show("工单执行并保存成功", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.Close();
                }
                else
                {
                    MsgBox.Show("工单保存失败", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (System.Exception ex)
            {
                MsgBox.Show("错误:" + ex.Message, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            ComitDoControl(true);
        }
        /// <summary>
        /// 得到消息列表
        /// </summary>
        private void GetMsg(bool ispageload)
        {
            try
            {
                string sqlrlistWhere = " F_Type=20000216 and F_Rowtype=6 and F_TToolUsed is null  and F_DutyMan=" + GSSClient.ShareData.UserID + "";
                //  if (!lblLoading.Visible)
                //{
                //       sqlrlistWhere += " and F_TToolUsed is null";
                //  }
                // DataSet ds = _clienthandle.GetAllTasksSyn("", sqlrlistWhere, "F_ID", "ASC", 50, 1);
                GSSBLL.Tasks bll = ClientRemoting.Tasks();
                DataSet      ds  = bll.GetList(50, sqlrlistWhere, "F_ID ASC");
                if (ds != null && ds.Tables[0].Columns.Count > 15)
                {
                    bool isRoleAdd = true;
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        isRoleAdd = true;
                        string imgTips = Application.StartupPath + "\\GSSData\\Images\\numerbgClear.png";
                        if (dr["F_TToolUsed"].ToString() == "")
                        {
                            imgTips = Application.StartupPath + "\\GSSData\\Images\\New.png";
                        }
                        Image img = GetImage(imgTips);

                        foreach (DataGridViewRow dgvr in dgvRoleList.Rows)
                        {
                            if (dgvr.Cells[0].Value.ToString() == dr["F_ID"].ToString())
                            {
                                isRoleAdd           = false;
                                dgvr.Cells[2].Value = img;
                            }
                        }
                        if (isRoleAdd)
                        {
                            DGVInsert(dr, img);
                        }
                        Application.DoEvents();
                    }
                }
                lblLoading.Visible = false;
                //  dgvRoleList.DataSource = ds.Tables[0];

                if (dgvRoleList.SelectedRows.Count == 1)
                {
                    if (lblLoadingRole.Visible)
                    {
                        lblTaskID.Text = dgvRoleList.SelectedRows[0].Cells[0].Value.ToString();
                        //DataSet dsmsglist = _clienthandle.GetTaskLogSyn(" and F_ID=" + dgvRoleList.SelectedRows[0].Cells[0].Value + " ");
                        GSSBLL.TasksLog bllMsg    = ClientRemoting.TasksLog();
                        DataSet         dsmsglist = bllMsg.GetList(50, " F_ID=" + dgvRoleList.SelectedRows[0].Cells[0].Value + " and F_Note is not null ", "F_LogID ASC");
                        if (dsmsglist != null && dsmsglist.Tables[0].Rows.Count > 0)
                        {
                            lblLoadingRole.Visible = false;
                            lblRoleInfo.Text       = dsmsglist.Tables[0].Rows[0]["F_URInfo"].ToString();

                            foreach (DataRow dr in dsmsglist.Tables[0].Rows)
                            {
                                string msg = "";
                                if (dr["F_EditMan"].ToString().Length != 0)
                                {
                                    msg = string.Format("【客服{2}说:{0}】\n{1}\n", dr["F_EditTime"], dr["F_Note"], dr["F_EditMan"]);
                                }
                                else
                                {
                                    string dd = dr["F_TToolUsed"].ToString();
                                    if (dr["F_TToolUsed"].ToString() == "")
                                    {
                                        GSSModel.Tasks model = new GSSModel.Tasks();
                                        model.F_ID        = Convert.ToInt32(dr["F_ID"]);
                                        model.F_TToolUsed = true;
                                        //_clienthandle.EditTaskLogSyn(model);
                                        GSSBLL.TasksLog bllMsgT = ClientRemoting.TasksLog();
                                        bllMsgT.Edit(model);
                                    }
                                    msg = string.Format("【他说:{0}】\n{1}\n", dr["F_EditTime"], dr["F_Note"]);
                                }
                                lblLoadingMSGList.Visible = false;
                                MsgPrint(msg);
                            }
                        }
                    }
                    else
                    {
                        // DataSet dsmsglist = _clienthandle.GetTaskLogSyn(" and F_ID=" + dgvRoleList.SelectedRows[0].Cells[0].Value + " and F_EditMan is NULL and F_TToolUsed is null ");
                        GSSBLL.TasksLog bllMsg    = ClientRemoting.TasksLog();
                        DataSet         dsmsglist = bllMsg.GetList(50, " F_ID=" + dgvRoleList.SelectedRows[0].Cells[0].Value + " and F_EditMan is NULL and F_TToolUsed is null and F_Note is not null ", "F_LogID ASC");
                        if (dsmsglist != null)
                        {
                            foreach (DataRow dr in dsmsglist.Tables[0].Rows)
                            {
                                if (dr["F_TToolUsed"].ToString() == "")
                                {
                                    GSSModel.Tasks model = new GSSModel.Tasks();
                                    model.F_ID        = Convert.ToInt32(dr["F_ID"]);
                                    model.F_TToolUsed = true;
                                    //_clienthandle.EditTaskLogSyn(model);
                                    GSSBLL.TasksLog bllMsgT = ClientRemoting.TasksLog();
                                    bllMsgT.Edit(model);
                                }
                                string msg = string.Format("【他说:{0}】\n{1}\n", dr["F_EditTime"], dr["F_Note"]);
                                MsgPrint(msg);
                            }
                        }
                    }
                    string imgTips = Application.StartupPath + "\\GSSData\\Images\\numerbgClear.png";
                    Image  img     = GetImage(imgTips);
                    dgvRoleList.SelectedRows[0].Cells[2].Value = img;
                }
                lblLoadingRole.Visible    = false;
                lblLoadingMSGList.Visible = false;
            }
            catch (System.Exception ex)
            {
                ShareData.Log.Warn(ex);
                //MsgPrint("Warn:"+ex.Message);
            }
        }