Exemple #1
0
 public Add_New_User(List_Of_Requests _list, Mysql_Connect _mysql, Form1 _form1)
 {
     form1 = _form1;
     mysql = _mysql;
     list  = _list;
     InitializeComponent();
 }
Exemple #2
0
        public Visitor_Signin(List_Of_Requests _list, Mysql_Connect _mysql, Form1 _form1)
        {
            InitializeComponent();
            list  = _list;
            mysql = _mysql;
            form1 = _form1;

            Requests_Handler.Show_Visitors();
            Add_New_User_Button.DataSource = Requests_Handler.DataTable1;
        }
 public List_Of_Incidents(List_Of_Requests requestsList, Form1 form1)
 {
     InitializeComponent();
     _listOfRequests = requestsList;
     _form1          = form1;
 }
Exemple #4
0
        private void Login_Click(object sender, EventArgs e)
        {
            User_Name = Username_Textbox.Text;
            Password  = Password_Textbox.Text;


            if (User_Name == "" || Password == "")
            {
                MessageBox.Show("You must enter both a password and username");
            }
            else
            {
                // Try logging in, if it doesn't work, inform the user that
                // they've entered an incorrect username or password.
                if (!Mysql_User_Handler.Login(User_Name, Password))
                {
                    MessageBox.Show("Invalid Credentials");
                }
                else
                {
                    loggedIn = true;

                    if (Mysql_User_Handler.UserType == "staff")
                    {
                        _requestsList = new MedicTalk.List_Of_Requests(this, _connect);
                        this.Hide();
                        _requestsList.Show();
                    }
                    else if (Mysql_User_Handler.UserType == "resident")
                    {
                        _HomePage = new MedicTalk.HomePage(this, _connect);
                        this.Hide();
                        _HomePage.Show();
                    }
                }

                /*
                 *              _commandResult = _connect.Login("SELECT * FROM Accounts WHERE User_Name = @user and Password=@Password", User_Name, Password);
                 *
                 *              //Creates list of keywords to pass to select statement. This tells he select
                 *              //function to return the values from those keywords.
                 *              Keywords = new List<string>();
                 *              Keywords.Add("User_Id");
                 *              Keywords.Add("First_Name");
                 *              Keywords.Add("Last_Name");
                 *              Keywords.Add("Section");
                 *              Keywords.Add("Room");
                 *              Parameters = new List<string>();
                 *              Parameters.Add("User_Name");
                 *              Parameters.Add("Password");
                 *              ParameterValues = new List<string>();
                 *              ParameterValues.Add(User_Name);
                 *              ParameterValues.Add(Password);
                 *
                 *              string _returnedQuery = _connect.Select("SELECT User_id, First_Name, Last_Name, Section, Room FROM Accounts WHERE User_Name = @User_Name and Password=@Password", "1", Keywords, Parameters, ParameterValues);
                 *
                 *              Query_Results = _returnedQuery.Split('/');
                 *              User_Id = Query_Results[0];
                 *              _firstName = Query_Results[1];
                 *              _lastName = Query_Results[2];
                 *              _section = Query_Results[3];
                 *              _room = Query_Results[4];
                 *
                 *              if (_commandResult)
                 *              {
                 *                      loggedIn = true;
                 *                      _HomePage = new MedicTalk.HomePage(this, _connect);
                 *                      this.Hide();
                 *                      _HomePage.Show();
                 *              }
                 *              else
                 *              {
                 *                      MessageBox.Show("Invalid Credentials");
                 *              }
                 */
            }
        }