Example #1
0
 private void InitRadioBtn()
 {
     if (LocalSettingsHelper.GetBoolStatus(LocalSettingsHelper.KEY_ROLE))
     {
         rb_elder.IsChecked = true;
     }
     else
     {
         rb_children.IsChecked = true;
     }
 }
        public static async Task <string> UploadRemind(string message)
        {
            string role = "";

            if (LocalSettingsHelper.GetBoolStatus(LocalSettingsHelper.KEY_ROLE))
            {
                role = "parent";
            }
            else
            {
                role = "child";
            }
            ConnectServer conn = new ConnectServer();
            //将post使用的参数加入字典
            Dictionary <string, string> dic_param = new Dictionary <string, string>();

            dic_param.Add("time", DateTime.Now.ToString());
            dic_param.Add("username", LocalSettingsHelper.GetUsername());
            dic_param.Add("role", role);
            dic_param.Add("message", message);
            return(await conn.SendPostRequest(ConnectServer.URL_UPLOADREMIND, dic_param));
        }
Example #3
0
        private async void InitPush()
        {
            if (LocalSettingsHelper.GetBoolStatus(LocalSettingsHelper.KEY_SIGNIN))
            {
                if (usernameInput.Text.Trim() != "")
                {
                    string result = await notification.openNotificationService(usernameInput.Text);

                    if (result != null && result.Equals("succeed"))
                    {
                        if (LocalSettingsHelper.GetBoolStatus(LocalSettingsHelper.KEY_ROLE))
                        {
                            this.Frame.Navigate(typeof(ElderPage));
                        }
                        else
                        {
                            this.Frame.Navigate(typeof(PivotPage));
                        }
                    }
                }
            }
        }