private void button8_Click(object sender, EventArgs e)
        {
            UserHomeForm uh = new UserHomeForm();

            uh.Show();
            this.Hide();
        }
Beispiel #2
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (UserOperations.Login(textBox1.Text, textBox2.Text))
     {
         UserHomeForm uh = new UserHomeForm();
         uh.Show();
         this.Hide();
     }
 }
 private void button2_Click_1(object sender, EventArgs e)
 {
     if (choise == "user")
     {
         UserOperations.Request_Blood(NameBox.Text, emailBox.Text, bbnameCombo.Text, TypesCombo.Text, int.Parse(AmountBox.Text));
         UserHomeForm rb = new UserHomeForm();
         rb.Show();
         this.Hide();
     }
     else
     {
         BloodbankOperations.Request_Blood(NameBox.Text, emailBox.Text, bbnameCombo.Text, TypesCombo.Text, int.Parse(AmountBox.Text));
         BloodBankHomeForm rb = new BloodBankHomeForm();
         rb.Show();
         this.Hide();
     }
     MessageBox.Show("Done!");
 }
Beispiel #4
0
        private void signUpButton_Click(object sender, EventArgs e)
        {
            blood_types[] types = new blood_types[] {
                blood_types.A_pos,
                blood_types.A_neg,
                blood_types.B_pos,
                blood_types.B_neg,
                blood_types.AB_pos,
                blood_types.AB_neg,
                blood_types.O_pos,
                blood_types.O_neg
            };

            passMessage.Text   = "";
            emailMessage.Text  = "";
            mobileMessage.Text = "";

            User user = new User();

            user.Name       = nameField.Text;
            user.pictureLoc = imgloc;
            Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
            Match match = regex.Match(emailField.Text);

            if (!match.Success)
            {
                emailMessage.Text = "Enter valid email !";
                return;
            }
            user.Email = emailField.Text;

            if (passwordField.Text != confirmPassField.Text)
            {
                passMessage.Text = "Passwords didn't match";
                return;
            }
            user.Password = passwordField.Text;

            Regex regex2 = new Regex(@"^01[0-2]");
            Match match2 = regex2.Match(mobileField.Text);

            if (!match2.Success || mobileField.Text.Length != 11)
            {
                mobileMessage.Text = "Enter valid mobile !";
                return;
            }
            user.mobileNo = mobileField.Text;

            user.HealthCond = healthCondField.Text;
            user.birthdate  = DateTime.Parse(birthDateField.Text);
            user.BloodType  = types[bTypeComboBox.SelectedIndex];

            if (!UserOperations.signUp(user))
            {
                emailMessage.Text = "Used Email!";
            }
            else
            {
                UserHomeForm home = new UserHomeForm();
                home.Show();
                this.Hide();
            }
        }