Пример #1
0
        public static string GetData(string R_YEAR)
        {
            try
            {
                RevenueBLL rvBLL = new RevenueBLL();
                DataTable  dt;
                string     jsonString = string.Empty;

                dt = rvBLL.GetRevenueData(R_YEAR);

                // Convert to json string and Dispose
                if (dt != null)
                {
                    jsonString = JsonHelper.DataTableToJson(dt);

                    dt.Dispose();
                    dt = null;
                }
                rvBLL = null;

                return(jsonString);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #2
0
        private DataTable getRevenueData(string rYear, string createDateFrom, string createDateTo)
        {
            RevenueBLL rvBLL = new RevenueBLL();
            DataTable  dt    = rvBLL.GetRevenueData(rYear, createDateFrom, createDateTo);

            rvBLL = null;

            return(dt);
        }
Пример #3
0
        public static string getRevenueJSON(string rYear)
        {
            RevenueBLL rvBLL = new RevenueBLL();
            DataTable  dt    = rvBLL.GetRevenueData(rYear, "", "");

            rvBLL = null;

            return(JsonHelper.DataTableToJson(dt));
        }
Пример #4
0
        public static string Query(string rYear, string createDateFrom, string createDateTo)
        {
            //有資料庫修改以下程式即可
            //DataTable dt = new DataTable();
            //string sql = @"select * from table";
            //dt = GetFromDB(sql);
            //string jsonStr = "";
            //if (dt != null)
            //    jsonStr = Util.JsonHelper.DataTableToJson(dt);
            //if (dt != null)
            //{
            //    dt.Dispose();
            //    dt = null;
            //}
            //return jsonStr;

            RevenueBLL rvBLL = new RevenueBLL();
            DataTable  dt;
            string     jsonString = string.Empty;

            dt = rvBLL.GetRevenueData(rYear, createDateFrom, createDateTo);

            // Convert to json string and Dispose
            if (dt != null)
            {
                jsonString = JsonHelper.DataTableToJson(dt);

                dt.Dispose();
                dt = null;
            }
            rvBLL = null;

            return(jsonString);

            //return Source;
        }