Exemplo n.º 1
0
        public void UpdateData()
        {
            lvDataView.Clear();
            int       rtn = 0;
            DataTable dt;

            rtn = mWDataToolClass.SelectShowParameter(out dt, GroupName);
            if (rtn != 0)
            {
                MessageBox.Show("SelectShowAxis");
            }
            lvDataView.Columns.Add("参数名称", 120, HorizontalAlignment.Left);
            lvDataView.Columns.Add("参数值", 80, HorizontalAlignment.Center);
            lvDataView.Columns.Add("备注", 200, HorizontalAlignment.Center);



            string        mGroupName = "";
            ListViewGroup mHeader    = new ListViewGroup();
            ListViewItem  mLvi;

            foreach (DataRow row in dt.Rows)
            {
                //创建列表组名并添加
                if (mGroupName != row[0].ToString())
                {
                    mGroupName              = row[0].ToString();
                    mHeader                 = new ListViewGroup();
                    mHeader.Header          = mGroupName;
                    mHeader.HeaderAlignment = HorizontalAlignment.Left;
                    lvDataView.Groups.Add(mHeader);
                    lvDataView.ShowGroups = true;
                }
                //添加数据
                mLvi = new ListViewItem();
                mLvi.UseItemStyleForSubItems = false;//设置可以改变单元格背景颜色
                mLvi.Text = row[1].ToString();
                mLvi.SubItems.Add(row[2].ToString());
                mLvi.SubItems.Add(row[3].ToString());
                //添加到列表
                mHeader.Items.Add(mLvi);
                lvDataView.Items.Add(mLvi);
            }
        }
Exemplo n.º 2
0
        public void ConInit(WDataToolClass mWDataToolClass)
        {
            this.mWDataToolClass = mWDataToolClass;

            int rtn = 0;

            rtn = mWDataToolClass.SelectShowModel("", ref cbWcfData);
            if (rtn != 0)
            {
                MessageBox.Show("SelectShowModel");
            }
            UpdateCorrAxis();
            rtn = mWDataToolClass.SelectShowParameter(ref dgvParameter);
            if (rtn != 0)
            {
                MessageBox.Show("SelectShowAxis");
            }
        }
Exemplo n.º 3
0
        private void cbWcfData_SelectedIndexChanged(object sender, EventArgs e)
        {
            int rtn = 0;

            if (mWcfDataName != cbWcfData.Text.ToString())
            {
                mWcfDataName = cbWcfData.Text.ToString();
                rtn          = mWDataToolClass.SelectShowModel(mWcfDataName, ref cbWcfData);
                if (rtn != 0)
                {
                    MessageBox.Show("切换机种失败");
                }
                rtn = mWDataToolClass.SelectShowParameter(ref dgvParameter);
                if (rtn != 0)
                {
                    MessageBox.Show("SelectShowAxis");
                }
            }
        }