예제 #1
0
        public OleDbDataReader selecting()
        {
            loginClass cl = new loginClass();

            connection      cn  = new connection();
            OleDbConnection con = cn.Connect();

            con.Open();
            string          cmdText = "select Id from admissionDepartUsers";
            OleDbCommand    cmd     = new OleDbCommand(cmdText, con);
            OleDbDataReader reader  = cmd.ExecuteReader();

            return(reader);
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (textBox1.Text != "" && textBox2.Text != "")
                {
                    log               = new loginClass();
                    log.userID        = Convert.ToInt32(textBox1.Text);
                    log.UserPass      = textBox2.Text;
                    log.comboBoxValue = comboBox1.Text;

                    bool check = log.GetLogin();


                    if (check == true)
                    {
                        log.showData();
                        Program.id      = Convert.ToInt32(textBox1.Text);
                        Program.oldPass = textBox2.Text;
                        Program.depart  = comboBox1.Text;
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Invalid User Name or Password", "Login Alert!!");

                        textBox1.Clear();
                        textBox2.Clear();
                    }
                }
                else
                {
                    MessageBox.Show("Please Specify User ID or Password", "Login Alert!!");
                }
            }
            catch (FormatException) { MessageBox.Show("Enter values correctly!!"); }
        }