Example #1
0
        // Maybe there are someting wrong with price importing,
        // use ReImportPricedata to add [importPrice] to [priceData,priceDataSum]
        public static void ReImportPricedata(DateTime frDate, DateTime toDate, string stockCode, CultureInfo culture)
        {
            databases.importDS myImportDS = new databases.importDS();
            databases.importDSTableAdapters.importPriceTA importPriceTA = new databases.importDSTableAdapters.importPriceTA();

            if (stockCode.Trim() == "")
            {
                importPriceTA.FillByDate(myImportDS.importPrice, frDate, toDate);
            }
            else
            {
                importPriceTA.FillByDateAndCode(myImportDS.importPrice, frDate, toDate, stockCode);
            }
            AddNewCode(myImportDS.importPrice, null);
            databases.DbAccess.UpdateData(myImportDS.importPrice);

            databases.baseDS myBaseDS = new databases.baseDS();
            AddImportPrice(myImportDS.importPrice, new DailyData(), myBaseDS.priceData);
            databases.DbAccess.UpdateData(myBaseDS.priceData);
            // In VN culture : start of week is Monday (not Sunday)
            databases.AppLibs.AggregatePriceData(myBaseDS.priceData, culture, null);
        }
        // Maybe there are someting wrong with price importing,
        // use ReImportPricedata to add [importPrice] to [priceData,priceDataSum]
        public static void ReImportPricedata(DateTime frDate, DateTime toDate, string stockCode, CultureInfo culture)
        {
            databases.importDS myImportDS = new databases.importDS();
            databases.importDSTableAdapters.importPriceTA importPriceTA = new databases.importDSTableAdapters.importPriceTA();

            if (stockCode.Trim() == "") importPriceTA.FillByDate(myImportDS.importPrice, frDate, toDate);
            else importPriceTA.FillByDateAndCode(myImportDS.importPrice, frDate, toDate, stockCode);
            AddNewCode(myImportDS.importPrice, null);
            databases.DbAccess.UpdateData(myImportDS.importPrice);

            databases.baseDS myBaseDS = new databases.baseDS();
            AddImportPrice(myImportDS.importPrice, new DailyData(), myBaseDS.priceData);
            databases.DbAccess.UpdateData(myBaseDS.priceData);
            // In VN culture : start of week is Monday (not Sunday)
            databases.AppLibs.AggregatePriceData(myBaseDS.priceData, culture, null);
        }