private async void buttonLogin_ClickAsync(object sender, EventArgs e) { FirebaseResponse responseCH = await client.GetTaskAsync(Username.Text); User result = responseCH.ResultAs <User>(); if (Password.Text == result.Password) { tUser.UpCast(result); MainPage main = new MainPage(); this.Hide(); if (main.ShowDialog() != DialogResult.OK) { this.Show(); } tUser = main.RetUser; retuser.DownCast(main.RetUser); this.Close(); SetResponse response = await client.SetTaskAsync(retuser.UserName.ToString(), retuser); retuser = response.ResultAs <User>(); tUser = new FastUser(); } else { MessageBox.Show("incorrect password"); } }
public void DownCast(FastUser f) { this.firstName = f.FirstName; this.userName = f.UserName; this.lastName = f.LastName; this.password = f.Password; this.email = f.Email; this.wot = f.Items; this.sites = f.Sites; }
private void MainPage_Load(object sender, EventArgs e) { user = SignUp.tUser; if (user.FirstName == "") { user = Login.tUser; } retUser = user; this.Name.Text = user.FirstName + " " + user.LastName; }
private void button3_Click(object sender, EventArgs e) { AddItem add = new AddItem(); this.Hide(); if (add.ShowDialog() != DialogResult.OK) { this.Show(); } retUser = user = add.RetUser; }
private void button4_Click(object sender, EventArgs e) { ChangeItem change = new ChangeItem(); this.Hide(); if (change.ShowDialog() != DialogResult.OK) { this.Show(); } user = change.RetUser; retUser = change.RetUser; }
private async void signupButton_ClickAsync(object sender, EventArgs e) { if (this.Password.Text != this.ConfirmPassword.Text) { MessageBox.Show("passwords do not match"); } else { if (!CheckEmail()) { MessageBox.Show("invalid Email"); } else { if (false)//firebase contains username { } else { tUser = new FastUser(this.FirstName.Text, this.LastName.Text, this.UserName.Text, this.Password.Text, this.Email.Text); MainPage main = new MainPage(); this.Hide(); if (main.ShowDialog() != DialogResult.OK) { this.Show(); } this.retUser.DownCast(main.RetUser); SetResponse response = await client.SetTaskAsync(retUser.UserName.ToString(), retUser); retUser = response.ResultAs <User>(); } } } }
public ChangeItem() { retUser = MainPage.user; InitializeComponent(); }
public ViewAll() { InitializeComponent(); user = MainPage.user; }
public SearchItem() { this.user = MainPage.user; InitializeComponent(); }