private void ButtonRegister_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            registerAdmin      admin   = collectDetails();
            Charity_operations control = new Charity_operations();

            if (control.validateEmpty(admin))
            {
                if (control.validateChars(admin))
                {
                    if (control.InsertData(admin))
                    {
                        MessageBox.Show("Success! Try Loggin in Now", "Admin Registered");
                        this.Close();
                    }
                    else
                    {
                        LabelErrorMessage.Text = admin.message;
                    }
                }
                else
                {
                    LabelErrorMessage.Text = admin.message;
                }
            }
            else
            {
                LabelErrorMessage.Text = admin.message;
            }
        }
        private registerAdmin collectDetails()
        {
            registerAdmin admin = new registerAdmin();

            admin.OrganizationName = TextOrganizationName.Text;
            admin.AdminId          = TextAdministratorID.Text;
            admin.Password         = TextPassword.Text;
            admin.confirmPassword  = TextConfirmPassword.Text;

            return(admin);
        }
Exemplo n.º 3
0
        private void ButtonLogin_Click(object sender, EventArgs e)
        {
            registerAdmin admin = new registerAdmin();

            admin.AdminId  = TextAdminId.Text;
            admin.Password = TextAdminPassword.Text;
            if (new Charity_operations().Login(admin))
            {
                // Validation Success, Redirecting to MainScreen
                MainScreen mainScr = new MainScreen();
                mainScr.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show(admin.message);
            }
        }
        private void ButtonLogin_Click(object sender, EventArgs e)
        {
            regForm = null;


            Cursor.Current = Cursors.WaitCursor;

            registerAdmin admin = new registerAdmin();

            admin.AdminId  = TextAdminId.Text;
            admin.Password = TextAdminPassword.Text;
            if (new Charity_operations().Login(admin))
            {
                FormMainProfile profile = new FormMainProfile();
                profile.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show(admin.message);
                LabelErrorMessage.Text = admin.message;
            }
        }