private void LoadData()
        {
            ReviewList = dataProvider.LoadData();

            var sortableList = ReviewList.OrderByDescending(r => r.Mean).ToList();

            ReviewList.Clear();
            for (int i = 0; i < sortableList.Count; i++)
            {
                ReviewList.Add(sortableList.ElementAt(i));
            }
        }
        private void Filter()
        {
            foreach (var r in ReviewList)
            {
                r.Categories.First(c => c.CategoryName == "Food").Weight         = WeightFood;
                r.Categories.First(c => c.CategoryName == "Localization").Weight = WeightLocalization;
                r.Categories.First(c => c.CategoryName == "Music").Weight        = WeightMusic;
                r.Categories.First(c => c.CategoryName == "Prices").Weight       = WeightPrices;
            }
            var sortableList = ReviewList.OrderByDescending(r => r.Mean).ToList();

            ReviewList.Clear();
            for (int i = 0; i < sortableList.Count; i++)
            {
                ReviewList.Add(sortableList.ElementAt(i));
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 리뷰 리스트 조회
        /// </summary>
        public void InitReviewList()
        {
            //로그인 예외처리
            //테스트 끝나면 풀것
            if (null == MainViewModel.LoginUser)
            {
                return;
            }

            DataSet dsResult = new DataSet();

            dsResult = callQuery.S_MA_USR_REV_LIST(MainViewModel.LoginUser.USER_NO);
            //dsResult = callQuery.S_MA_USR_REV_LIST("wildowl");

            if (0 == dsResult.Tables.Count)
            {
                return;
            }

            ReviewList.Clear();
            foreach (DataRow item in dsResult.Tables[0].Rows)
            {
                UdtMyListItem myItem = new UdtMyListItem();

                myItem.ContentID   = item["CONS_ID"].ToString();
                myItem.ContentName = item["CONS_NM"].ToString();

                System.Drawing.Image thumbImg = IMRUtils.TypeParser.ByteArrayToImage(Convert.FromBase64String(item["CONS_THUMB_PATH"].ToString()));
                myItem.ContentThumbnail = StaticUtils.ImageToImageSource(thumbImg);

                myItem.ContentType = item["CONS_TP"].ToString();
                myItem.EnterDtm    = item["REV_DTM"].ToString();
                myItem.Deleterable = System.Windows.Visibility.Collapsed;

                ReviewList.Add(myItem);
            }
        }