Exemple #1
0
        private string GetProductScore(string sysNo, string companyCode)
        {
            string  strScore = "";
            DataSet dsResult = GoogleSearchDA.GetGoogleSearchScore(sysNo, companyCode);

            if (dsResult.Tables.Count == 0 || dsResult.Tables[0].Rows.Count == 0)
            {
                strScore = "0";
            }
            else
            {
                decimal ReviewCount = (String.IsNullOrEmpty(dsResult.Tables[0].Rows[0]["ReviewCount"].ToString())) ? 0 : decimal.Parse(dsResult.Tables[0].Rows[0]["ReviewCount"].ToString());
                decimal RatingScore = (String.IsNullOrEmpty(dsResult.Tables[0].Rows[0]["RatingScore"].ToString())) ? 0 : decimal.Parse(dsResult.Tables[0].Rows[0]["RatingScore"].ToString());

                strScore = (ReviewCount == 0) ? "0" : (RatingScore / ReviewCount).ToString("f1");
            }
            return(strScore);
        }
Exemple #2
0
        /// <summary>
        /// 处理数据取得
        /// </summary>
        /// <returns></returns>
        private DataSet GetGoogleSearchProductList(string companyCode)
        {
            DataSet dsResult = GoogleSearchDA.GetGoogleSearchProductList(companyCode);

            return(dsResult);
        }