Пример #1
0
        public static void Main(string[] args)
        {
            // BizData.QueryByWeek("sz000830", 500, new DateTime(2015, 1, 1), new DateTime(2015, 3, 3));


            //List<BasicData> list = ImportRawData.ReadCsvFolder(@"D:\workspace\myproject\sz000830", 2000);
            //foreach (BasicData bd in list)
            //{
            //    //Console.WriteLine(bd.time+" "+bd.sellshare);
            //    BizData.InsertTable(bd);
            //}

            IList <BasicData> list = BizApi.QueryByWeek("sz000830", 2000, new DateTime(2014, 7, 1), new DateTime(2014, 12, 12));;

            Console.WriteLine(BizApi.QueryExtractLastUpdate("sz000830"));
        }
Пример #2
0
        public IList <BasicData> QueryData(string id, string big, string type, string start, string end)
        {
            DateTime          endDate, startDate;
            IList <BasicData> list;

            if (string.IsNullOrEmpty(end))
            {
                endDate = DateTime.Now;
            }
            else
            {
                endDate = BizCommon.ParseToDate(end);
            }
            if (string.IsNullOrEmpty(big))
            {
                big = "1000";
            }
            if (string.IsNullOrEmpty(type))
            {
                type = "w";
            }
            if (string.IsNullOrEmpty(start))
            {
                startDate = new DateTime(2014, 1, 1);
            }
            else
            {
                startDate = BizCommon.ParseToDate(start);
            }

            switch (type)
            {
            case "m":
                list = BizApi.QueryByMonth(id, Int32.Parse(big), startDate, endDate);
                break;

            case "d":
                list = BizApi.QueryByDay(id, Int32.Parse(big), startDate, endDate);
                break;

            default:
                list = BizApi.QueryByWeek(id, Int32.Parse(big), startDate, endDate);
                break;
            }

            return(list);
        }