Esempio n. 1
0
 /// <summary>
 /// 多條統計條信息生成Json包
 /// Conver parameters to JSON string
 /// </summary>
 /// <returns></returns>
 public static string GetJsonPackagesString(List<HistoryStatPackage> dataPackage)
 {
     if (dataPackage.Count > 0)
     {
         HistoryStatPackageList HistoryStatPackagelist = new HistoryStatPackageList();
         HistoryStatPackagelist.GetHistoryStatPackage = dataPackage;
         return new JavaScriptSerializer().Serialize(HistoryStatPackagelist);
     }
     else
     {
         return "";
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 單條統計信息生成Json包
 /// Conver parameters to JSON string
 /// </summary>
 /// <returns></returns>
 public static string GetJsonString(string company, string sit_no, string data_type,
     int day1, int day2, int day3, int day4, int day5, int day6, int day7, int day8,
     int day9, int day10, int day11, int day12, int day13, int day14, int day15)
 {
     List<HistoryStatPackage> HistoryStatPackage = new List<HistoryStatPackage>(){  
                 new HistoryStatPackage(){
                     Company=company,
                     Sit_no=sit_no,
                     Data_type=data_type,
                     Day1 = day1 ,
                     Day2 = day2 ,
                     Day3 = day3 ,
                     Day4 = day4 ,
                     Day5 = day5 ,
                     Day6 = day6 ,
                     Day7 = day7 ,
                     Day8 = day8 ,
                     Day9 = day9 ,
                     Day10 = day10 ,
                     Day11 = day11 ,
                     Day12 = day12 ,
                     Day13 = day13 ,
                     Day14 = day14 ,
                     Day15 = day15
                                   }
                 };
     HistoryStatPackageList HistoryStatPackagelist = new HistoryStatPackageList();
     HistoryStatPackagelist.GetHistoryStatPackage = HistoryStatPackage;
     return new JavaScriptSerializer().Serialize(HistoryStatPackagelist);
 }