Exemple #1
0
        private void btnLogOut_Click(object sender, EventArgs e)
        {
            this.Hide();
            Signin signin = new Signin();

            signin.Show();
        }
Exemple #2
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            string userEmail           = bunifuMaterialTextbox1.Text;
            string userPassword        = bunifuMaterialTextbox2.Text;
            string userConfirmPassword = bunifuMaterialTextbox3.Text;

            if (userEmail.Equals(""))
            {
                MessageBox.Show("Enter your email.");
            }
            else if (userPassword == userConfirmPassword)
            {
                string query = "Update GeneralUserInfo Set Password='******'Where Email='" + userEmail + "'";

                SqlCommand updateCommand = new SqlCommand(query);
                updateCommand.Parameters.AddWithValue("@userPassword", userPassword);
                int row = objDBAccess.executeQuery(updateCommand);

                if (row == 1)
                {
                    MessageBox.Show("Password updated.");
                    this.Hide();
                    Signin f1 = new Signin();
                    f1.Show();
                }
                else
                {
                    MessageBox.Show("Credentials doesn't matched");
                }
            }
        }
Exemple #3
0
        private void btnDeleteAccount_Click(object sender, EventArgs e)
        {
            DialogResult dialog = MessageBox.Show("Are you sure?", "Delete Account", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dialog == DialogResult.Yes)
            {
                string     query         = "Delete From GeneralUserInfo Where ID='" + Signin.id + "'";
                SqlCommand deleteCommand = new SqlCommand(query);
                int        row           = objDBAccess.executeQuery(deleteCommand);

                if (row == 1)
                {
                    MessageBox.Show("Account deleted.");
                    this.Hide();
                    Signin signin = new Signin();
                    signin.Show();
                }
            }
        }
Exemple #4
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            string gUserFirstName        = txtFirstName.Text;
            string gUserLastName         = txtLastName.Text;
            string gUserEmail            = txtEmail.Text;
            string gUserPhone            = txtPhone.Text;
            string gUserPresentAddress   = txtPresentAddress.Text;
            string gUserPermanentAddress = txtPermanetAddress.Text;
            string gUserNationalID       = txtNationalID.Text;
            string gUserDateofBirth      = dateTimePicker1.Text;
            string gUserPassportNumber   = txtPassportNumber.Text;
            string gUserBloodGroup       = txtBloodGroup.Text;
            string gUserAge      = txtAge.Text;
            string gUserGender   = txtGender.Text;
            string gUserPassword = txtPassword.Text;

            if (gUserFirstName.Equals(""))
            {
                MessageBox.Show("Please enter your Firsr Name");
            }
            else if (gUserLastName.Equals(""))
            {
                MessageBox.Show("Please enter your Last Name");
            }
            else if (gUserEmail.Equals(""))
            {
                MessageBox.Show("Please enter your email");
            }
            else if (gUserPhone.Equals(""))
            {
                MessageBox.Show("Please enter your phone number");
            }
            else if (gUserPresentAddress.Equals(""))
            {
                MessageBox.Show("Please enter your present address");
            }

            else if (gUserPermanentAddress.Equals(""))
            {
                MessageBox.Show("Please enter your Firsr Name");
            }
            else if (gUserNationalID.Equals(""))
            {
                MessageBox.Show("Please enter your NID");
            }
            else if (gUserDateofBirth.Equals(""))
            {
                MessageBox.Show("Please enter your date of birth");
            }
            else if (gUserPassportNumber.Equals(""))
            {
                MessageBox.Show("Please enter your passport number");
            }
            else if (gUserBloodGroup.Equals(""))
            {
                MessageBox.Show("Please enter your blood group");
            }
            else if (gUserAge.Equals(""))
            {
                MessageBox.Show("Please enter your age");
            }
            else if (gUserGender.Equals(""))
            {
                MessageBox.Show("Please enter gender");
            }
            else if (gUserPassword.Equals(""))
            {
                MessageBox.Show("Please enter password");
            }
            else
            {
                string     query         = ("insert into GeneralUserInfo(FirstName,LastName,Email,Phone,PresentAddress,PermanetAddress,NationalID,DateofBirth,PassportNumber,BloodGruop,Age,Gender,Password) values(@gUserFirstName,@gUserLastName,@gUserEmail,@gUserPhone,@gUserPresentAddress,@gUserPermanentAddress,@gUserNationalID,@gUserDateofBirth,@gUserPassportNumber,@gUserBloodGroup,@gUserAge,@gUserGender,@gUserPassword)");
                SqlCommand insertCommand = new SqlCommand(query);

                insertCommand.Parameters.AddWithValue("@gUserFirstName", gUserFirstName);
                insertCommand.Parameters.AddWithValue("@gUserLastName", gUserLastName);
                insertCommand.Parameters.AddWithValue("@gUserEmail", gUserEmail);
                insertCommand.Parameters.AddWithValue("@gUserPhone", gUserPhone);
                insertCommand.Parameters.AddWithValue("@gUserPresentAddress", gUserPresentAddress);
                insertCommand.Parameters.AddWithValue("@gUserPermanentAddress", gUserPermanentAddress);
                insertCommand.Parameters.AddWithValue("@gUserNationalID", gUserNationalID);
                insertCommand.Parameters.AddWithValue("@gUserDateofBirth", gUserDateofBirth);
                insertCommand.Parameters.AddWithValue("@gUserPassportNumber", gUserPassportNumber);
                insertCommand.Parameters.AddWithValue("@gUserBloodGroup", gUserBloodGroup);
                insertCommand.Parameters.AddWithValue("@gUserAge", gUserAge);
                insertCommand.Parameters.AddWithValue("@gUserGender", gUserGender);
                insertCommand.Parameters.AddWithValue("@gUserPassword", gUserPassword);

                int row = objDBAccess.executeQuery(insertCommand);

                if (row == 1)
                {
                    MessageBox.Show("Account created successfully.Please log in now");
                    this.Hide();
                    Signin f1 = new Signin();
                    f1.Show();
                }
                else
                {
                    MessageBox.Show("All fields are mandatory.Try Again");
                }
            }
        }
