Example #1
0
        private void LoadAllData()
        {
            _tempDataSource.Clear();
            _spotDataSource.Clear();

            var items = _templateBLL.GetTemplates();

            if (items != null)
            {
                foreach (var item in items)
                {
                    _tempDataSource.Add(item);
                }

                if (items.Count > 0)
                {
                    LoadTemplateStock(items[0].TemplateId);
                }
            }

            _securityInfoList = SecurityInfoManager.Instance.Get();
            _benchmarkList    = _benchmarkBLL.GetAll();

            SetCurrentTemplate();
        }
Example #2
0
        private bool LoadBenchmark()
        {
            var         benchmarks = _benchmarkBLL.GetAll();
            ComboOption cbOption   = new ComboOption
            {
                Items = new List <ComboOptionItem>()
            };

            foreach (var benchmark in benchmarks)
            {
                ComboOptionItem item = new ComboOptionItem
                {
                    Id   = benchmark.BenchmarkId,
                    Code = benchmark.BenchmarkId,
                    Name = benchmark.BenchmarkName
                };

                cbOption.Items.Add(item);
            }

            cbOption.Selected = benchmarks[0].BenchmarkId;
            ComboBoxUtil.SetComboBox(this.cbBenchmark, cbOption);

            return(true);
        }
        private bool Form_LoadData(object sender, object data)
        {
            _tempDataSource.Clear();
            _spotDataSource.Clear();

            var items = _templateBLL.GetTemplates();

            if (items != null)
            {
                foreach (var item in items)
                {
                    _tempDataSource.Add(item);
                }

                if (items.Count > 0)
                {
                    LoadTemplateStock(items[0].TemplateId);
                }
            }

            _securityInfoList = SecurityInfoManager.Instance.Get();
            _benchmarkList    = _benchmarkBLL.GetAll();

            SetCurrentTemplate();

            return(true);
        }
Example #4
0
        private List <Benchmark> GetBenchmarks()
        {
            if (_benchmarks == null)
            {
                _benchmarks = new List <Benchmark>();
            }

            if (_benchmarks.Count == 0)
            {
                var dbItems = _benchmarkBLL.GetAll();
                if (dbItems != null && dbItems.Count > 0)
                {
                    _benchmarks.AddRange(dbItems);
                }
            }

            return(_benchmarks);
        }