Beispiel #1
0
        /// <summary>
        /// Update data to the most recent from the last update.
        /// </summary>
        /// <returns>Number of updated items</returns>
        public override int UpdateDataFromLastTime()
        {
            int numberOfUpdate = AppLibs.UpdateAnalysisData(this);

            this.ClearCache();
            return(numberOfUpdate);
        }
Beispiel #2
0
        public override void LoadData()
        {
            priceDataTbl.Clear();
            switch (this.AccessMode)
            {
            case DataAccessMode.Local:
                AppLibs.LoadBaseAnalysisData(this);
                break;

            case DataAccessMode.WebService:
                DataAccess.Libs.LoadAnalysisData(this);
                break;
            }
            ClearCache();
        }
Beispiel #3
0
        ///// <summary>
        /// Update data to the most recent from the last update.
        /// </summary>
        /// <returns>Number of updated items</returns>
        public override int UpdateDataFromLastTime()
        {
            int numberOfUpdate = 0;

            switch (this.AccessMode)
            {
            case DataAccessMode.Local:
                numberOfUpdate = AppLibs.UpdateAnalysisData(this);
                break;

            case DataAccessMode.WebService:
                numberOfUpdate = DataAccess.Libs.UpdateAnalysisData(this);
                break;
            }
            this.ClearCache();
            return(numberOfUpdate);
        }
Beispiel #4
0
        public static bool GetOwnStock(string stockCode, string portfolio, int buySellInterval, DateTime sellDate,
                                       out decimal qty, out decimal buyAmt)
        {
            data.baseDS.stockExchangeRow marketRow = AppLibs.GetStockExchange(stockCode);
            qty = 0; buyAmt = 0;
            data.baseDS.investorStockDataTable dataTbl = new data.baseDS.investorStockDataTable();
            LoadData(dataTbl, stockCode, portfolio);
            if (dataTbl.Count == 0)
            {
                return(false);
            }
            DateTime applicableDate = sellDate.AddDays(-marketRow.minBuySellDay);

            for (int idx = 0; idx < dataTbl.Count; idx++)
            {
                if (dataTbl[idx].buyDate > applicableDate)
                {
                    continue;
                }
                qty    += dataTbl[idx].qty;
                buyAmt += dataTbl[idx].buyAmt;
            }
            return(true);
        }
Beispiel #5
0
 public override void LoadData()
 {
     priceDataTbl.Clear();
     this.ClearCache();
     AppLibs.LoadAnalysisData(this);
 }