public FileNumberStatisticsStruct[] FileNumberStatistics(string AreaStr) { JavaScriptSerializer vJSS = new JavaScriptSerializer(); FileNumberStatisticsStruct[] vFileNumberStatisticsData = null; string vUrl = string.Format("{0}/Api/FileNumberStatistics", m_RemotingServerAddress); StatisticsParamtStruct vPostParam = new StatisticsParamtStruct(); vPostParam.UserID = m_UserID; vPostParam.UserName = m_UserName; vPostParam.AreaCodes = HttpUtility.UrlEncode(AreaStr); string vPostData = vJSS.Serialize(vPostParam); //string vPostData = string.Format("UserID={0}&UserName={1}&AreaCodes={2}",m_UserID,m_UserName, HttpUtility.UrlEncode(AreaStr)); string vResult = HttpPost(vUrl, vPostData); vResult = HttpUtility.UrlDecode(vResult); vFileNumberStatisticsData = vJSS.Deserialize <FileNumberStatisticsStruct[]>(vResult); return(vFileNumberStatisticsData); }
// POST: api/FileNumberStatistics public FileNumberStatisticsStruct[] Post([FromBody] StatisticsParamtStruct QueryParam) { string AreaCodes = System.Web.HttpUtility.UrlDecode(QueryParam.AreaCodes); UserOperateLog vUserOperateLog = new UserOperateLog(); string vAreaName = ""; string[] vAreaArray = AreaCodes.Split('|'); foreach (string vTempAera in vAreaArray) { string[] vSplitArea = vTempAera.Split(','); if (vSplitArea.Length == 2) { vAreaName += vSplitArea[1] + "、"; } } vUserOperateLog.WriteLog(QueryParam.UserID, QueryParam.UserName, string.Format("统计数据,区域包括:{0}", vAreaName)); Statistics vStatistics = new Statistics(); return(vStatistics.FileNumberStatistics(AreaCodes)); }