public NewItem(LogInObject logInUserObject, ObjectOfWishLists listOfWishListsObject, string selectedList) { logInObjectUsable = logInUserObject; listOfWishListsObjectUsable = listOfWishListsObject; InitializeComponent(); FillComboBox(selectedList); }
public NewWishList(LogInObject logInUserObject, ObjectOfWishLists listOfWishListsObject) { InitializeComponent(); logInObjectUsable = logInUserObject; objectOfWishLits = listOfWishListsObject; Dispatcher.Invoke(() => { LabelUserName.Content = logInObjectUsable.user.username; }); }
public DeletePromptWishList(LogInObject logInObjectInput, WishList wishListInput) { logInObject = logInObjectInput; wishList = wishListInput; InitializeComponent(); Dispatcher.Invoke(() => { LabelAreYouSure.Content = $"Are you sure you want to delete {wishList.wishListName}?"; }); }
public DeletePrompt(LogInObject logIn, WishListItem wishItem) { logInObjectUsable = logIn; wishListItem = wishItem; InitializeComponent(); Dispatcher.Invoke(() => { LabelAreYouSure.Content = $"Are you sure you want to delete {wishItem.wishItemName}?"; }); }
public LoggedInWindow(LogInObject logInUserObject) { LogInObj = logInUserObject; InitializeComponent(); Dispatcher.Invoke(() => { UserName.Content = logInUserObject.user.username; }); objectOfWishLists = GetListofLists(logInUserObject.user); FillListOfLists(objectOfWishLists); }
public void HttpRequest(string userName, string password) { Task.Run(() => { string postData = "un=" + userName + "&pw=" + password; string method = "POST"; string phpFileName = "login.php"; string jsonStr = ""; string error = ""; try { jsonStr = WebReq.WebRq(postData, method, phpFileName, ""); } catch (System.Exception e) { error = e.ToString(); Task.Run(() => { InfoBarAsync("", error); errorMessage = error; loadingLabelOn = false; }); } LogInObject logInUserObject = JsonConvert.DeserializeObject <LogInObject>(jsonStr); if (logInUserObject.success == 1) { Dispatcher.Invoke(() => { LoggedInWindow mainLogInWindow = new LoggedInWindow(logInUserObject); mainLogInWindow.Show(); this.Close(); }); } else if (logInUserObject.success != 1) { Task.Run(() => { InfoBarAsync("", logInUserObject.msg); loadingLabelOn = false; }); } }); }
public ShareWindow(LogInObject logInObjectIn, ObjectOfWishLists objectOfWishListsIn, string selectedList) { logInObject = logInObjectIn; objectOfWishLists = objectOfWishListsIn; InitializeComponent(); Dispatcher.Invoke(() => { //for testing FillComboBox(objectOfWishListsIn, selectedList); FillFriendList(); Task.Run(() => { }); }); }
private void ButtonRegister_Click(object sender, RoutedEventArgs e) { userName = TextBoxUserName.Text; password = PasswordBox.Password; reTypePassword = PasswordBoxRetype.Password; eMail = TextBoxEmail.Text; reTypeEMail = TextBoxEmailRetype.Text; if (showRegistrationFields == false) { showRegistrationFields = true; ShowRegistration(); } else { if (UserInputValidation.InputValidator(userName, false).ValidInput) { Task.Run(() => { string postData = "un=" + userName + "&pw=" + password + "&email=" + eMail; string method = "POST"; string phpFileName = "regUser.php"; //WebReq.WebRq(postData, method, phpFileName); string jsonStr = ""; string error = ""; if (eMail == reTypeEMail && password == reTypePassword) { try { jsonStr = WebReq.WebRq(postData, method, phpFileName, ""); } catch (System.Exception err) { error = err.ToString(); Task.Run(() => { InfoBarAsync("", error); errorMessage = error; loadingLabelOn = false; }); } LogInObject logInUserObject = JsonConvert.DeserializeObject <LogInObject>(jsonStr); if (logInUserObject.success == 1) { Dispatcher.Invoke(() => { LoggedInWindow mainLogInWindow = new LoggedInWindow(logInUserObject); mainLogInWindow.Show(); this.Close(); }); } else if (logInUserObject.success != 1) { Task.Run(() => { InfoBarAsync("", logInUserObject.msg); loadingLabelOn = false; }); } } else { if (eMail != reTypeEMail) { InfoBarAsync("", "E-mails do not match."); errorMessage = "E-mails do not match."; } else { InfoBarAsync("", "Passwords do not match."); errorMessage = "Passwords do not match."; } } }); } } }