/// <summary>
        /// 构造 DataGridView 列
        /// </summary>
        /// <param name="val">数据</param>
        /// <param name="mDataRow">DataRow</param>
        /// <returns>DataRow</returns>
        private static DataTable BuildRow(CSocketEvent mEvent, CEnum.Message_Body[,] val, DataTable mTable, out int PageCount)
        {
            PageCount = 0;
            for (int i = 0; i < val.GetLength(0); i++)
            {
                DataRow mRow = mTable.NewRow();

                for (int j = 0; j < val.GetLength(1); j++)
                {
                    if (val[i, j].eName != CEnum.TagName.PageCount)
                    {
                        if (val[i, j].eName == CEnum.TagName.SDO_MoneyType)
                        {
                            if (val[i, j].oContent.ToString() == "1")
                            {
                                val[i, j].oContent = "M";
                            }
                            else
                            {
                                val[i, j].oContent = "G";
                            }
                        }

                        if (val[i, j].eName == CEnum.TagName.SDO_SEX)
                        {
                            if (val[i, i].oContent.Equals("0"))
                            {
                                mRow[(string)mEvent.DecodeFieldName(val[i, j].eName)] = "女";
                            }
                            else
                            {
                                mRow[(string)mEvent.DecodeFieldName(val[i, j].eName)] = "男";
                            }
                        }

                        if (val[i, j].oContent == null)
                        {
                            mRow[(string)mEvent.DecodeFieldName(val[i, j].eName)] = "N/A";
                        }
                        else
                        {
                            mRow[(string)mEvent.DecodeFieldName(val[i, j].eName)] = val[i, j].oContent;
                        }
                    }
                    else
                    {
                        PageCount = int.Parse(val[i, j].oContent.ToString());
                    }
                }

                mTable.Rows.Add(mRow);
            }

            return(mTable);
        }
        /// <summary>
        /// 构造 DataGridView 列
        /// </summary>
        /// <param name="val">数据</param>
        /// <param name="mDataTable">DataTable</param>
        /// <returns>DataTable</returns>
        private static DataTable BuildColumn(CSocketEvent mEvent, CEnum.Message_Body[,] val)
        {
            DataTable mDataTable = new DataTable();

            for (int i = 0; i < val.GetLength(1); i++)
            {
                if (val[0, i].eName != CEnum.TagName.PageCount)
                {
                    mDataTable.Columns.Add((string)mEvent.DecodeFieldName(val[0, i].eName), typeof(string));
                }
            }

            return(mDataTable);
        }
예제 #3
0
        public UserstatFrm(CEnum.Message_Body[,] val, CSocketEvent m_ClientEvent)
        {
            InitializeComponent();

            PnlDetail.Controls.Clear();

            for (int i = 0; i < val.GetLength(1); i++)
            {
                LabelTextBox mDisplay = new LabelTextBox();
                mDisplay.Parent   = PnlDetail;
                mDisplay.Position = C_Controls.LabelTextBox.LabelTextBox.ELABELPOSITION.LEFT;
                mDisplay.Width    = 222;

                mDisplay.Top  = 20 * i + 30;
                mDisplay.Left = 44;

                mDisplay.LabelText   = m_ClientEvent.DecodeFieldName(val[0, i].eName) + "£º";
                mDisplay.TextBoxText = val[0, i].oContent.ToString();
            }
        }
예제 #4
0
        /// <summary>
        /// 构造ListView
        /// </summary>
        /// <param name="m_Event">事件类</param>
        /// <param name="mView">列表</param>
        /// <param name="mMsgBody">消息</param>
        /// <returns>列表</returns>
        public static ListView DisplayView(CSocketEvent m_Event, ListView mView, C_Global.CEnum.Message_Body[,] mMsgBody, bool isTag)
        {
            //读取用户信息
            //构造头
            try
            {
                for (int i = 0; i < mMsgBody.GetLength(1); i++)
                {
                    ColumnHeader mClmParent = new ColumnHeader();
                    mClmParent.Text = m_Event.DecodeFieldName(mMsgBody[0, i].eName);
                    mView.Columns.Add(mClmParent);
                }

                //构造内容
                for (int i = 0; i < mMsgBody.GetLength(0); i++)
                {
                    ListViewItem mItmParent   = new ListViewItem();
                    string[]     mItemContent = new string[mMsgBody.GetLength(1)];

                    for (int j = 0; j < mMsgBody.GetLength(1); j++)
                    {
                        mItemContent[j] = mMsgBody[i, j].oContent.ToString();
                    }
                    ListViewItem mlistViewItem = new ListViewItem(mItemContent, -1);

                    mView.Items.Add(mlistViewItem);
                    if (isTag)
                    {
                        mView.Items[i].Tag = mMsgBody[i, 0].oContent.ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(mView);
        }