Exemple #1
0
        private void buttonBack(object sender, EventArgs e)
        {
            RequestForBlood requestForBlood = new RequestForBlood();

            this.Hide();
            requestForBlood.Show();
        }
        private void buttonLogin(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(textBoxUserID.Text) || string.IsNullOrWhiteSpace(textBoxPassword.Text))
            {
                MessageBox.Show("Please Enter User ID and Password");
            }
            else
            {
                string         userID        = textBoxUserID.Text;
                string         pass          = textBoxPassword.Text;
                PersonService  personService = new PersonService();
                SqlDataAdapter adapt         = personService.Login(userID, pass);
                DataSet        ds            = new DataSet();

                donor = personService.LoggedPerson(userID);

                adapt.Fill(ds);
                int count = ds.Tables[0].Rows.Count;
                if (count == 1)
                {
                    MessageBox.Show("Login Successful!\nWelcome:  " + donor.FirstName);
                    RequestForBlood requestForBlood = new RequestForBlood();
                    this.Hide();
                    requestForBlood.Show();
                }
                else
                {
                    MessageBox.Show("Login Failed!");
                    textBoxUserID.Clear();
                    textBoxPassword.Clear();
                }
            }
        }
Exemple #3
0
        private void buttonEdit(object sender, EventArgs e)
        {
            this.TextboxCheck();
            RequestForBlood requestForBlood = new RequestForBlood();

            this.Hide();
            requestForBlood.Show();
        }