コード例 #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (CommitTaskSyn())
     {
         string Uname = TrimNull(_drguser.Cells[1].Value);
         string Rname = _drrole == null ? "" : TrimNull(_drrole.Cells[1].Value);
         if (Rname.Trim().Length == 0 || Uname.Trim().Length == 0)
         {
             MsgBox.Show(LanguageResource.Language.Tip_WorkOrderLoseAccountOrRoleWithInvalid + "!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         FormToolGuserLock form = new FormToolGuserLock(_clienthandle, 2, _taskid, Uname, Rname);
         form.ShowDialog();
         Application.DoEvents();
     }
 }
コード例 #2
0
        /// <summary>
        /// 工具类事件:角色封停
        /// </summary>
        private void button5_Click(object sender, EventArgs e)
        {
            string Uname = TrimNull(model.F_GUserName);
            string Rname = TrimNull(model.F_GRoleName);

            if (Rname.Trim().Length == 0)
            {
                MsgBox.Show(LanguageResource.Language.Tip_WorkOrderLoseAccountOrRoleWithInvalid, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            FormToolGuserLock form         = new FormToolGuserLock(_clihandle, 2, model.F_ID.ToString(), Uname, Rname);
            DialogResult      dialogresult = form.ShowDialog();

            Application.DoEvents();
            if (dialogresult == DialogResult.OK)
            {
                _IsChange = true;
                SetGameUR();
            }
        }
コード例 #3
0
        /// <summary>
        /// 窗口之间消息
        /// </summary>
        /// <param name="m"></param>
        protected override void DefWndProc(ref System.Windows.Forms.Message m)
        {
            switch (m.Msg)
            {
            case 601:
                string.Format("class:{0}, Msg:{1},m.LParam:{2},HWnd:{3},WParam:{4}", typeof(FormTaskAdd).Name, m.Msg, m.LParam.ToString(), m.HWnd.ToString(), m.WParam.ToString()).Logger();
                this.Activate();
                string shareMsgPosition = m.LParam.ToString();
                int    index            = Convert.ToInt32(shareMsgPosition) - 1;
                if (index >= 0)
                {    //存在异常信息
                    //逻辑优化前
                    object obj = ShareData.Msg[index];
                    GSSModel.Request.ClientData data = obj as GSSModel.Request.ClientData;
                    string.Format("class:[{0}] new flow call return result= [{1}],message=[{2}]", typeof(FormTaskAdd).Name, data.Success, data.Message).Logger();
                    //目前这里只有解封账号和角色
                    if (data.Success)
                    {
                        MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateSucc + "!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.Close();
                        return;
                    }
                    else
                    {
                        string msg = data.Message;
                        msg.Logger();
                        if (msg == "2016:")
                        {    //调用gamecoredb或者usercoredb只有这一项返回数据时的状态码
                            msg = LanguageItems.BaseLanguageItem.Tip_OnlyStaueIsLockCanDo;
                        }
                        MsgBox.Show(msg, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }
                else if (m.WParam.ToString() == "0")
                {
                    _taskid = "0";
                    if (!ckboxDonow.Checked)
                    {
                        MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateFailure, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateFailureWithTool, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    ComitDoControl(true);
                }
                else
                {
                    _taskid = m.WParam.ToString();
                    if (!ckboxDonow.Checked)
                    {
                        MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateSucc + "!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);

                        this.Close();
                    }
                    else
                    {
                        string Uname = TrimNull(_drguser.Cells[1].Value);
                        string Rname = _drrole == null ? "" : TrimNull(_drrole.Cells[1].Value);
                        if (Uname.Trim().Length == 0)
                        {
                            MsgBox.Show(LanguageResource.Language.Tip_WorkOrderLoseAccountWithInvalid + "!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        FormToolGuserLock form = new FormToolGuserLock(_clienthandle, 1, _taskid, Uname, Rname);
                        DialogResult      dr   = form.ShowDialog();
                        Application.DoEvents();
                        if (dr == DialogResult.OK)
                        {
                            MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateSuccWithExecute + "!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                            this.Close();
                        }
                        else
                        {
                            ComitDoControl(true);
                        }
                    }
                }
                break;

            default:
                base.DefWndProc(ref m);
                break;
            }
        }