Exemplo n.º 1
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);
        }