Пример #1
0
        public databases.baseDS.priceDataRow getPriceDataToDay(string code)
        {
            //Gateway.ServiceConnector.InitService();
            string timeScaleCode = AppTypes.TimeScaleTypeToCode(AppTypes.TimeScaleTypes.Day);

            databases.baseDS.priceDataDataTable tbl = DataAccess.Libs.GetPriceData(code, timeScaleCode, DateTime.Now.AddDays(-1), DateTime.Today);
            return(tbl.Rows[0] as databases.baseDS.priceDataRow);
        }
Пример #2
0
        /// <summary>
        /// Showing VNIndex and HNXIndex for 2 months from now
        /// </summary>
        private void Market_Indexes()
        {
            DateTime toDate        = DateTime.Now;
            DateTime frDate        = toDate.AddMonths(-2);
            string   timeScaleCode = AppTypes.TimeScaleTypeToCode(AppTypes.TimeScaleTypes.Day);

            DrawLineChart(vnIdxChart, 0, true, "VN-IDX", frDate, toDate, timeScaleCode);
            DrawLineChart(hnxChart, 0, true, "VN30-IDX", frDate, toDate, timeScaleCode);

            //DrawLineChart(hnxChart, 0, true, "HNX-IDX", frDate, toDate, timeScaleCode);
        }
Пример #3
0
        private void loadPriceBtn_Click(object sender, EventArgs e)
        {
            try
            {
                this.ShowMessage("");
                if (!DataValid_Edit())
                {
                    return;
                }

                loadPriceBtn.Enabled = false;

                DateTime frDate = editFrDateEd.myDateTime;
                DateTime toDate = editToDateEd.myDateTime;
                System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
                watch.Start();
                string timeScaleCode = AppTypes.TimeScaleTypeToCode(AppTypes.TimeScaleTypes.RealTime);
                databases.baseDS.priceDataDataTable priceTbl = DataAccess.Libs.GetPriceData(dataCodeEd.Text.Trim(), timeScaleCode,
                                                                                            editFrDateEd.myDateTime, editToDateEd.myDateTime);

                if (priceTbl == null)
                {
                    return;
                }
                priceDataSource.DataSource = priceTbl;
                priceDataSource.Sort       = priceTbl.onDateColumn.ColumnName + " DESC";
                watch.Stop();
                this.ShowMessage(Languages.Libs.GetString("finished") + " : " + common.dateTimeLibs.TimeSpan2String(watch.Elapsed));
                this.ShowReccount(priceDataSource.Count);
                fullMode = true;
            }
            catch (Exception er)
            {
                this.ShowError(er);
            }
            finally
            {
                loadPriceBtn.Enabled = true;
            }
        }