示例#1
0
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            /*
             * 清除上一次显示的内容
             */
            if (CmbServer.Text == "")
            {
                return;
            }

            if (this.checkBox1.Checked == false)
            {
                if (TxtAccount.Text.Trim().Length > 0)
                {
                    this.BtnSearch.Enabled        = false;
                    this.btnBlanketActive.Enabled = false;
                    this.Cursor                  = Cursors.AppStarting;
                    this.TxtNickName.Text        = "";
                    this.RoleInfoView.DataSource = null;
                    AccountDelegat mAccountDelegat = new AccountDelegat(DelegatInfo);
                    mAccountDelegat.BeginInvoke(null, null);
                }
                else
                {
                    MessageBox.Show(config.ReadConfigValue("MSDO", "AF_Code_InputAccount"));
                }
            }
            else
            {
                if (this.TxtNickName.Text.Trim().Length > 0)
                {
                    this.BtnSearch.Enabled        = false;
                    this.btnBlanketActive.Enabled = false;
                    this.Cursor                  = Cursors.AppStarting;
                    this.TxtAccount.Text         = "";
                    this.RoleInfoView.DataSource = null;
                    AccountDelegat mAccountDelegat = new AccountDelegat(DelegatInfo);
                    mAccountDelegat.BeginInvoke(null, null);
                }
                else
                {
                    MessageBox.Show(config.ReadConfigValue("MSDO", "AF_Code_InputNickName"));
                }
            }
        }
示例#2
0
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            /*
             * 清除上一次显示的内容
             */
            LblDetail.Text = "";
            foreach (Control m in PnlDetail.Controls.Find("LabelTextBox", true))
            {
                m.Dispose();
            }

            if (TxtAccount.Text.Trim().Length > 0)
            {
                AccountDelegat mAccountDelegat = new AccountDelegat(DelegatInfo);
                mAccountDelegat.BeginInvoke(null, null);
            }
            else
            {
                MessageBox.Show(config.ReadConfigValue("MSDO", "AF_Code_InputAccount"));
            }
        }
示例#3
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show(config.ReadConfigValue("MSDO", "AF_Code_SurtToStartBlanket").Replace("{BtnStartOrStopBlanet}", btnBlanketActive.Text), "", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
            {
                return;
            }



            C_Global.CEnum.Message_Body[] messageBody = new C_Global.CEnum.Message_Body[3];
            C_Global.CEnum.Message_Body[,] doResult = null;

            messageBody[0].eTag     = C_Global.CEnum.TagFormat.TLV_STRING;
            messageBody[0].eName    = C_Global.CEnum.TagName.SDO_ServerIP;
            messageBody[0].oContent = Operation_SDO.GetItemAddr(mServerInfo, CmbServer.Text);

            messageBody[1].eTag     = C_Global.CEnum.TagFormat.TLV_STRING;
            messageBody[1].eName    = C_Global.CEnum.TagName.SDO_Account;
            messageBody[1].oContent = TxtAccount.Text;

            messageBody[2].eTag     = C_Global.CEnum.TagFormat.TLV_INTEGER;
            messageBody[2].eName    = C_Global.CEnum.TagName.UserByID;
            messageBody[2].oContent = int.Parse(m_ClientEvent.GetInfo("USERID").ToString());

            if (int.Parse(mResult[0, 7].oContent.ToString()) == 0)
            {
                //激活
                doResult = m_ClientEvent.GetSocket(this.m_ClientEvent, Operation_SDO.GetItemAddr(mServerInfo, CmbServer.Text)).RequestResult(C_Global.CEnum.ServiceKey.SDO_MEMBERDANCE_OPEN, C_Global.CEnum.Msg_Category.SDO_ADMIN, messageBody);
            }
            else
            {
                //停用
                doResult = m_ClientEvent.GetSocket(this.m_ClientEvent, Operation_SDO.GetItemAddr(mServerInfo, CmbServer.Text)).RequestResult(C_Global.CEnum.ServiceKey.SDO_MEMBERDANCE_CLOSE, C_Global.CEnum.Msg_Category.SDO_ADMIN, messageBody);
            }



            if (doResult[0, 0].eName == CEnum.TagName.ERROR_Msg)
            {
                MessageBox.Show(doResult[0, 0].oContent.ToString());
                return;
            }

            if (doResult[0, 0].oContent.ToString().Equals("FAILURE"))
            {
                MessageBox.Show(config.ReadConfigValue("MSDO", "AF_Code_Failed"));
                return;
            }

            if (doResult[0, 0].oContent.ToString().Equals("SUCESS"))
            {
                MessageBox.Show(config.ReadConfigValue("MSDO", "AF_Code_Succeed"));

                LblDetail.Text = "";
                foreach (Control m in PnlDetail.Controls.Find("LabelTextBox", true))
                {
                    m.Dispose();
                }

                if (TxtAccount.Text.Trim().Length > 0)
                {
                    AccountDelegat mAccountDelegat = new AccountDelegat(DelegatInfo);
                    mAccountDelegat.BeginInvoke(null, null);
                }
                else
                {
                    MessageBox.Show(config.ReadConfigValue("MSDO", "AF_Code_InputAccount"));
                }

                return;
            }
        }