private async void BtnSave_Clicked(object sender, EventArgs e) { if (!(this.lblTipsOldPwd.Text == "√" && this.lblTipsNewPwd.Text == "√" && this.lblTipsReNewPwd.Text == "√")) { return; } List <Models.UserInfo> list = new List <Models.UserInfo>(); Models.UserInfo ui = new Models.UserInfo(); ui.Account = OptionText_Helper.ReadAllText("Account"); ui.PassWord = MD5_Helper.MD5Encrypt16(this.etyNewPwd.Text); string url = $"/{Version_Helper.versionNumber}/user_/update?Option=PassWord&Account={ui.Account}"; list.Add(ui); var result = await WebApiService_Helper.PostConnectHelperAsync(url, list); if (result[0].Flag) { OptionText_Helper.WriteText("PassWord", ui.PassWord); await DisplayAlert("提示!", "修改成功!", "确认"); await Navigation.PopAsync(); } else { await DisplayAlert("提示!", "修改失败!", "确认"); } }
async private void BtnLogin_Clicked(object sender, EventArgs e) { if (this.etyAccount.Text == "" || this.etyAccount.Text == null || this.etyPassWord.Text == "" || this.etyPassWord.Text == null) { this.lblTips.IsVisible = true; this.lblTips.Text = "账号或密码不能为空!"; return; } UserInfo user = new UserInfo(); user.Account = this.etyAccount.Text; user.PassWord = MD5_Helper.MD5Encrypt16(this.etyPassWord.Text); List <UserInfo> list = new List <UserInfo>(); list.Add(user); string url = $"/{Version_Helper.versionNumber}/user_/verification"; var result = await WebApiService_Helper.PostConnectHelperAsync(url, list); TopSeries = new ObservableCollection <UserInfo>(result); Debug.WriteLine(TopSeries[0].Flag); if (TopSeries[0].Flag) { OptionText_Helper.WriteAllText(result[0]); switch (judge) { case "MyPage": await Navigation.PopAsync(); //await Navigation.PushAsync(new MainPage(judge)); break; case "register": await Navigation.PushAsync(new MainPage("")); break; default: await Navigation.PushAsync(new MainPage("")); break; } } }
async private void BtnRegister_Clicked(object sender, EventArgs e) { string account = this.etyAccount.Text; string nickeName = this.etyNickName.Text; string passWord = this.etyPassWord.Text; string rePassWord = this.etyRePassWord.Text; bool Valid = this.lblTipsAccount.IsVisible || this.lblTipsNickName.IsVisible || this.lblTipsPassWord.IsVisible || this.lblTipsNickName.IsVisible; if (Valid) { return; } if (!EmptyValid(account, nickeName, passWord, rePassWord)) { return; } UserInfo user = new UserInfo(); user.Account = account; user.NickName = nickeName; user.PassWord = MD5_Helper.MD5Encrypt16(passWord); List <UserInfo> list = new List <UserInfo>(); list.Add(user); string url = $"/{Version_Helper.versionNumber}/user_/add"; var result = await WebApiService_Helper.PostConnectHelperAsync(url, list); ObservableCollection <UserInfo> Series = new ObservableCollection <UserInfo>(result); Debug.WriteLine(Series[0].Flag); if (Series[0].Flag) { await Navigation.PushAsync(new LoginFile.Login("register", account)); } }
private void EtyOldPwd_Unfocused(object sender, FocusEventArgs e) { string OldPwd = this.etyOldPwd.Text; string PassWord = OptionText_Helper.ReadAllText("PassWord"); if (OldPwd == null) { this.lblTipsOldPwd.TextColor = System.Drawing.Color.Red; this.lblTipsOldPwd.Text = "此项不能为空!"; return; } if (MD5_Helper.MD5Encrypt16(OldPwd) != PassWord) { this.lblTipsOldPwd.Text = "输入与原来的密码不一致!"; } else { this.lblTipsOldPwd.TextColor = System.Drawing.Color.YellowGreen; this.lblTipsOldPwd.Text = "√"; } }