Exemplo n.º 1
0
        public Dictionary <string, object> YearHistogram()
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                DataTable dt = db.YearHistogram();
                if (dt.Rows.Count > 0)
                {
                    r["message"] = "成功";
                    r["code"]    = 2000;
                    r["items"]   = dt;
                }
                else
                {
                    r["message"] = "成功但是没有数据";
                    r["code"]    = 2000;
                    r["items"]   = new DataTable();
                }
            }
            catch (Exception e)
            {
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }