/// <summary> /// 显示大图 /// </summary> private void ShowBigPic(ImgInfo imgInfo) { if (imgInfo != null) { loading.Visibility = Visibility.Visible; zoomImage.Visibility = Visibility.Hidden; downQueue.Queue(zoomImage, imgInfo); zoomGrid.Tag = imgInfo.Index; lb_picName.Text = "文件名称:" + imgInfo.GetFileName(); lb_picDate.Text = "上传时间:" + imgInfo.create_time; lb_picTags.Text = "标签:" + string.Join(" ", imgInfo.GetTagList()); } }
/// <summary> /// 目前仅考虑第一次评分或者第一次收藏 /// </summary> /// <param name="score"></param> /// <param name="info"></param> /// <returns></returns> private static bool SetTagScore(int score, ImgInfo info) { try { if (score > 0) { List <string> tags = info.GetTagList(); List <TagRecord> tagRecords = db.Queryable <TagRecord>().Where(o => tags.Contains(o.TagName)).ToList(); foreach (var tag in tags) { if (tag == "全部")//不考虑“全部”标签 { continue; } TagRecord tagRecord = tagRecords.Find(it => it.TagName == tag); if (tagRecord == null) { tagRecord = new TagRecord(); tagRecord.TagName = tag; tagRecord.RecordCount = 0; tagRecord.ScoreSum = score; db.Insertable(tagRecord).ExecuteCommand(); } else { tagRecord.ScoreSum += score; db.Updateable(tagRecord).UpdateColumns(o => new { o.RecordCount }).ExecuteCommand(); } } } return(true); } catch (Exception ex) { LogHelper.WriteLog(ex.Message, EnumLogLevel.Error); return(false); } }