Beispiel #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (UserOperations.Login(textBox1.Text, textBox2.Text))
     {
         UserHomeForm uh = new UserHomeForm();
         uh.Show();
         this.Hide();
     }
 }
Beispiel #2
0
        private void forgetPassButton_Click(object sender, EventArgs e)
        {
            Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
            Match match = regex.Match(emailText.Text);

            if (!match.Success)
            {
                emailMessage.Text = "Enter valid email !";
                return;
            }
            UserOperations.FrogetPass(emailText.Text);

            LoginForm login = new LoginForm();

            login.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!");
 }
 private void button7_Click(object sender, EventArgs e)
 {
     try
     {
         OpenFileDialog dlg = new OpenFileDialog();
         dlg.Filter = "JPG Flies (*.jpg)|*.jpg|GIF Files (*.gif)|*gif |ALL Files (*.*)|*.*";
         dlg.Title  = "Select Picture";
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             imgloc = dlg.FileName.ToString();
             pictureBox1.ImageLocation = imgloc;
         }
     }
     catch (Exception es)
     { MessageBox.Show(es.Message); }
     UserOperations.ProfileEditemail(textBox6.Text, imgloc);
     MessageBox.Show("Picture edited succesfully");
 }
 private void button2_Click(object sender, EventArgs e)
 {
     UserOperations.Request_Blood(NameBox.Text, emailBox.Text, bbnameCombo.Text, TypesCombo.Text, int.Parse(AmountBox.Text));
 }
 private void button6_Click(object sender, EventArgs e)
 {
     UserOperations.ProfileEditdelet(textBox6.Text, "1");
 }
 private void button5_Click(object sender, EventArgs e)
 {
     UserOperations.ProfileEdithealth(textBox6.Text, textBox5.Text);
     MessageBox.Show("HealthCondition edited succesfully");
 }
 private void button4_Click(object sender, EventArgs e)
 {
     UserOperations.ProfileEditmobile(textBox6.Text, textBox4.Text);
     MessageBox.Show("Mobile edited succesfully");
 }
 private void button3_Click(object sender, EventArgs e)
 {
     UserOperations.ProfileEditpassword(textBox6.Text, textBox3.Text);
     MessageBox.Show("Password edited succesfully");
 }
 private void button2_Click(object sender, EventArgs e)
 {
     UserOperations.ProfileEditemail(textBox6.Text, textBox2.Text);
     MessageBox.Show("Email edited succesfully");
 }
 private void button1_Click(object sender, EventArgs e)
 {
     UserOperations.ProfileEditname(textBox6.Text, textBox1.Text);
     MessageBox.Show("Name edited succesfully");
 }
Beispiel #12
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();
            }
        }