private async void getItem(object e) { if (e is MyFeed) { Item = e as MyFeed; } else if (e is MyNotification) { Item = new MyFeed(); Item.content = (e as MyNotification).article_content; Item.type_id = "5"; Item.id = (e as MyNotification).article_id; Item = await CommunityMyContentService.GetFeed(5, (e as MyNotification).article_id); } }
private async void getMark() { string id = ""; string type_id = ""; if (ViewModel.Item != null) { id = ViewModel.Item.id; type_id = ViewModel.Item.type_id; } else { type_id = "5"; id = (ee.Parameter as MyNotification).article_id; } //if (ViewModel.BBDD != null) //{ // id = ViewModel.BBDD.id; // type_id = ViewModel.BBDD.type_id; //} //else //{ // id = ViewModel.hotfeed.article_id; // type_id = ViewModel.hotfeed.type_id; //} //TODO:未登陆时 不添加参数stuNum和idNum var vault = new Windows.Security.Credentials.PasswordVault(); var credentialList = vault.FindAllByResource(resourceName); credentialList[0].RetrievePassword(); List <KeyValuePair <String, String> > paramList = new List <KeyValuePair <String, String> >(); paramList.Add(new KeyValuePair <string, string>("article_id", id)); paramList.Add(new KeyValuePair <string, string>("type_id", type_id)); //paramList.Add(new KeyValuePair<string, string>("stuNum", appSetting.Values["stuNum"].ToString())); //paramList.Add(new KeyValuePair<string, string>("idNum", appSetting.Values["idNum"].ToString())); paramList.Add(new KeyValuePair <string, string>("stuNum", credentialList[0].UserName)); paramList.Add(new KeyValuePair <string, string>("idNum", credentialList[0].Password)); paramList.Add(new KeyValuePair <string, string>("size", "15")); paramList.Add(new KeyValuePair <string, string>("page", remarkPage.ToString())); string mark = await NetWork.getHttpWebRequest("cyxbsMobile/index.php/Home/ArticleRemark/getremark", paramList); Debug.WriteLine(mark); try { if (mark != "") { JObject obj = JObject.Parse(mark); if (Int32.Parse(obj["state"].ToString()) == 200) { //markList.Clear(); JArray markListArray = Utils.ReadJso(mark); if (markListArray.Count != 0) { isfirst = false; NoMarkGrid.Visibility = Visibility.Collapsed; if (ViewModel.Item != null) { //ViewModel.Item.remark_num = markListArray.Count.ToString(); if (type_id == "5") { MyFeed x = await CommunityMyContentService.GetFeed(int.Parse(type_id), id); //MyFeed y = ee.Parameter as MyFeed; //y.remark_num = x.remark_num; //var z = ViewModel.Item.remark_num; ViewModel.Item.remark_num = x.remark_num; } } //if (args is HotFeed) //{ // HotFeed h = args as HotFeed; // h.remark_num = ViewModel.BBDD.remark_num; //} for (int i = 0; i < markListArray.Count; i++) { Mark Markitem = new Mark(); Markitem.GetListAttribute((JObject)markListArray[i]); markList.Add(Markitem); } remarkPage++; } else if (isfirst) { NoMarkGrid.Visibility = Visibility.Visible; } issend = false; } } } catch (Exception) { } isMark2Peo = false; }