示例#1
0
        private void Login_field_Click(object sender, EventArgs e)
        {
//            tick.Show();
//          tick1.Show();
            //get the values from UI
            u.UserEmail    = utextbox.Text;
            u.UserRole     = comboBox1.Text;
            u.UserName     = utextbox.Text;
            u.UserPassword = uptextbox.Text;
            //adding the value from UI to Database
            //create a boolean variable to check if the data is inserted successfully
            bool issuccess = dal.Valid(u);

            //check if the data is inserted successfully
            if (issuccess == true)
            {
                if (comboBox1.Text == "User")
                {
                    //data or user added successfully
                    this.Hide();
                    SignUpPOPUP f1 = new SignUpPOPUP(utextbox.Text);
                    f1.Show();
                }
                else if (comboBox1.Text == "Admin")
                {
                    //data or user added successfully
                    this.Hide();
                    Admin f1 = new Admin(utextbox.Text);
                    f1.Show();
                }
            }
        }
示例#2
0
        private void Cmdsignup_Click(object sender, EventArgs e)
        {
            //get the values from UI
            u.UserName         = fnamefield.Text;
            u.UserEmail        = efield.Text;
            u.UserConatct      = mblfield.Text;
            u.UserAddress      = addfield.Text;
            u.UserPassword     = pfield.Text;
            u.UserCfrmPassword = cpfield.Text;
            u.UserRole         = comboBox1.Text;
            u.Gender           = Gender;
            u.AddDate          = DateTime.Now;
            u.ImageSource      = imgSouece;

            //adding the value from UI to Database
            //create a boolean variable to check if the data is inserted successfully
            bool success = dal.Insert(u);


            //check if the data is inserted successfully
            if (success == true)
            {
                //data or user added successfully
                this.Hide();
                SignUpPOPUP f1 = new SignUpPOPUP(fnamefield.Text);
                f1.Show();
            }
            else
            {
                //failed to add user
                MessageBox.Show("Failed to Sign UP Try Again!");
            }


            //clear text boxes
            Clear();
        }