示例#1
0
        public U50Request GetTaskRequest()
        {
            U50Request configPolicy = new U50Request();

            if (this.RadioButtonALL.Checked == true)
            {
                configPolicy.Select = U50TaskSelectType.All;
            }
            else if (this.RadioButtonSelect.Checked == true)
            {
                configPolicy.Select = U50TaskSelectType.Specify;
            }

            configPolicy.Plate   = this.ComboBoxPlate.Text;
            configPolicy.Variety = this.ComboBoxVariety.Text;

            List <Demo.Stock.X.U50.Common.U50StockInfo> stockInfoList = new List <Demo.Stock.X.U50.Common.U50StockInfo>(32);

            for (int iIndex = 0; iIndex < this.CheckedListBox.Items.Count; iIndex++)
            {
                bool bChecked = this.CheckedListBox.GetItemChecked(iIndex);

                if (bChecked == true)
                {
                    Demo.Stock.X.U50.Common.U50StockInfo stockInfo = Demo.Stock.X.U50.Common.U50StockInfo.GetStockInfo(this.CheckedListBox.Items[iIndex].ToString());

                    stockInfoList.Add(stockInfo);
                }
            }

            configPolicy.StockInfo = stockInfoList.ToArray();

            return(configPolicy);
        }
示例#2
0
        public void SetConfigPolicy(U50Request policy)
        {
            if (policy.Select == U50TaskSelectType.All)
            {
                this.RadioButtonALL.Checked = true;
            }
            else if (policy.Select == U50TaskSelectType.Specify)
            {
                this.RadioButtonSelect.Checked = true;
            }

            this.ComboBoxPlate.Text   = policy.Plate;
            this.ComboBoxVariety.Text = policy.Variety;

            foreach (var item in policy.StockInfo)
            {
                string strStockCode = Demo.Stock.X.U50.Common.U50StockInfo.GetStockInfo(item.Plate, item.Variety, item.Name, item.Symbol);
                this.CheckedListBox.Items.Add(strStockCode);
            }

            ButtonAllSelect_Click(this, EventArgs.Empty);
        }
        public void SetConfigPolicy( U50Request policy )
        {
            if ( policy.Select == U50TaskSelectType.All )
            {
                this.RadioButtonALL.Checked = true;
            }
            else if ( policy.Select == U50TaskSelectType.Specify )
            {
                this.RadioButtonSelect.Checked = true;
            }

            this.ComboBoxPlate.Text = policy.Plate;
            this.ComboBoxVariety.Text = policy.Variety;

            foreach ( var item in policy.StockInfo )
            {
                string strStockCode = Demo.Stock.X.U50.Common.U50StockInfo.GetStockInfo( item.Plate, item.Variety, item.Name, item.Symbol );
                this.CheckedListBox.Items.Add( strStockCode );
            }

            ButtonAllSelect_Click( this, EventArgs.Empty );
        }
        public U50Request GetTaskRequest()
        {
            U50Request configPolicy = new U50Request();

            if ( this.RadioButtonALL.Checked == true )
            {
                configPolicy.Select = U50TaskSelectType.All;
            }
            else if ( this.RadioButtonSelect.Checked == true )
            {
                configPolicy.Select = U50TaskSelectType.Specify;
            }

            configPolicy.Plate = this.ComboBoxPlate.Text;
            configPolicy.Variety = this.ComboBoxVariety.Text;

            List<Demo.Stock.X.U50.Common.U50StockInfo> stockInfoList = new List<Demo.Stock.X.U50.Common.U50StockInfo>( 32 );
            for ( int iIndex = 0; iIndex < this.CheckedListBox.Items.Count; iIndex++ )
            {
                bool bChecked = this.CheckedListBox.GetItemChecked( iIndex );

                if ( bChecked == true )
                {
                    Demo.Stock.X.U50.Common.U50StockInfo stockInfo = Demo.Stock.X.U50.Common.U50StockInfo.GetStockInfo( this.CheckedListBox.Items[iIndex].ToString() );

                    stockInfoList.Add( stockInfo );
                }
            }

            configPolicy.StockInfo = stockInfoList.ToArray();

            return configPolicy;
        }