Esempio n. 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)
        {
            data.importDS myImportDS = new data.importDS();
            data.importDSTableAdapters.importPriceTA importPriceTA = new data.importDSTableAdapters.importPriceTA();

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

            data.baseDS myBaseDS = new data.baseDS();
            libs.AddImportPrice(myImportDS.importPrice, new DailyPrice(), myBaseDS.priceData);
            application.DbAccess.UpdateData(myBaseDS.priceData);
            // In VN culture : start of week is Monday (not Sunday)
            libs.AggregatePriceData(myBaseDS.priceData, CultureInfoVN, null);
        }
Esempio n. 2
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)
        {
            data.importDS myImportDS = new data.importDS();
            data.importDSTableAdapters.importPriceTA importPriceTA = new data.importDSTableAdapters.importPriceTA();

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

            data.baseDS myBaseDS = new data.baseDS();
            libs.AddImportPrice(myImportDS.importPrice, new DailyPrice(), myBaseDS.priceData);
            application.DbAccess.UpdateData(myBaseDS.priceData);
            // In VN culture : start of week is Monday (not Sunday) 
            libs.AggregatePriceData(myBaseDS.priceData,CultureInfoVN, null);
        }