public void Init(CodePeriodListChooser codePackageInfo) { this.codePackageInfo = codePackageInfo; this.tbStart.Text = this.codePackageInfo.Start.ToString(); this.tbEnd.Text = this.codePackageInfo.End.ToString(); this.RefreshGrid(codePackageInfo); }
private void InitCodePackage(ChartComponent chartComponent) { IDataPackage_Code dataPackage = chartComponent.Controller.CurrentNavigater.DataPackage; CodePeriodListChooser codePackageInfo = new CodePeriodListChooser(); codePackageInfo.Codes.Add(dataPackage.Code); codePackageInfo.Start = dataPackage.StartDate; codePackageInfo.End = dataPackage.EndDate; this.compCodePackage1.Init(codePackageInfo); }
private void btCodePackage_Click(object sender, EventArgs e) { CodePeriodListChooser codePackage = new CodePeriodListChooser(); codePackage.Start = 20160101; codePackage.End = 20170101; codePackage.CodeChooseMethod = CodeChooseMethod.Maincontract; codePackage.Codes.Add("RB"); FormCodePackage form = new FormCodePackage(codePackage); DialogResult result = form.ShowDialog(); if (result == DialogResult.OK) { MessageBox.Show(codePackage.ToString()); } }
public void TestCodePackageCreate_Catelog() { CodePeriodListChooser codePackageInfo = new CodePeriodListChooser(); codePackageInfo.CodeChooseMethod = CodeChooseMethod.Catelog; codePackageInfo.Codes.Add("RB"); codePackageInfo.Codes.Add("M"); codePackageInfo.Codes.Add("A"); codePackageInfo.Start = 20170101; codePackageInfo.End = 20180101; IDataReader dataReader = TestDataCenter.Instance.DataReader; CodePeriodFactory fac = new CodePeriodFactory(dataReader); ICodePeriodList codePackage = fac.CreateCodePeriodList(codePackageInfo); Console.WriteLine(codePackage); }
public void TestCodePackageCreate_Normal() { CodePeriodListChooser codePackageInfo = new CodePeriodListChooser(); codePackageInfo.CodeChooseMethod = CodeChooseMethod.Normal; codePackageInfo.Codes.Add("RB1705"); codePackageInfo.Codes.Add("RB1709"); codePackageInfo.Codes.Add("RB1801"); codePackageInfo.Start = 20170101; codePackageInfo.End = 20180101; IDataReader dataReader = TestDataCenter.Instance.DataReader; CodePeriodFactory fac = new CodePeriodFactory(dataReader); ICodePeriodList codePackage = fac.CreateCodePeriodList(codePackageInfo); Assert.AreEqual(3, codePackage.CodePeriods.Count); Assert.AreEqual(20170101, codePackage.CodePeriods[0].StartDate); }
public FormCodePackageSelected(CodePeriodListChooser codePackageInfo) { InitializeComponent(); this.codeTree1.MultiSelect = true; this.codeTree1.Init(); this.codePackageInfo = codePackageInfo; if (this.codePackageInfo.CodeChooseMethod == CodeChooseMethod.Maincontract) { this.cbChooseType.SelectedIndex = 2; } else if (this.codePackageInfo.CodeChooseMethod == CodeChooseMethod.Catelog) { this.cbChooseType.SelectedIndex = 1; } else { this.cbChooseType.SelectedIndex = 0; } }
private void RefreshGrid(CodePeriodListChooser codePackageInfo) { string title = "合约"; if (codePackageInfo.CodeChooseMethod == CodeChooseMethod.Maincontract) { title = "主合约品种"; } else if (codePackageInfo.CodeChooseMethod == CodeChooseMethod.Catelog) { title = "品种"; } this.gridCodes.Columns[0].HeaderText = title; this.gridCodes.Rows.Clear(); for (int i = 0; i < codePackageInfo.Codes.Count; i++) { this.gridCodes.Rows.Add(codePackageInfo.Codes[i]); } }
public FormStrategy(CodePeriodListChooser codePackageInfo, IStrategyData strategyData, IStrategyDrawer drawer) { this.codePackageInfo = codePackageInfo; this.strategyData = strategyData; }
private void btOK_Click(object sender, EventArgs e) { this.codePackageInfo = this.compCodePackage1.CodePackage; this.DialogResult = DialogResult.OK; this.Close(); }
private void Init(CodePeriodListChooser dataPackageInfo) { this.compCodePackage1.Init(dataPackageInfo); }
public FormCodePackage(CodePeriodListChooser codePackageInfo) { InitializeComponent(); this.codePackageInfo = codePackageInfo; this.Init(codePackageInfo); }