Exemplo n.º 1
0
        /// <summary>
        /// 取大宗物料線圖所需資料包裝成Message形式
        /// </summary>
        /// <param name="argu">QueryArgus</param>
        /// <param name="category">Category code</param>
        /// <returns>Message</returns>
        private string GetLineChartData(QueryArgus argu, int category)
        {
            if (argu == null || argu.startDate == null || argu.startDate == DateTime.MinValue || argu.startDate == DateTime.MaxValue)
            {
                return(JSonTool.SerializeJson(new Message("Start Date is required")));
            }
            if (argu == null || argu.endDate == null || argu.endDate == DateTime.MinValue || argu.endDate == DateTime.MaxValue)
            {
                return(JSonTool.SerializeJson(new Message("End Date is required")));
            }

            Message msg = new Message();

            try
            {
                List <MaterialsLineChart> chartList = GetLineChartData(category, argu.startDate, argu.endDate);
                msg.result = chartList;
                msg.count  = chartList.Count;
            }
            catch (Exception ex)
            {
                msg.count   = 0;
                msg.message = ex.Message;
            }
            return(JSonTool.SerializeJson(msg));
        }
Exemplo n.º 2
0
 /// <summary>
 /// 取保麗龍資料
 /// </summary>
 /// <param name="argu"></param>
 /// <returns></returns>
 public string GetPolystyrene(QueryArgus argu)
 {
     return(GetLineChartData(argu, 104));
 }