public searchWindow(user tempuser,MainWindow temp)
 {
     InitializeComponent();
     mWin = temp;
     currentUser = tempuser;
     searchHandle = new searchingHandler();
 }
 public addUserWindow(administrationWindow temp)
 {
     InitializeComponent();
     newUser = new user();
     Now = new DateTime();
     addWin = temp;
     adminHandle = new adminDatabaseHandler();
 }
        public void addUser(user tempUser)
        {
            //add users to database
            sql = "INSERT INTO User VALUES ('" + tempUser.getusername() + "','" + tempUser.getFirstName() + "','" + tempUser.getMiddleName() + "','" + tempUser.getLastName() + "','" + tempUser.getRoot() + "','" + tempUser.getCity() + "','" + tempUser.getemail() + "','" + tempUser.gethomeTelephone() + "','" + tempUser.GetType() + "');";
            cmd.CommandText = sql;
            cmd.ExecuteNonQuery();

            sql = "INSERT INTO Login_Details VALUES ('" + tempUser.getusername() + "','zaq@123', NULL,'" + DateTime.Today + "','False';";
            cmd.CommandText = sql;
            cmd.ExecuteNonQuery();

            // vary with the type of user
        }
 public void setCurrentUser(user temp)
 {
     currentUser = temp;
 }
 public user getCurrentUser(user temp)
 {
     return currentUser;
 }
 public MainWindow()
 {
     InitializeComponent();
     currentUser = new user();
 }
        private void loginButton_Click_1(object sender, EventArgs e)
        {
            this.Enabled = false;
            logwin = new loginWindow(this, userName);
            //MessageBox.Show("Check 1 "+userName);

            if (loginButton.Text == "Log In")
            {
                logwin.Show();
            }
            else if (loginButton.Text == "Log Out")
            {
                this.loginLabel.Text = "Please login to continue";
                this.loginButton.Text = "Log In";
                this.lendReturnButton.Visible = false;
                this.reportsButton.Visible = false;
                this.adminButton.Visible = false;
                this.userAccountButton.Visible = false;
                closeWindows();
                currentUser = null;
                logwin.Close();
            }
            this.Enabled = true;
            //MessageBox.Show(userName);
        }
 public administrationWindow(user temp, MainWindow tempWin)
 {
     InitializeComponent();
     currentuser = temp;
     mWin = tempWin;
 }
Exemple #9
0
 public userAccountHandler(user temp)
 {
     currentUser = temp;
     //connection = new Connection();
 }
 public userAccountHandler(user temp)
 {
     currentUser = temp;
     //connection = new Connection();
 }
Exemple #11
0
 public void addUser(user newUser)
 {       //send newly created user object to connection object and finally to DB
     newUser.setregistrationNumber(++registrationNumber);
     connection.addUser(newUser);
 }
Exemple #12
0
 public user getCurrentUser(user temp)
 {
     return(currentUser);
 }
Exemple #13
0
 public void setCurrentUser(user temp)
 {
     currentUser = temp;
 }
Exemple #14
0
 public MainWindow()
 {
     InitializeComponent();
     currentUser = new user();
 }
 public void addUser(user newUser)
 {
     //send newly created user object to connection object and finally to DB
     newUser.setregistrationNumber(++registrationNumber);
     connection.addUser(newUser);
 }