private void button1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(bunifuMaterialTextbox1.Text) || string.IsNullOrEmpty(bunifuMaterialTextbox2.Text) || string.IsNullOrEmpty(bunifuMaterialTextbox3.Text) || string.IsNullOrEmpty(bunifuMaterialTextbox4.Text) || string.IsNullOrEmpty(bunifuMaterialTextbox5.Text) || string.IsNullOrEmpty(comboBox1.Text)) { MessageBox.Show("Please Specify all Blanks."); } else { string sel1 = this.comboBox1.GetItemText(this.comboBox1.SelectedItem); venregis c1 = new venregis() { firstname = bunifuMaterialTextbox3.Text, id = bunifuMaterialTextbox1.Text, lastname = bunifuMaterialTextbox5.Text, middlename = bunifuMaterialTextbox4.Text, org_type = sel1, password = bunifuMaterialTextbox2.Text }; var set = client.Set(@"User/Venue/" + bunifuMaterialTextbox1.Text, c1); MessageBox.Show("Register Success."); bunifuMaterialTextbox1.Text = string.Empty; bunifuMaterialTextbox2.Text = string.Empty; bunifuMaterialTextbox3.Text = string.Empty; bunifuMaterialTextbox4.Text = string.Empty; bunifuMaterialTextbox5.Text = string.Empty; comboBox1.Text = string.Empty; } }
private void button2_Click(object sender, EventArgs e) { string sel1 = this.comboBox1.GetItemText(this.comboBox1.SelectedItem); if (sel1.Equals("Approver")) { bunifuMaterialTextbox1.Enabled = true; FirebaseResponse resp1 = client.Get("User/Approver/" + bunifuMaterialTextbox1.Text); Class1 cl1 = resp1.ResultAs <Class1>(); if (bunifuMaterialTextbox1.Text == cl1.id) { FirebaseResponse resp = client.Delete("User/Approver/" + bunifuMaterialTextbox1.Text); MessageBox.Show("Delete Successfully"); } else { MessageBox.Show("Fail"); } } else if (sel1.Equals("Organization")) { bunifuMaterialTextbox1.Enabled = true; FirebaseResponse resp1 = client.Get("User/Organization/" + bunifuMaterialTextbox1.Text); orgregis cl1 = resp1.ResultAs <orgregis>(); if (bunifuMaterialTextbox1.Text == cl1.id) { string get1 = cl1.org_name; string get2 = cl1.org_type; FirebaseResponse resp = client.Delete("User/Organization/" + bunifuMaterialTextbox1.Text); MessageBox.Show("Delete Successfully"); } else { MessageBox.Show("Fail"); } } else if (sel1.Equals("Venue")) { bunifuMaterialTextbox1.Enabled = true; FirebaseResponse resp1 = client.Get("User/Venue/" + bunifuMaterialTextbox1.Text); venregis cl1 = resp1.ResultAs <venregis>(); if (bunifuMaterialTextbox1.Text == cl1.id) { string get1 = cl1.org_type; FirebaseResponse resp = client.Delete("User/Venue/" + bunifuMaterialTextbox1.Text); MessageBox.Show("Delete Successfully"); } else { MessageBox.Show("Fail"); } } }
private void bunifuMaterialTextbox1_Leave(object sender, EventArgs e) { string sel1 = this.comboBox1.GetItemText(this.comboBox1.SelectedItem); if (sel1.Equals("Approver")) { bunifuMaterialTextbox1.Enabled = true; try { FirebaseResponse resp = client.Get("User/Approver/" + bunifuMaterialTextbox1.Text); Class1 cl = resp.ResultAs <Class1>(); if (bunifuMaterialTextbox1.Text == cl.id) { bunifuMaterialTextbox2.Text = cl.firstname; bunifuMaterialTextbox3.Text = cl.lastname; bunifuMaterialTextbox4.Text = cl.middlename; bunifuMaterialTextbox5.Text = cl.password; MessageBox.Show("Found Exact Data. "); } else { MessageBox.Show("Not Found Data. "); } } catch (Exception ex) { MessageBox.Show("Not Found Data. "); } } else if (sel1.Equals("Organization")) { bunifuMaterialTextbox1.Enabled = true; try { FirebaseResponse resp = client.Get("User/Organization/" + bunifuMaterialTextbox1.Text); orgregis cl = resp.ResultAs <orgregis>(); if (bunifuMaterialTextbox1.Text == cl.id) { bunifuMaterialTextbox2.Text = cl.firstname; bunifuMaterialTextbox3.Text = cl.lastname; bunifuMaterialTextbox4.Text = cl.middlename; bunifuMaterialTextbox5.Text = cl.password; MessageBox.Show("Found Exact Data. "); } else { MessageBox.Show("Not Found Data. "); } } catch (Exception ex) { MessageBox.Show("Not Found Data. "); } } else if (sel1.Equals("Venue")) { bunifuMaterialTextbox1.Enabled = true; try { FirebaseResponse resp = client.Get("User/Venue/" + bunifuMaterialTextbox1.Text); venregis cl = resp.ResultAs <venregis>(); if (bunifuMaterialTextbox1.Text == cl.id) { bunifuMaterialTextbox2.Text = cl.firstname; bunifuMaterialTextbox3.Text = cl.lastname; bunifuMaterialTextbox4.Text = cl.middlename; bunifuMaterialTextbox5.Text = cl.password; MessageBox.Show("Found Exact Data. "); } else { MessageBox.Show("Not Found Data. "); } } catch (Exception ex) { } } }
private void button1_Click(object sender, EventArgs e) { string sel1 = this.comboBox1.GetItemText(this.comboBox1.SelectedItem); if (sel1.Equals("Approver")) { bunifuMaterialTextbox1.Enabled = true; FirebaseResponse resp1 = client.Get("User/Approver/" + bunifuMaterialTextbox1.Text); Class1 cl1 = resp1.ResultAs <Class1>(); if (bunifuMaterialTextbox1.Text == cl1.id) { string get1 = cl1.org_name; string get2 = cl1.org_type; string get3 = cl1.organization_type; Class1 cl = new Class1() { id = bunifuMaterialTextbox1.Text, firstname = bunifuMaterialTextbox2.Text, lastname = bunifuMaterialTextbox3.Text, middlename = bunifuMaterialTextbox4.Text, org_name = get1, org_type = get2, organization_type = get3, password = bunifuMaterialTextbox5.Text }; FirebaseResponse resp = client.Set("User/Approver/" + bunifuMaterialTextbox1.Text, cl); MessageBox.Show("Update Successfully"); } else { MessageBox.Show("Fail"); } } else if (sel1.Equals("Organization")) { bunifuMaterialTextbox1.Enabled = true; FirebaseResponse resp1 = client.Get("User/Organization/" + bunifuMaterialTextbox1.Text); orgregis cl1 = resp1.ResultAs <orgregis>(); if (bunifuMaterialTextbox1.Text == cl1.id) { string get1 = cl1.org_name; string get2 = cl1.org_type; orgregis cl = new orgregis() { id = bunifuMaterialTextbox1.Text, firstname = bunifuMaterialTextbox2.Text, lastname = bunifuMaterialTextbox3.Text, middlename = bunifuMaterialTextbox4.Text, org_name = get1, org_type = get2, password = bunifuMaterialTextbox5.Text }; FirebaseResponse resp = client.Set("User/Organization/" + bunifuMaterialTextbox1.Text, cl); MessageBox.Show("Update Successfully"); } else { MessageBox.Show("Fail"); } } else if (sel1.Equals("Venue")) { bunifuMaterialTextbox1.Enabled = true; FirebaseResponse resp1 = client.Get("User/Venue/" + bunifuMaterialTextbox1.Text); venregis cl1 = resp1.ResultAs <venregis>(); if (bunifuMaterialTextbox1.Text == cl1.id) { string get1 = cl1.org_type; venregis cl = new venregis() { id = bunifuMaterialTextbox1.Text, firstname = bunifuMaterialTextbox2.Text, lastname = bunifuMaterialTextbox3.Text, middlename = bunifuMaterialTextbox4.Text, org_type = get1, password = bunifuMaterialTextbox5.Text }; FirebaseResponse resp = client.Set("User/Venue/" + bunifuMaterialTextbox1.Text, cl); MessageBox.Show("Update Successfully"); } else { MessageBox.Show("Fail"); } } }
private void button1_Click_1(object sender, System.EventArgs e) { string sel1 = this.comboBox1.GetItemText(this.comboBox1.SelectedItem); if (string.IsNullOrEmpty(textBox1.Text) || string.IsNullOrEmpty(textBox2.Text)) { MessageBox.Show("Please Put Username or Password"); } else if (sel1.Equals("Approver")) { try { FirebaseResponse resp = client.Get("User/Approver/" + textBox1.Text); Class1 cl = resp.ResultAs <Class1>(); if (textBox2.Text == resp.ResultAs <apu>().password) { s1 = cl.firstname; s2 = cl.id; s6 = cl.lastname; s7 = cl.middlename; s3 = cl.org_name; s4 = cl.org_type; s5 = cl.organization_type; apphome ho = new apphome(); this.Hide(); ho.ShowDialog(); this.Close(); } else { MessageBox.Show("Wrong Credentials"); textBox2.Text = string.Empty; } } catch (Exception ex) { MessageBox.Show("Wrong Account Credentials"); } } else if (sel1.Equals("Organization")) { try { FirebaseResponse resp = client.Get("User/Organization/" + textBox1.Text); orgregis cl = resp.ResultAs <orgregis>(); if (textBox2.Text == resp.ResultAs <apu>().password) { s1 = cl.firstname; s2 = cl.id; s5 = cl.lastname; s6 = cl.middlename; s3 = cl.org_name; s4 = cl.org_type; home h = new home(); this.Hide(); h.ShowDialog(); this.Close(); } else { MessageBox.Show("Wrong Credentials"); textBox2.Text = string.Empty; } } catch (Exception ex) { MessageBox.Show("Wrong Account Credentials"); } } else if (sel1.Equals("Student Affairs Office")) { try { FirebaseResponse resp = client.Get("User/Sao/" + textBox1.Text); saoregis cl = resp.ResultAs <saoregis>(); if (textBox2.Text == resp.ResultAs <apu>().password) { s1 = cl.firstname; s2 = cl.id; s3 = cl.lastname; s4 = cl.middlename; saohome hi = new saohome(); this.Hide(); hi.ShowDialog(); this.Close(); } else { MessageBox.Show("Wrong Credentials"); } } catch (Exception ex) { MessageBox.Show("Wrong Account Credentials"); } } else if (sel1.Equals("Venue")) { try { FirebaseResponse resp = client.Get("User/Venue/" + textBox1.Text); venregis cl = resp.ResultAs <venregis>(); if (textBox2.Text == resp.ResultAs <apu>().password) { s1 = cl.firstname; s2 = cl.id; s3 = cl.lastname; s4 = cl.middlename; s5 = cl.org_type; venhome h = new venhome(); this.Hide(); h.ShowDialog(); this.Close(); } else { MessageBox.Show("Wrong Credentials"); textBox2.Text = string.Empty; } } catch (Exception ex) { MessageBox.Show("Wrong Account Credentials"); } } else if (sel1.Equals("Venue Approvers")) { try { FirebaseResponse resp = client.Get("User/VenueApprovers/assistantdirector"); FirebaseResponse resp1 = client.Get("User/VenueApprovers/chancellor"); FirebaseResponse resp2 = client.Get("User/VenueApprovers/deanOffice"); VenAppro cl = resp.ResultAs <VenAppro>(); VenAppro cl1 = resp1.ResultAs <VenAppro>(); VenAppro cl2 = resp2.ResultAs <VenAppro>(); if (textBox2.Text == resp.ResultAs <apu>().password) { s1 = cl.firstname; s2 = cl.id; s3 = cl.lastname; s4 = cl.middlename; s5 = cl.approver_name; VenueApp h = new VenueApp(); this.Hide(); h.ShowDialog(); this.Close(); } else if (textBox2.Text == resp1.ResultAs <apu>().password) { s1 = cl1.firstname; s2 = cl1.id; s3 = cl1.lastname; s4 = cl1.middlename; s5 = cl1.approver_name; VenueApp h = new VenueApp(); this.Hide(); h.ShowDialog(); this.Close(); } else if (textBox2.Text == resp2.ResultAs <apu>().password) { s1 = cl2.firstname; s2 = cl2.id; s3 = cl2.lastname; s4 = cl2.middlename; s5 = cl2.approver_name; VenueApp h = new VenueApp(); this.Hide(); h.ShowDialog(); this.Close(); } else { MessageBox.Show("Wrong Credentials"); textBox2.Text = string.Empty; } } catch (Exception ex) { MessageBox.Show("Wrong Account Credentials"); } } }