private void BtnSearch_Click(object sender, EventArgs e) { GrdResult.DataSource = null; CmbPage.Items.Clear(); if (TxtSenderAccount.Text.Trim().Length > 0 || TxtReciveAccount.Text.Trim().Length > 0) { CEnum.Message_Body[] mContent = new CEnum.Message_Body[5]; mContent[0].eName = CEnum.TagName.SDO_SendUserID; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = TxtReciveAccount.Text; mContent[1].eName = CEnum.TagName.SDO_ReceiveNick; mContent[1].eTag = CEnum.TagFormat.TLV_STRING; mContent[1].oContent = TxtSenderAccount.Text; mContent[2].eName = CEnum.TagName.SDO_ServerIP; mContent[2].eTag = CEnum.TagFormat.TLV_STRING; mContent[2].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[3].eName = CEnum.TagName.Index; mContent[3].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[3].oContent = 1; mContent[4].eName = CEnum.TagName.PageSize; mContent[4].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[4].oContent = Operation_Kart.iPageSize; CEnum.Message_Body[,] mResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.SDO_ITEMSHOP_TRADE_QUERY, mContent); if (mResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show(mResult[0, 0].oContent.ToString()); return; } Operation_Kart.BuildDataTable(this.m_ClientEvent, mResult, GrdResult, out iPageCount); if (iPageCount <= 0) { PnlPage.Visible = false; } else { for (int i = 0; i < iPageCount; i++) { CmbPage.Items.Add(i + 1); } CmbPage.SelectedIndex = 0; bFirst = true; PnlPage.Visible = true; } } else { MessageBox.Show("请输入要发送口令的帐号!"); } }
private void CmbPage_SelectedIndexChanged(object sender, EventArgs e) { if (bFirst) { CEnum.Message_Body[] mContent = new CEnum.Message_Body[7]; mContent[0].eName = CEnum.TagName.SDO_Account; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = TxtAccount.Text; mContent[1].eName = CEnum.TagName.SDO_ServerIP; mContent[1].eTag = CEnum.TagFormat.TLV_STRING; mContent[1].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[2].eName = CEnum.TagName.SDO_MoneyType; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; if (CmbType.Text == "M币") { mContent[2].oContent = 1; } else if (CmbType.Text == "G币") { mContent[2].oContent = 0; } else { mContent[2].oContent = 2; } mContent[3].eName = CEnum.TagName.SDO_BeginTime; mContent[3].eTag = CEnum.TagFormat.TLV_DATE; mContent[3].oContent = DtpBegin.Value; mContent[4].eName = CEnum.TagName.SDO_EndTime; mContent[4].eTag = CEnum.TagFormat.TLV_DATE; mContent[4].oContent = DtpEnd.Value; mContent[5].eName = CEnum.TagName.Index; mContent[5].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[5].oContent = (int.Parse(CmbPage.Text) - 1) * Operation_Kart.iPageSize + 1;; mContent[6].eName = CEnum.TagName.PageSize; mContent[6].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[6].oContent = Operation_Kart.iPageSize; CEnum.Message_Body[,] mResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.SDO_CONSUME_QUERY, mContent); Operation_Kart.BuildDataTable(this.m_ClientEvent, mResult, GrdResult, out iPageCount); } }
private void Btn_Search_Click(object sender, EventArgs e) { LblUser.Text = ""; PnlInput.Visible = true; GrdList.DataSource = null; CmbPage.Items.Clear(); TbcResult.SelectedTab = TpgList; CEnum.Message_Body[] mContent = new CEnum.Message_Body[3]; mContent[0].eName = CEnum.TagName.SDO_ServerIP; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[1].eName = CEnum.TagName.Index; mContent[1].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[1].oContent = 1; mContent[2].eName = CEnum.TagName.PageSize; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[2].oContent = Operation_Kart.iPageSize; CEnum.Message_Body[,] mGetResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.SDO_MEMBERBANISHMENT_QUERY, mContent); //无内容显示 if (mGetResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show(mGetResult[0, 0].oContent.ToString()); return; } Operation_Kart.BuildDataTable(this.m_ClientEvent, mGetResult, GrdList, out iPageCount); if (iPageCount <= 0) { PnlPage.Visible = false; } else { for (int i = 0; i < iPageCount; i++) { CmbPage.Items.Add(i + 1); } CmbPage.SelectedIndex = 0; bFirst = true; PnlPage.Visible = true; } }
private void GrdList_CellClick(object sender, DataGridViewCellEventArgs e) { DataTable mTable = (DataTable)GrdList.DataSource; try { iUserID = int.Parse(mTable.Rows[e.RowIndex][0].ToString()); strUserNick = mTable.Rows[e.RowIndex][1].ToString(); LblUser.Text = "准备封停的帐号为:" + strUserNick; TxtNick.Text = strUserNick; TbcResult.SelectedTab = TpgClose; CEnum.Message_Body[] mMemo = new CEnum.Message_Body[2]; mMemo[0].eName = CEnum.TagName.SDO_ServerIP; mMemo[0].eTag = CEnum.TagFormat.TLV_STRING; mMemo[0].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mMemo[1].eName = CEnum.TagName.SDO_Account; mMemo[1].eTag = CEnum.TagFormat.TLV_STRING; mMemo[1].oContent = strUserNick; CEnum.Message_Body[,] mGetResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.SDO_MEMBERLOCAL_BANISHMENT, mMemo); if (mGetResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { TxtMemo.Text = mGetResult[0, 0].oContent.ToString(); } else { TxtMemo.Text = mGetResult[0, 2].oContent.ToString(); } if (strUserNick != null) { PnlInput.Visible = true; } } catch { MessageBox.Show("请重新选择一个用户!"); } }
private void ItmDelete_Click(object sender, EventArgs e) { if (iBoardID == -1) { MessageBox.Show("请选择一条记录!"); return; } C_Global.CEnum.Message_Body[] mContent = new CEnum.Message_Body[3]; mContent[0].eName = CEnum.TagName.CR_ServerIP; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[1].eName = CEnum.TagName.UserByID; mContent[1].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[1].oContent = int.Parse(m_ClientEvent.GetInfo("USERID").ToString()); mContent[2].eName = CEnum.TagName.CR_BoardID; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[2].oContent = iBoardID; CEnum.Message_Body[,] mResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.CR_CALLBOARD_DELETE, mContent); if (mResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show(mResult[0, 0].oContent.ToString()); return; } if (mResult[0, 0].eName == CEnum.TagName.Status && mResult[0, 0].oContent.Equals("FAILURE")) { MessageBox.Show("公告删除失败,请稍候再试!"); } else { MessageBox.Show("公告删除成功!"); GetGridContent(); } }
private void GetChannelList() { //请求频道名称 CEnum.Message_Body[] mContent = new CEnum.Message_Body[1]; mContent[0].eName = CEnum.TagName.CR_ServerIP; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mChannelInfo = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.CR_CHANNEL_QUERY, mContent); if (mChannelInfo[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show(mChannelInfo[0, 0].oContent.ToString()); return; } for (int i = 0; i < mChannelInfo.GetLength(0); i++) { TxtCode.Items.Add(mChannelInfo[i, 0].oContent.ToString()); } }
private void CmbPage_SelectedIndexChanged(object sender, EventArgs e) { if (bFirst) { CEnum.Message_Body[] mContent = new CEnum.Message_Body[3]; mContent[0].eName = CEnum.TagName.SDO_ServerIP; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[1].eName = CEnum.TagName.Index; mContent[1].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[1].oContent = (int.Parse(CmbPage.Text) - 1) * Operation_Kart.iPageSize + 1; mContent[2].eName = CEnum.TagName.PageSize; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[2].oContent = Operation_Kart.iPageSize; CEnum.Message_Body[,] mGetResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.SDO_MEMBERBANISHMENT_QUERY, mContent); Operation_Kart.BuildDataTable(this.m_ClientEvent, mGetResult, GrdList, out iPageCount); } }
private void CmbPage_SelectedIndexChanged(object sender, EventArgs e) { if (bFirst) { CEnum.Message_Body[] mContent = new CEnum.Message_Body[5]; mContent[0].eName = CEnum.TagName.SDO_SendUserID; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = TxtReciveAccount.Text; mContent[1].eName = CEnum.TagName.SDO_ReceiveNick; mContent[1].eTag = CEnum.TagFormat.TLV_STRING; mContent[1].oContent = TxtSenderAccount.Text; mContent[2].eName = CEnum.TagName.SDO_ServerIP; mContent[2].eTag = CEnum.TagFormat.TLV_STRING; mContent[2].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[3].eName = CEnum.TagName.Index; mContent[3].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[3].oContent = (int.Parse(CmbPage.Text) - 1) * Operation_Kart.iPageSize + 1; mContent[4].eName = CEnum.TagName.PageSize; mContent[4].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[4].oContent = Operation_Kart.iPageSize; CEnum.Message_Body[,] mResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.SDO_ITEMSHOP_TRADE_QUERY, mContent); if (mResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show(mResult[0, 0].oContent.ToString()); return; } Operation_Kart.BuildDataTable(this.m_ClientEvent, mResult, GrdResult, out iPageCount); } }
private void BtnPost_Click_1(object sender, EventArgs e) { if (TxtAccount.Text.Trim().Length > 0) { if (MessageBox.Show("确认将服务器" + CmbServer.Text + "中的帐号" + TxtAccount.Text + "停封吗?", "停封帐号", MessageBoxButtons.YesNo) == DialogResult.Yes) { CEnum.Message_Body[,] mResult = null; CEnum.Message_Body[] mContent = new CEnum.Message_Body[4]; mContent[0].eName = CEnum.TagName.SDO_ServerIP; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[1].eName = CEnum.TagName.SDO_Account; mContent[1].eTag = CEnum.TagFormat.TLV_STRING; mContent[1].oContent = TxtAccount.Text; mContent[2].eName = CEnum.TagName.UserByID; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[2].oContent = int.Parse(m_ClientEvent.GetInfo("USERID").ToString()); mContent[3].eName = CEnum.TagName.SDO_REASON; mContent[3].eTag = CEnum.TagFormat.TLV_STRING; mContent[3].oContent = TxtContent.Text; mResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.SDO_MEMBERSTOPSTATUS_QUERY, mContent); if (mResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { //MessageBox.Show("操作失败!"); MessageBox.Show(mResult[0, 0].oContent.ToString()); return; } if (mResult[0, 0].eName == CEnum.TagName.SDO_StopStatus && mResult[0, 0].oContent.ToString() == "0") { mResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.SDO_ACCOUNT_CLOSE, mContent); if (mResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { //MessageBox.Show("操作失败!"); MessageBox.Show(mResult[0, 0].oContent.ToString()); return; } if (mResult[0, 0].eName == CEnum.TagName.Status && mResult[0, 0].oContent.Equals("FAILURE")) //if (mResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show("操作失败!"); return; } else { MessageBox.Show("操作成功,该帐号已经成功被停封!"); TxtAccount.Text = ""; TxtContent.Text = ""; } } else { MessageBox.Show("该帐号已经被停封,不能再次处理!"); } mContent = new CEnum.Message_Body[3]; mContent[0].eName = CEnum.TagName.SDO_ServerIP; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[1].eName = CEnum.TagName.Index; mContent[1].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[1].oContent = 1; mContent[2].eName = CEnum.TagName.PageSize; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[2].oContent = Operation_Kart.iPageSize; CEnum.Message_Body[,] mGetResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.SDO_MEMBERBANISHMENT_QUERY, mContent); //无内容显示 if (mGetResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show(mGetResult[0, 0].oContent.ToString()); return; } Operation_Kart.BuildDataTable(this.m_ClientEvent, mGetResult, GrdList, out iPageCount); TxtAccount.Clear(); TxtContent.Clear(); TxtMemo.Clear(); } } else { MessageBox.Show("请输入帐号!"); } }
private void BtnSave_Click_1(object sender, EventArgs e) { strUserNick = TxtNick.Text.Trim(); if (strUserNick != null && strUserNick != "") { if (MessageBox.Show("解封帐号", "确认将该用户解封吗?", MessageBoxButtons.YesNo) == DialogResult.Yes) { CEnum.Message_Body[] mContent = new CEnum.Message_Body[3]; mContent[0].eName = CEnum.TagName.SDO_ServerIP; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[1].eName = CEnum.TagName.SDO_Account; mContent[1].eTag = CEnum.TagFormat.TLV_STRING; mContent[1].oContent = strUserNick; mContent[2].eName = CEnum.TagName.UserByID; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[2].oContent = int.Parse(m_ClientEvent.GetInfo("USERID").ToString()); CEnum.Message_Body[,] mResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.SDO_ACCOUNT_OPEN, mContent); if (mResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show(mResult[0, 0].oContent.ToString()); return; } if (mResult[0, 0].eName == CEnum.TagName.Status && mResult[0, 0].oContent.Equals("FAILURE")) { MessageBox.Show("操作失败!"); } else { MessageBox.Show("操作成功,该帐号已经成功被解封!"); } PnlInput.Visible = false; mContent = new CEnum.Message_Body[3]; mContent[0].eName = CEnum.TagName.SDO_ServerIP; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[1].eName = CEnum.TagName.Index; mContent[1].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[1].oContent = 1; mContent[2].eName = CEnum.TagName.PageSize; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[2].oContent = Operation_Kart.iPageSize; CEnum.Message_Body[,] mGetResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.SDO_MEMBERBANISHMENT_QUERY, mContent); //无内容显示 if (mGetResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show(mGetResult[0, 0].oContent.ToString()); return; } Operation_Kart.BuildDataTable(this.m_ClientEvent, mGetResult, GrdList, out iPageCount); TxtAccount.Clear(); TxtContent.Clear(); TxtMemo.Clear(); } } else { MessageBox.Show("请输入帐号名称!"); } }
private void button4_Click(object sender, EventArgs e) { if (iBoardID == -1) { MessageBox.Show("请选择一条记录!"); return; } C_Global.CEnum.Message_Body[] mContent = new CEnum.Message_Body[4]; mContent[0].eName = CEnum.TagName.CR_ServerIP; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[1].eName = CEnum.TagName.UserByID; mContent[1].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[1].oContent = int.Parse(m_ClientEvent.GetInfo("USERID").ToString()); mContent[2].eName = CEnum.TagName.CR_BoardID; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[2].oContent = iBoardID; mContent[3].eName = CEnum.TagName.CR_Channel; mContent[3].eTag = CEnum.TagFormat.TLV_STRING; for (int i = 0; i < TxtCode.CheckedItems.Count; i++) { mContent[3].oContent = TxtCode.CheckedItems[i].ToString() + "," + mContent[3].oContent; } CEnum.Message_Body[,] mResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.CR_ERRORCHANNEL_QUERY, mContent); if (mResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show(mResult[0, 0].oContent.ToString()); return; } if (mResult[0, 0].oContent.ToString() != "FAILURE" && mResult[0, 0].oContent.ToString() != "SUCESS" || mResult == null) { MessageBox.Show("添加频道" + mResult[0, 0].oContent.ToString().Remove(0, 2) + "失败,请选择公告ID和频道号再次添加"); label2.Text = "添加频道" + mResult[0, 0].oContent.ToString().Remove(0, 2) + "失败"; string[] arrChannel = mResult[0, 0].oContent.ToString().Remove(0, 2).Split(','); GetGridContent(); for (int i = 0; i < TxtCode.Items.Count; i++) { TxtCode.SetItemChecked(i, false); } ArrayList arr = new ArrayList(); arr = ChannelIndex(arrChannel); for (int i = 0; i < TxtCode.Items.Count; i++) { for (int x = 0; x < arr.Count; x++) { if (i == int.Parse(arr[x].ToString())) { TxtCode.SetItemChecked(i, true); } } } button4.Visible = true; } else { MessageBox.Show("重置频道信息成功"); label2.Text = ""; GetChannelList(); TxtContent.Clear(); TxtIID.Clear(); TxtSpeed.Clear(); TxtColor.Clear(); ChkPlay.Checked = false; ChkStatus.Checked = false; GrpInput.Visible = false; GetGridContent(); button4.Visible = false; } }
private void GetGridContent() { try { GrdList.DataSource = null; CmbPage.Items.Clear(); bFirst = false; ItmEdit.Enabled = false; ItmDelete.Enabled = false; C_Global.CEnum.Message_Body[] mContent = new CEnum.Message_Body[6]; mContent[0].eName = CEnum.TagName.CR_ServerIP; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[1].eName = CEnum.TagName.CR_ValidTime; mContent[1].eTag = CEnum.TagFormat.TLV_TIMESTAMP; mContent[1].oContent = Convert.ToDateTime(DtpDate.Text); try { mContent[2].eName = CEnum.TagName.CR_PublishID; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[2].oContent = int.Parse(TxtID.Text.Trim()); } catch { mContent[2].eName = CEnum.TagName.CR_PublishID; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[2].oContent = 0; } mContent[3].eName = CEnum.TagName.CR_ACTION; mContent[3].eTag = CEnum.TagFormat.TLV_INTEGER; if (ChkOpen.Checked && !ChkClose.Checked) { mContent[3].oContent = 1; } else if (!ChkOpen.Checked && ChkClose.Checked) { mContent[3].oContent = 0; } else if (ChkOpen.Checked && ChkClose.Checked) { mContent[3].oContent = 2; } else { mContent[3].oContent = 2; } mContent[4].eName = CEnum.TagName.Index; mContent[4].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[4].oContent = 1; mContent[5].eName = CEnum.TagName.PageSize; mContent[5].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[5].oContent = Operation_Kart.iPageSize; CEnum.Message_Body[,] mResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.CR_CALLBOARD_QUERY, mContent); if (mResult[0, 0].eName == C_Global.CEnum.TagName.ERROR_Msg) { MessageBox.Show(mResult[0, 0].oContent.ToString()); return; } Operation_Kart.BuildDataTable(this.m_ClientEvent, mResult, GrdList, out iPageCount); if (iPageCount <= 0) { PnlPage.Visible = false; } else { for (int i = 0; i < iPageCount; i++) { CmbPage.Items.Add(i + 1); } CmbPage.SelectedIndex = 0; bFirst = true; PnlPage.Visible = true; } ItmEdit.Enabled = true; ItmDelete.Enabled = true; GrdList.Columns[10].HeaderText = "发布状态"; GrdList.Columns[11].Visible = false; GrdList.Columns[2].Visible = false; GrdList.Columns[3].Visible = false; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void CmbPage_SelectedIndexChanged(object sender, EventArgs e) { if (bFirst) { C_Global.CEnum.Message_Body[] mContent = new CEnum.Message_Body[6]; mContent[0].eName = CEnum.TagName.CR_ServerIP; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[1].eName = CEnum.TagName.CR_ValidTime; mContent[1].eTag = CEnum.TagFormat.TLV_TIMESTAMP; mContent[1].oContent = Convert.ToDateTime(DtpDate.Text); try { mContent[2].eName = CEnum.TagName.CR_PublishID; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[2].oContent = int.Parse(TxtID.Text.Trim()); } catch { mContent[2].eName = CEnum.TagName.CR_PublishID; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[2].oContent = 0; } mContent[3].eName = CEnum.TagName.CR_ACTION; mContent[3].eTag = CEnum.TagFormat.TLV_INTEGER; if (ChkOpen.Checked && !ChkClose.Checked) { mContent[3].oContent = 1; } else if (!ChkOpen.Checked && ChkClose.Checked) { mContent[3].oContent = 0; } else if (ChkOpen.Checked && ChkClose.Checked) { mContent[3].oContent = 2; } else { mContent[3].oContent = 2; } mContent[4].eName = CEnum.TagName.Index; mContent[4].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[4].oContent = (int.Parse(CmbPage.Text) - 1) * Operation_Kart.iPageSize + 1; mContent[5].eName = CEnum.TagName.PageSize; mContent[5].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[5].oContent = Operation_Kart.iPageSize; CEnum.Message_Body[,] mResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.CR_CALLBOARD_QUERY, mContent); Operation_Kart.BuildDataTable(this.m_ClientEvent, mResult, GrdList, out iPageCount); GrdList.Columns[11].Visible = false; GrdList.Columns[2].Visible = false; GrdList.Columns[3].Visible = false; } }
private void button1_Click(object sender, EventArgs e) { CEnum.Message_Body[] mContent; if (iOperation == 1) { mContent = new CEnum.Message_Body[14]; } else if (iOperation == 2) { mContent = new CEnum.Message_Body[15]; } else { MessageBox.Show("请检查您的操作步骤!"); return; } if (Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text) != null) { mContent[0].eName = CEnum.TagName.CR_ServerIP; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); } else { MessageBox.Show("请先选择一个服务器!"); return; } mContent[1].eName = CEnum.TagName.CR_ValidTime; mContent[1].eTag = CEnum.TagFormat.TLV_TIMESTAMP; mContent[1].oContent = Convert.ToDateTime(DptStart.Text); mContent[2].eName = CEnum.TagName.CR_InValidTime; mContent[2].eTag = CEnum.TagFormat.TLV_TIMESTAMP; mContent[2].oContent = Convert.ToDateTime(DptStop.Text); if (TxtColor.Text.Trim().Length <= 0) { MessageBox.Show("请选择公告的颜色!"); return; } mContent[3].eName = CEnum.TagName.CR_BoardColor; mContent[3].eTag = CEnum.TagFormat.TLV_STRING; mContent[3].oContent = TxtColor.Text; mContent[4].eName = CEnum.TagName.CR_DayLoop; mContent[4].eTag = CEnum.TagFormat.TLV_INTEGER; if (ChkPlay.Checked) { mContent[4].oContent = 1; } else { mContent[4].oContent = 0; } try { mContent[5].eName = CEnum.TagName.CR_PublishID; mContent[5].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[5].oContent = int.Parse(m_ClientEvent.GetInfo("USERID").ToString()); } catch { MessageBox.Show("请输入发布人ID,只能为数字!"); return; } try { mContent[6].eName = CEnum.TagName.CR_SPEED; mContent[6].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[6].oContent = int.Parse(TxtSpeed.Text.Trim()); } catch { MessageBox.Show("请输入播放速度,只能为数字!"); return; } try { mContent[7].eName = CEnum.TagName.CR_Mode; mContent[7].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[7].oContent = int.Parse(TxtCode.Text.Trim()); } catch { mContent[7].eName = CEnum.TagName.CR_Mode; mContent[7].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[7].oContent = 0; } try { mContent[8].eName = CEnum.TagName.CR_BoardContext; mContent[8].eTag = CEnum.TagFormat.TLV_STRING; mContent[8].oContent = TxtContent.Text.Trim().Substring(0, 75); } catch { mContent[8].eName = CEnum.TagName.CR_BoardContext; mContent[8].eTag = CEnum.TagFormat.TLV_STRING; mContent[8].oContent = TxtContent.Text.Trim(); } try { mContent[9].eName = CEnum.TagName.CR_BoardContext1; mContent[9].eTag = CEnum.TagFormat.TLV_STRING; mContent[9].oContent = TxtContent.Text.Trim().Substring(75, 150); } catch { try { mContent[9].eName = CEnum.TagName.CR_BoardContext1; mContent[9].eTag = CEnum.TagFormat.TLV_STRING; mContent[9].oContent = TxtContent.Text.Trim().Substring(75, TxtContent.Text.Trim().Length - 75); } catch { mContent[9].eName = CEnum.TagName.CR_BoardContext1; mContent[9].eTag = CEnum.TagFormat.TLV_STRING; mContent[9].oContent = ""; } } try { mContent[10].eName = CEnum.TagName.CR_BoardContext2; mContent[10].eTag = CEnum.TagFormat.TLV_STRING; mContent[10].oContent = TxtContent.Text.Trim().Substring(150, 220); } catch { try { mContent[10].eName = CEnum.TagName.CR_BoardContext2; mContent[10].eTag = CEnum.TagFormat.TLV_STRING; mContent[10].oContent = TxtContent.Text.Trim().Substring(150, TxtContent.Text.Trim().Length - 220); } catch { mContent[10].eName = CEnum.TagName.CR_BoardContext2; mContent[10].eTag = CEnum.TagFormat.TLV_STRING; mContent[10].oContent = ""; } } mContent[11].eName = CEnum.TagName.UserByID; mContent[11].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[11].oContent = int.Parse(m_ClientEvent.GetInfo("USERID").ToString()); mContent[12].eName = CEnum.TagName.CR_STATUS; mContent[12].eTag = CEnum.TagFormat.TLV_INTEGER; if (ChkStatus.Checked) { mContent[12].oContent = 1; } else { mContent[12].oContent = 0; } if (TxtCode.CheckedItems.Count <= 0) { MessageBox.Show("请选择要发布的频道!"); return; } mContent[13].eName = CEnum.TagName.CR_Channel; mContent[13].eTag = CEnum.TagFormat.TLV_STRING; for (int i = 0; i < TxtCode.CheckedItems.Count; i++) { /* * if (i == TxtCode.CheckedItems.Count || i == 0) * { * mContent[11].oContent = mContent[11].oContent + TxtCode.CheckedItems[i].ToString(); * } * else * { * mContent[11].oContent = mContent[11].oContent + "," + TxtCode.CheckedItems[i].ToString(); * }GetChannelID */ mContent[13].oContent = TxtCode.CheckedItems[i].ToString() + "," + mContent[13].oContent; //mContent[13].oContent = GetChannelID(TxtCode.CheckedItems[i].ToString()) + "," + mContent[13].oContent; } CEnum.Message_Body[,] mResult = null; string strMessageS = string.Empty; string strMessageF = string.Empty; if (iOperation == 1) { mResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.CR_CALLBOARD_CREATE, mContent); strMessageF = "添加公告失败!"; strMessageS = "信息添加成功!"; } else if (iOperation == 2) { mContent[14].eName = CEnum.TagName.CR_BoardID; mContent[14].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[14].oContent = iBoardID; mResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.CR_CALLBOARD_UPDATE, mContent); strMessageF = "修改公告失败!"; strMessageS = "信息修改成功!"; } else { MessageBox.Show("请检查你的操作步骤!"); return; } if (mResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show(mResult[0, 0].oContent.ToString()); return; } if (mResult[0, 0].oContent.ToString() != "FAILURE" && mResult[0, 0].oContent.ToString() != "SUCESS" || mResult == null) { MessageBox.Show("添加频道" + mResult[0, 0].oContent.ToString().Remove(0, 2) + "失败,请选择公告ID和频道号再次添加"); label2.Text = "添加频道" + mResult[0, 0].oContent.ToString().Remove(0, 2) + "失败"; string[] arrChannel = mResult[0, 0].oContent.ToString().Remove(0, 2).Split(','); GetGridContent(); button4.Visible = true; for (int i = 0; i < TxtCode.Items.Count; i++) { TxtCode.SetItemChecked(i, false); } ArrayList arr = new ArrayList(); arr = ChannelIndex(arrChannel); for (int i = 0; i < TxtCode.Items.Count; i++) { for (int x = 0; x < arr.Count; x++) { if (i == int.Parse(arr[x].ToString())) { TxtCode.SetItemChecked(i, true); } } } } else { MessageBox.Show(strMessageS); label2.Text = ""; GetChannelList(); TxtContent.Clear(); TxtIID.Clear(); TxtSpeed.Clear(); TxtColor.Clear(); ChkPlay.Checked = false; ChkStatus.Checked = false; GrpInput.Visible = false; GetGridContent(); button4.Visible = false; } }
private void BtnSearch_Click(object sender, EventArgs e) { GrdResult.DataSource = null; CmbPage.Items.Clear(); LblTotal.Text = ""; if (TxtAccount.Text.Trim().Length > 0) { GrdResult.DataSource = null; CEnum.Message_Body[] mContent = new CEnum.Message_Body[7]; mContent[0].eName = CEnum.TagName.SDO_Account; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = TxtAccount.Text; mContent[1].eName = CEnum.TagName.SDO_ServerIP; mContent[1].eTag = CEnum.TagFormat.TLV_STRING; mContent[1].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[2].eName = CEnum.TagName.SDO_MoneyType; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; if (CmbType.Text == "M币") { mContent[2].oContent = 1; } else if (CmbType.Text == "G币") { mContent[2].oContent = 0; } else { mContent[2].oContent = 2; } mContent[3].eName = CEnum.TagName.SDO_BeginTime; mContent[3].eTag = CEnum.TagFormat.TLV_DATE; mContent[3].oContent = DtpBegin.Value; mContent[4].eName = CEnum.TagName.SDO_EndTime; mContent[4].eTag = CEnum.TagFormat.TLV_DATE; mContent[4].oContent = DtpEnd.Value; mContent[5].eName = CEnum.TagName.Index; mContent[5].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[5].oContent = 1; mContent[6].eName = CEnum.TagName.PageSize; mContent[6].eTag = CEnum.TagFormat.TLV_INTEGER; mContent[6].oContent = Operation_Kart.iPageSize; CEnum.Message_Body[,] mResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.SDO_CONSUME_QUERY, mContent); if (mResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show(mResult[0, 0].oContent.ToString()); return; } Operation_Kart.BuildDataTable(this.m_ClientEvent, mResult, GrdResult, out iPageCount); if (iPageCount <= 0) { PnlPage.Visible = false; } else { for (int i = 0; i < iPageCount; i++) { CmbPage.Items.Add(i + 1); } CmbPage.SelectedIndex = 0; bFirst = true; PnlPage.Visible = true; } //合计 mContent = new CEnum.Message_Body[5]; mContent[0].eName = CEnum.TagName.SDO_Account; mContent[0].eTag = CEnum.TagFormat.TLV_STRING; mContent[0].oContent = TxtAccount.Text; mContent[1].eName = CEnum.TagName.SDO_ServerIP; mContent[1].eTag = CEnum.TagFormat.TLV_STRING; mContent[1].oContent = Operation_Kart.GetItemAddr(mServerInfo, CmbServer.Text); mContent[2].eName = CEnum.TagName.SDO_MoneyType; mContent[2].eTag = CEnum.TagFormat.TLV_INTEGER; if (CmbType.Text == "M币") { mContent[2].oContent = 1; } else if (CmbType.Text == "G币") { mContent[2].oContent = 0; } else { mContent[2].oContent = 2; } mContent[3].eName = CEnum.TagName.SDO_BeginTime; mContent[3].eTag = CEnum.TagFormat.TLV_DATE; mContent[3].oContent = DtpBegin.Value; mContent[4].eName = CEnum.TagName.SDO_EndTime; mContent[4].eTag = CEnum.TagFormat.TLV_DATE; mContent[4].oContent = DtpEnd.Value; if (mResult[0, 0].eName == CEnum.TagName.ERROR_Msg) { MessageBox.Show(mResult[0, 0].oContent.ToString()); return; } mResult = Operation_Kart.GetResult(this.m_ClientEvent, CEnum.ServiceKey.SDO_USERCONSUMESUM_QUERY, mContent); LblTotal.Text = "合计:" + mResult[0, 0].oContent.ToString(); } else { MessageBox.Show("请输入玩家帐号!"); } }