Beispiel #1
0
        public static async Task <PeoInfo> GetPerson(string stunum_other)
        {
            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>("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>("stunum_other", stunum_other));
            string response = await NetWork.getHttpWebRequest(api, paramList);

            try
            {
                if (response != "" && response != "[]")
                {
                    JObject bbddfeeds = JObject.Parse(response);
                    if (bbddfeeds["status"].ToString() == "200")
                    {
                        JObject feed = (JObject)bbddfeeds["data"];
                        PeoInfo f    = new PeoInfo();
                        f.GetAttributes(feed);
                        return(f);
                    }
                }
            }
            catch (Exception) { }
            return(null);
        }
Beispiel #2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            ee = e;
            if (ee.Parameter.GetType() == (new PeoInfo()).GetType())
            {
                PeoInfo peoinfo = (PeoInfo)ee.Parameter;
                nameTextBox.Text                      = peoinfo.nickname;
                abstractTextBox.Text                  = peoinfo.introduction;
                qqTextBox.Text                        = peoinfo.qq;
                phoneTextBox.Text                     = peoinfo.phone;
                abstractNumTextBlock.Text             = abstractTextBox.Text.Length + "/30";
                SetPersonInfoOKAppBarButton.IsEnabled = true;
            }

            if (this.Frame.CanGoBack)
            {
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
                SystemNavigationManager.GetForCurrentView().BackRequested += App_BackRequested;
            }
            else
            {
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
                SystemNavigationManager.GetForCurrentView().BackRequested -= App_BackRequested;
            }
        }
Beispiel #3
0
        private async Task Get()
        {
            getNotifications();
            getFeeds();
            try
            {
                Info                     = new PeoInfo(appSetting.Values["Community_nickname"].ToString(), appSetting.Values["Community_introduction"].ToString(), appSetting.Values["gender"].ToString(), appSetting.Values["Community_phone"].ToString(), appSetting.Values["Community_qq"].ToString());
                Info.photo_src           = appSetting.Values["Community_headimg_src"].ToString() == "" ? "ms-appdata:///local/headimg.png" : appSetting.Values["Community_headimg_src"].ToString();
                Info.photo_thumbnail_src = appSetting.Values["Community_headimg_src"].ToString() == "" ? "ms-appdata:///local/headimg.png" : appSetting.Values["Community_headimg_src"].ToString();
            }
            catch (Exception)
            {
            }
            PeoInfo infotemp = await MyService.GetPerson();

            if (infotemp != null)
            {
                Info = infotemp;
            }
        }
Beispiel #4
0
        private void EditAppBarButton_Click(object sender, RoutedEventArgs e)
        {
            PeoInfo peoinfo = new PeoInfo(ViewModel.Info.nickname, ViewModel.Info.introduction, ViewModel.Info.phone, ViewModel.Info.qq);

            Frame.Navigate(typeof(SetPersonInfoPage), peoinfo);
        }