Exemple #5
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            string sUserFirstName   = txtFirstNameS.Text;
            string sUserLastName    = txtLastNameS.Text;
            string sUserEmail       = txtEmailS.Text;
            string sUserPhone       = txtPhoneS.Text;
            string sUserStudentID   = txtStudentIDS.Text;
            string sUserSchool      = txtSchoolS.Text;
            string sUserCLass       = txtClassS.Text;
            string sUserDateofBirth = dateTimePickerS.Text;
            string sUserNationalID  = txtNationalIDS.Text;
            string sUserBloodGroup  = txtBloodGroupS.Text;
            string sUserAge         = txtAgeS.Text;
            string sUserGender      = txtGenderS.Text;
            string sUserPassword    = txtPasswordS.Text;

            if (sUserFirstName.Equals(""))
            {
                MessageBox.Show("Please enter your Firsr Name");
            }
            else if (sUserLastName.Equals(""))
            {
                MessageBox.Show("Please enter your Last Name");
            }
            else if (sUserEmail.Equals(""))
            {
                MessageBox.Show("Please enter your email");
            }
            else if (sUserPhone.Equals(""))
            {
                MessageBox.Show("Please enter your phone number");
            }
            else if (sUserStudentID.Equals(""))
            {
                MessageBox.Show("Please enter your student id");
            }

            else if (sUserSchool.Equals(""))
            {
                MessageBox.Show("Please enter your school name");
            }
            else if (sUserCLass.Equals(""))
            {
                MessageBox.Show("Please enter your class");
            }
            else if (sUserDateofBirth.Equals(""))
            {
                MessageBox.Show("Please enter your date of birth");
            }
            else if (sUserNationalID.Equals(""))
            {
                MessageBox.Show("Please enter your NID number");
            }
            else if (sUserBloodGroup.Equals(""))
            {
                MessageBox.Show("Please enter your blood group");
            }
            else if (sUserAge.Equals(""))
            {
                MessageBox.Show("Please enter your age");
            }
            else if (sUserGender.Equals(""))
            {
                MessageBox.Show("Please enter gender");
            }
            else if (sUserPassword.Equals(""))
            {
                MessageBox.Show("Please enter password");
            }
            else
            {
                string     query         = ("insert into StudentUserInfo(FirstName,LastName,Email,Phone,StudentID,SchoolName,Class,DateofBirth,NationalID,BloodGruop,Age,Gender,Password) values(@sUserFirstName,@sUserLastName,@sUserEmail,@sUserPhone,@sUserStudentID,@sUserSchool,@sUserCLass,@sUserDateofBirth,@sUserNationalID,@sUserBloodGroup,@sUserAge,@sUserGender,@sUserPassword)");
                SqlCommand insertCommand = new SqlCommand(query);

                insertCommand.Parameters.AddWithValue("@sUserFirstName", sUserFirstName);
                insertCommand.Parameters.AddWithValue("@sUserLastName", sUserLastName);
                insertCommand.Parameters.AddWithValue("@sUserEmail", sUserEmail);
                insertCommand.Parameters.AddWithValue("@sUserPhone", sUserPhone);
                insertCommand.Parameters.AddWithValue("@sUserStudentID", sUserStudentID);
                insertCommand.Parameters.AddWithValue("@sUserSchool", sUserSchool);
                insertCommand.Parameters.AddWithValue("@sUserCLass", sUserCLass);
                insertCommand.Parameters.AddWithValue("@sUserDateofBirth", sUserDateofBirth);
                insertCommand.Parameters.AddWithValue("@sUserNationalID", sUserNationalID);
                insertCommand.Parameters.AddWithValue("@sUserBloodGroup", sUserBloodGroup);
                insertCommand.Parameters.AddWithValue("@sUserAge", sUserAge);
                insertCommand.Parameters.AddWithValue("@sUserGender", sUserGender);
                insertCommand.Parameters.AddWithValue("@sUserPassword", sUserPassword);

                int row = objDBAccess.executeQuery(insertCommand);

                if (row == 1)
                {
                    MessageBox.Show("Account created successfully.Please log in now");
                    this.Hide();
                    Signin f1 = new Signin();
                    f1.Show();
                }
                else
                {
                    MessageBox.Show("All fields are mandatory.Try Again");
                }
            }
        }
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            string pUserFirstName   = txtFirstNameP.Text;
            string pUserLastName    = txtLastNameP.Text;
            string pUserEmail       = txtEmailP.Text;
            string pUserPhone       = txtPhoneP.Text;
            string pUserPoliceID    = txtPoliceIDP.Text;
            string pUserRegion      = txtRegionP.Text;
            string pUserRank        = txtRankP.Text;
            string pUserDateofBirth = dateTimePickerP.Text;
            string pUserNationalID  = txtNationalIDP.Text;
            string pUserBloodGroup  = txtBloodGroupP.Text;
            string pUserAge         = txtAgeP.Text;
            string pUserGender      = txtGenderP.Text;
            string pUserPassword    = txtPasswordP.Text;

            if (pUserFirstName.Equals(""))
            {
                MessageBox.Show("Please enter your Firsr Name");
            }
            else if (pUserLastName.Equals(""))
            {
                MessageBox.Show("Please enter your Last Name");
            }
            else if (pUserEmail.Equals(""))
            {
                MessageBox.Show("Please enter your email");
            }
            else if (pUserPhone.Equals(""))
            {
                MessageBox.Show("Please enter your phone number");
            }
            else if (pUserPoliceID.Equals(""))
            {
                MessageBox.Show("Please enter your police id");
            }

            else if (pUserRegion.Equals(""))
            {
                MessageBox.Show("Please enter your region/area");
            }
            else if (pUserRank.Equals(""))
            {
                MessageBox.Show("Please enter your class");
            }
            else if (pUserDateofBirth.Equals(""))
            {
                MessageBox.Show("Please enter your date of birth");
            }
            else if (pUserNationalID.Equals(""))
            {
                MessageBox.Show("Please enter your NID number");
            }
            else if (pUserBloodGroup.Equals(""))
            {
                MessageBox.Show("Please enter your blood group");
            }
            else if (pUserAge.Equals(""))
            {
                MessageBox.Show("Please enter your age");
            }
            else if (pUserGender.Equals(""))
            {
                MessageBox.Show("Please enter gender");
            }
            else if (pUserPassword.Equals(""))
            {
                MessageBox.Show("Please enter password");
            }
            else
            {
                string     query         = ("insert into PoliceUserInfo(FirstName,LastName,Email,Phone,PoliceID,Area,Rank,DateofBirth,NationalID,BloodGroup,Age,Gender,Password) values(@pUserFirstName,@pUserLastName,@pUserEmail,@pUserPhone,@pUserPoliceID,@pUserRegion,@pUserRank,@pUserDateofBirth,@pUserNationalID,@pUserBloodGroup,@pUserAge,@pUserGender,@pUserPassword)");
                SqlCommand insertCommand = new SqlCommand(query);

                insertCommand.Parameters.AddWithValue("@pUserFirstName", pUserFirstName);
                insertCommand.Parameters.AddWithValue("@pUserLastName", pUserLastName);
                insertCommand.Parameters.AddWithValue("@pUserEmail", pUserEmail);
                insertCommand.Parameters.AddWithValue("@pUserPhone", pUserPhone);
                insertCommand.Parameters.AddWithValue("@pUserPoliceID", pUserPoliceID);
                insertCommand.Parameters.AddWithValue("@pUserRegion", pUserRegion);
                insertCommand.Parameters.AddWithValue("@pUserRank", pUserRank);
                insertCommand.Parameters.AddWithValue("@pUserDateofBirth", pUserDateofBirth);
                insertCommand.Parameters.AddWithValue("@pUserNationalID", pUserNationalID);
                insertCommand.Parameters.AddWithValue("@pUserBloodGroup", pUserBloodGroup);
                insertCommand.Parameters.AddWithValue("@pUserAge", pUserAge);
                insertCommand.Parameters.AddWithValue("@pUserGender", pUserGender);
                insertCommand.Parameters.AddWithValue("@pUserPassword", pUserPassword);

                int row = objDBAccess.executeQuery(insertCommand);

                if (row == 1)
                {
                    MessageBox.Show("Account created successfully.Please log in now");
                    this.Hide();
                    Signin f1 = new Signin();
                    f1.Show();
                }
                else
                {
                    MessageBox.Show("All fields are mandatory.Try Again");
                }
            }
        }