Exemplo n.º 1
0
        public static Bitmap GetAttImg(string url)
        {
            try
            {
                if (url.IndexOf("http://") == -1)
                {
                    url = ClientCache.GetGameConfigValue("12") + url;
                }


                WebRequest  webreq = WebRequest.Create(url);
                WebResponse webres = webreq.GetResponse();
                Stream      stream = webres.GetResponseStream();
                Image       image;
                image = Image.FromStream(stream);
                stream.Close();
                Bitmap bitm = new Bitmap(image, new Size(200, image.Height * 200 / image.Width));
                return(bitm);
            }
            catch (System.Exception ex)
            {
                return(new Bitmap(Image.FromFile(System.Windows.Forms.Application.StartupPath + "\\gssdata\\images\\picerror.png"), 200, 180));;
            }
        }
        private void ButtonRequest_Click(object sender, EventArgs e)
        {
            try
            {
                if (!CheckData())
                {
                    return;
                }
                string table = ClientCache.GetGameConfigByF_ID(comboBoxType0.SelectedValue.ToString());
                table = rboxOP_TIME.Text.Replace("-", "_") + "_" + table;

                string sql = @"SELECT ID as 日志编号, UID as 用户编号, CID as 角色编号, PARA_1 as 参数1, PARA_2 as 参数2, OPID as 事件, OP_BAK as 对象方描述, OP_TIME as 处理时间 FROM [" + table + "] where 1=1";
                if (tboxUID.Text.Length > 0)
                {
                    sql += " and UID=" + tboxUID.Text + "";
                }
                if (tboxCID.Text.Length > 0)
                {
                    sql += " and CID=" + tboxCID.Text + "";
                }
                if (tboxPARA_1.Text.Length > 0)
                {
                    sql += " and PARA_1=" + tboxPARA_1.Text + "";
                }
                if (tboxPARA_2.Text.Length > 0)
                {
                    sql += " and PARA_2=" + tboxPARA_2.Text + "";
                }
                if (comboBoxType1.SelectedIndex > 0 && comboBoxType1.SelectedValue.ToString().Trim().Length > 0)
                {
                    sql += " and OPID=" + comboBoxType1.SelectedValue + "";
                }
                if (tboxOP_BAK.Text.Length > 0)
                {
                    sql += " and OP_BAK='" + tboxOP_BAK.Text + "'";
                }
                if (!CheckQuerySql(sql))
                {
                    MsgBox.Show("查询语句错误!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    RichTextBoxSql.Text = "";
                    return;
                }

                timer1.Enabled = true;//启动按钮禁用计时
                DataSet ds = null;
                if (radioButtonOnLine.Checked)
                {
                    sql = sql.Replace("[", "").Replace("]", "");
                    ds  = _clihandle.QueryLiveGSLog(comboBoxZoneList.SelectedValue.ToString(), sql);
                }
                else
                {
                    ds = _clihandle.QuerySynLog(comboBoxZoneList.SelectedValue.ToString(), sql);
                }
                RichTextBoxSql.Text = sql;
                if (ds != null)
                {
                    dsss = ds;
                    dataGridViewUIRequestList.DataSource = ds.Tables[0];
                    int colCount = dataGridViewUIRequestList.Columns.Count - 1;
                    dataGridViewUIRequestList.Columns[colCount].MinimumWidth = 30;
                    dataGridViewUIRequestList.Columns[colCount].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                }
                else
                {
                    dataGridViewUIRequestList.Rows.Clear();
                }
            }
            catch (System.Exception ex)
            {
                ShareData.Log.Error("FDBI工具", ex);
                MsgBox.Show("操作失败!" + ex.Message, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
 /// <summary>
 /// 设置游戏用户角色信息
 /// </summary>
 private void SetGameUR()
 {
     lblTaskType.Text = LanguageResource.Language.LblWorkOrderType + ":" + ClientCache.GetDicPCName(_tasktype.ToString());
     BindDicComb(ddlGBigzone, "1000");
 }
        /// <summary>
        /// 设置游戏用户角色信息
        /// </summary>
        private void SetGameUR()
        {
            if (SystemConfig.OpenGridCellNamePrint)
            {
                _drguser.Cells.GridViewCellNameLog();
                if (_drrole != null)
                {
                    _drrole.Cells.GridViewCellNameLog();
                }
            }
            lblTaskType.Text = LanguageResource.Language.LblWorkOrderType + ":" + (!string.IsNullOrEmpty(TaskTypeDesc) ? TaskTypeDesc : ClientCache.GetDicPCName(_tasktype.ToString()));

            string userinfo = "";
            string uid      = TrimNull(_drguser.Cells[0].Value); //该页面记录变量【用户ID,角色ID】
            int    temp     = 0;

            if (int.TryParse(uid, out temp))
            {
                UserID = temp;
            }


            userinfo += LanguageResource.Language.LblAccountNo + ":" + uid + " \t";
            userinfo += LanguageResource.Language.LblAccountName + ":" + TrimNull(_drguser.Cells[1].Value) + "\n";
            userinfo += LanguageResource.Language.LblBelongBigZone + ":" + _drguser.Cells[2].Value + "\t";
            userinfo += LanguageResource.Language.LblOnlineStatue + ":" + TrimNull(_drguser.Cells[3].Value) + " \n";
            userinfo += LanguageResource.Language.LblCloseDownStatue + ":" + TrimNull(_drguser.Cells[4].Value) + "\t";
            userinfo += LanguageResource.Language.LblIsSecurity + ":" + TrimNull(_drguser.Cells[5].Value) + " \n";
            userinfo += LanguageResource.Language.BtnAntiIndulgenceInfo + ":" + TrimNull(_drguser.Cells[6].Value) + "\t";
            userinfo += LanguageResource.Language.LblDocumentNumber + " :" + TrimNull(_drguser.Cells[7].Value) + "\n";
            userinfo += LanguageResource.Language.LblRegisterTime + ":" + TrimNull(_drguser.Cells[8].Value) + "\t";
            userinfo += LanguageResource.Language.LblLastOnlineTime + ":" + TrimNull(_drguser.Cells[9].Value) + " \n";
            userinfo += LanguageResource.Language.LblLastOnlineIP + "IP:" + TrimNull(_drguser.Cells[10].Value) + "\n";
            string bigZone = TrimNull(_drguser.Cells["F_BigZoneID"].Value);

            //F_GUserName
            UserGaneName = (string.Format("{0}", _drguser.Cells["F_UserName"].Value));
            if (int.TryParse(bigZone, out temp))
            {
                BigZoneID = temp;
            }
            if (_drrole != null)
            {
                string rid    = TrimNull(_drrole.Cells[0].Value);
                int    roleid = 0;
                if (int.TryParse(rid, out roleid))
                {
                    RoleID = roleid; //该工单如果是解封角色则需要提供角色ID值【全局变量】
                }
                userinfo += LanguageResource.Language.LblRoleNo + ":" + rid + "\t";
                userinfo += LanguageResource.Language.LblRoleName + ":" + TrimNull(_drrole.Cells[1].Value) + "\n";
                userinfo += LanguageResource.Language.LblBelongZone + ":" + TrimNull(_drrole.Cells[2].Value) + "\t";
                userinfo += LanguageResource.Language.LblOnlineStatue + ":" + TrimNull(_drrole.Cells[3].Value) + "\n";
                userinfo += LanguageResource.Language.LblCloseDownStatue + ":" + TrimNull(_drrole.Cells[4].Value) + "\t";
                userinfo += LanguageResource.Language.LblLevel + ":" + TrimNull(_drrole.Cells[5].Value) + "\n";
                userinfo += LanguageResource.Language.LblCreateTime + ":" + TrimNull(_drrole.Cells[6].Value) + "\t";
                userinfo += LanguageResource.Language.LblLastOnlineTime + ":" + TrimNull(_drrole.Cells[7].Value) + "\n";
                string zone = TrimNull(_drrole.Cells["F_ZoneID"].Value);
                if (int.TryParse(zone, out temp))
                {
                    ZoneID = temp;
                }
                // F_GRoleName
                RoleGameName = (string.Format("{0}", _drrole.Cells["F_RoleName"].Value));
            }
            lblURinfo.Tag    = userinfo;
            rtbBaseInfo.Text = userinfo;
            string.Format("select inform :userId=[{0}],userGameName=[{1}], roleId=[{2}],roleGameName=[{3}]", UserID, UserGaneName, RoleID, RoleGameName);
        }
        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 SetGameUR()
        {
            string userinfo = "";

            BindDept(cboxF_DutyManDept, "0");
            BindUser(cboxF_DutyMan, "-1");

            if (_IsChange)
            {
                _IsChangeA = true;
                _clihandle.GetAllTasksSyn(" and F_ID=" + _taskid + "");
                _IsChange = false;
            }
            model = ClientCache.GetTaskModel(_taskid);

            if (model != null)
            {
                userinfo += LanguageResource.Language.LblWorkOrderNo + ":" + model.F_ID + " ";
                userinfo += LanguageResource.Language.LblWorkOrderType + ":" + ClientCache.GetDicPCName(model.F_Type.ToString()) + "\n";
                // userinfo += "工单标题:" + model.F_Title+ "\n";

                userinfo += LanguageResource.Language.LblWorkOrderSatue + ":" + ClientCache.GetDicName(model.F_State.ToString()) + " ";
                userinfo += LanguageResource.Language.LblWorkOrderSource + ":" + ClientCache.GetDicName(model.F_From.ToString()) + " \n";
                userinfo += LanguageResource.Language.LblPreviousPersonInCharge + ":" + ClientCache.GetUserNameT(model.F_PreDutyMan.ToString()) + "\n";
                userinfo += LanguageResource.Language.LblCurrentPersonInCharge + ":" + ClientCache.GetUserNameT(model.F_DutyMan.ToString()) + "\n";

                lblLimitDate.Text = TrimNull(model.F_LimitTime);
                lblVip.Text       = ClientCache.GetDicName(model.F_VipLevel.ToString());



                labelTitle.Text   = model.F_Title;
                labelCreator.Text = model.F_GPeopleName;

                labelTelephone.Text = model.F_Telphone;


                cboxNowState.Text = ClientCache.GetDicName(TrimNull(model.F_State.ToString()));


                ComitDoControlGN(Convert.ToBoolean(model.F_OCanRestor));


                #region 状态显示

                rbtnState0.Visible = false;
                rbtnState1.Visible = false;
                rbtnState2.Visible = false;
                rbtnState3.Visible = false;
                rbtnState4.Visible = false;
                rbtnState5.Visible = false;
                rbtnState6.Visible = false;
                rbtnState7.Visible = false;
                rbtnState8.Visible = false;


                string taskstate = cboxNowState.Text;

                //权限检测
                if (model.F_DutyMan.ToString() != ShareData.UserID && taskstate != "等待处理")
                {
                    taskstate            = "工单关闭";
                    lblPowerNull.Visible = true;
                }
                else
                {
                    lblPowerNull.Visible = false;
                }

                switch (taskstate)
                {
                case "等待处理":
                    rbtnState0.Visible = true;
                    rbtnState6.Visible = true;
                    rbtnState7.Visible = true;
                    rbtnState0.Checked = true;
                    break;

                case "已经接收":
                    rbtnState1.Visible = true;
                    rbtnState2.Visible = true;
                    rbtnState6.Visible = true;
                    rbtnState7.Visible = true;
                    rbtnState1.Checked = true;
                    break;

                case "处理中":
                    rbtnState2.Visible = true;
                    rbtnState3.Visible = true;
                    rbtnState4.Visible = true;
                    rbtnState6.Visible = true;
                    rbtnState7.Visible = true;
                    rbtnState8.Visible = true;
                    rbtnState3.Checked = true;
                    break;

                case "已经转向":
                    rbtnState7.Visible = true;
                    rbtnState7.Checked = true;
                    rbtnState7.Text    = "仅备注(要求或信息)";
                    break;

                case "等待反馈":
                    rbtnState4.Visible = true;
                    rbtnState6.Visible = true;
                    rbtnState7.Visible = true;
                    rbtnState4.Checked = true;
                    rbtnState4.Text    = "已反馈并需评分";
                    break;

                case "等待评分":
                    rbtnState5.Visible = true;
                    rbtnState6.Visible = true;
                    rbtnState7.Visible = true;
                    rbtnState5.Checked = true;
                    rbtnState5.Text    = "评分并完成工单";
                    break;

                case "需领导审核":
                    rbtnState2.Visible = true;
                    rbtnState5.Visible = true;
                    rbtnState6.Visible = true;
                    rbtnState7.Visible = true;
                    rbtnState2.Checked = true;
                    rbtnState2.Text    = "审核通过并转向";
                    SetNextUser(model.F_PreDutyMan);
                    cboxF_DutyManDept.Enabled = false;
                    cboxF_DutyMan.Enabled     = false;
                    ckboxEditNUser.Visible    = true;
                    break;

                case "工单完成":
                    rbtnState7.Visible = true;
                    rbtnState7.Checked = true;
                    break;

                case "工单关闭":
                    rbtnState7.Visible = true;
                    rbtnState7.Checked = true;
                    break;

                default:
                    break;
                }
            }
            #endregion

            flowLayoutPanelF_State.Location = new Point(9, 55);

            lblTaskinfo.Text = userinfo;

            //权限
            //foreach (System.Windows.Forms.Control control in this.groupBoxTool0.Controls)
            //{
            //    if (control.GetType().ToString() == "System.Windows.Forms.Button" || control.GetType().ToString() == "GSSUI.AControl.AButton.AButton")
            //    {
            //        System.Windows.Forms.Button toolbtnActiv = (control as System.Windows.Forms.Button);
            //        toolbtnActiv.Enabled = false;
            //        if (ShareData.UserPower.IndexOf("," + toolbtnActiv.Name + ",") >= 0)
            //        {
            //            toolbtnActiv.Enabled = true;
            //        }
            //    }
            //}


            labelGAInfo.Text = LanguageResource.Language.LblGameBigZone + ":" + model.F_GameBigZone;
            if (model.F_COther.Length > 0)
            {
                string[] giftstr = model.F_COther.Split('|');
                labelGAInfo.Text += " \n" + LanguageResource.Language.LblAwardNo + ":" + giftstr[0] + "  奖品名称:" + giftstr[1] + "\n奖品类型:" + giftstr[2] + "  奖品数量:" + giftstr[3];
            }



            DataSet ds = GSSCSFrameWork.DataSerialize.GetDatasetFromByte((byte[])GSSCSFrameWork.DataSerialize.GetObjectFromString(model.F_URInfo));
            if (ds != null)
            {
                DGVGameUser.AutoGenerateColumns = false;
                DGVGameUser.DataSource          = ds.Tables[0];
                //string URInfo = "";
                //foreach (DataRow dru in ds.Tables[0].Rows)
                //{

                //    URInfo += @"用户编号:" + dru[0] + @LanguageResource.Language.LblRoleNo + dru[1] + "\n";
                //}
                //aRichTextBoxCode.Text = URInfo;
            }


            DataSet dsTaskLog = _clihandle.GetTaskLogSyn(" and F_ID=" + _taskid + "");
            if (dsTaskLog != null)
            {
                SetTaskLogValue(dsTaskLog.Tables[0]);
            }
        }