コード例 #1
0
        private void RepeatButton_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
            DashboardForm dashboardForm = new DashboardForm();

            dashboardForm.txt_firstname.Content = txt_firstname.Text;
            dashboardForm.txt_lastname.Content  = txt_lastname.Text;
            dashboardForm.txt_username.Content  = txt_username.Text;
            this.Close();
            dashboardForm.Show();
        }
コード例 #2
0
        private async void BtnLogin_Click(object sender, RoutedEventArgs e)
        {
            client = new FireSharp.FirebaseClient(config);

            FirebaseResponse response = await client.GetAsync("Information/" + txt_user.Text);

            Data obj = response.ResultAs <Data>();

            string stored_firstname = obj.Firstname;
            string stored_lastname  = obj.Lastname;
            string stored_username  = obj.Username;
            string stored_password  = obj.Password;



            string username = this.txt_user.Text;
            string password = this.txt_Password.Password;


            if (username == "" && password == "")
            {
                FormError formError = new FormError();
                formError.lbl_Usuario.Content = "Data is Missing";
                formError.Show();
            }
            else
            if (username == stored_username && password == stored_password)
            {
                DashboardForm dashboardform = new DashboardForm();
                dashboardform.txt_firstname.Content = stored_firstname;
                dashboardform.txt_lastname.Content  = stored_lastname;
                dashboardform.txt_username.Content  = stored_username;
                // MessageBox.Show(stored_lastname);
                // dashboardform.lbl_username.Content = username;
                this.Close();
                dashboardform.Show();
            }
            else
            {
                FormError formError = new FormError();
                formError.lbl_Usuario.Content = username + " " + password;
                formError.Show();
            }
        }