Exemplo n.º 1
0
 /// <summary>
 /// 多條統計條信息生成Json包
 /// Conver parameters to JSON string
 /// </summary>
 /// <returns></returns>
 public static string GetJsonPackagesString(List<StatInfoPackage> dataPackage)
 {
     if (dataPackage.Count > 0)
     {
         StatInfoPackageList statInfoPackagelist = new StatInfoPackageList();
         statInfoPackagelist.GetStatInfoPackage = dataPackage;
         return new JavaScriptSerializer().Serialize(statInfoPackagelist);
     }
     else
     {
         return "";
     }
 }
Exemplo n.º 2
0
 //2016/01/19 modify by sunquan
 #region ====== 統計消息 ======
 /// <summary>
 /// 單條統計信息生成Json包
 /// Conver parameters to JSON string
 /// </summary>
 /// <returns></returns>
 public static string GetJsonString(string company, string sit_no, int target_count, int registered_count, int registered_rate,
     int active_count, int active_rate, int online_count, int online_rate, int today_msgs, int total_msgs)
 {
     List<StatInfoPackage> statInfoPackage = new List<StatInfoPackage>(){  
                 new StatInfoPackage(){
                     Company=company,
                     Sit_no=sit_no,
                     Target_count=target_count,
                     Registered_count=registered_count,
                     Registered_rate=registered_rate,
                     Active_count=active_count,
                     Active_rate=active_rate,
                     Online_count=online_count,
                     Online_rate=online_rate,
                     Today_msgs=today_msgs,
                     Total_msgs=total_msgs
                                   }
                 };
     StatInfoPackageList statInfoPackagelist = new StatInfoPackageList();
     statInfoPackagelist.GetStatInfoPackage = statInfoPackage;
     return new JavaScriptSerializer().Serialize(statInfoPackagelist);
 }