Esempio n. 1
0
        /// <summary>
        /// 上分操作
        /// </summary>
        /// <param name="uin"></param>
        /// <param name="score"></param>
        /// <returns></returns>
        public bool UpScore(string uin, int score)
        {
            List <KeyValuePair <string, object> > pkList = new List <KeyValuePair <string, object> >();

            pkList.Add(new KeyValuePair <string, object>("Uin", uin));
            ContactScore contactScore = data.First <ContactScore>(pkList, "");

            if (contactScore == null)
            {
                Log.WriteLogByDate("uin不存在Contact表中:" + uin);
                return(false);
            }
            else
            {
                contactScore.TotalScore = contactScore.TotalScore + score;
            }

            return(data.Update <ContactScore>(contactScore, pkList, "") > 0);
        }