FIREBASE CONNECTED - REGISTRATION
CRUD - Confirmation FORMJohnDiaz
csharp
4 years ago
2.5 kB
6
Indexable
using System; using System.Windows.Forms; using FireSharp.Config; using FireSharp.Interfaces; using FireSharp.Response; namespace DiazCRUDFirebaseFinalTask.Forms.Menu { public partial class Form_Confirmation : Form { IFirebaseConfig conf = new FirebaseConfig { AuthSecret = "wEzQIKxGu9hSox3plaNVlYioj6UoMn8qu4aN4StH", BasePath = "https://crud-finaltaskprelim-default-rtdb.firebaseio.com/" }; IFirebaseClient client; public Form_Confirmation() { InitializeComponent(); } private void btnSubmit_Click(object sender, EventArgs e) { DialogResult res = MessageBox.Show(this, "Do you want to add this user to the database?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (res == DialogResult.Yes) { StudentInformationClass confirm = new StudentInformationClass { StudentNum = lblStudentNo.Text, Name = lblName.Text, Program = lblProgram.Text, BirthDate = lblBirthday.Text, Gender = lblGender.Text, ContactNum = lblContactNo.Text, Age = lblAge.Text }; var inputData = client.Set("Registration/" + lblStudentNo.Text, confirm); MessageBox.Show("User successfully registered", "System", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); } } private void Form_Confirmation_Load(object sender, EventArgs e) { try { client = new FireSharp.FirebaseClient(conf); lblStudentNo.Text = StudentInformationClass.SetStudentNo.ToString(); lblName.Text = StudentInformationClass.SetFullName; lblProgram.Text = StudentInformationClass.SetProgram; lblBirthday.Text = StudentInformationClass.SetBirthDay; lblGender.Text = StudentInformationClass.SetGender; lblContactNo.Text = "639" + StudentInformationClass.SetContactNo.ToString(); lblAge.Text = StudentInformationClass.SetAge.ToString(); } catch { MessageBox.Show("Firebase Connection Problem"); } } } }
Editor is loading...