Exemple #1
0
        //SAVE BUTTON
        private void button3_Click(object sender, EventArgs e)
        {
            QUERY OBJ = new QUERY();

            OBJ.LIST[0] = textBox1.Text;
            OBJ.LIST[1] = textBox2.Text;
            OBJ.LIST[2] = textBox3.Text;
            OBJ.LIST[3] = textBox4.Text;
            OBJ.LIST[5] = textBox5.Text;
            if (textBox3.Text == "" || textBox4.Text == "" || textBox1.Text == "" || textBox2.Text == "" || textBox5.Text == "")
            {
                MessageBox.Show("PLEASE FILL THE TEXTBOXES");
            }
            else
            {
                OBJ.SAVELog();
                if (OBJ.count == 1)
                {
                    MessageBox.Show("YOUR USERNAME IS ALREADY EXIST!!");
                }
                else
                {
                    MessageBox.Show("ACCOUNT CREATED");
                    OBJ.insert();
                    dataGridView1.DataSource = OBJ.table;
                    OBJ.display();
                    textBox1.Text = "";
                    textBox2.Text = "";
                    textBox4.Text = "";
                    textBox5.Text = "";
                    label1.Text   = "";
                }
            }
        }
Exemple #2
0
        private void Form3_Load(object sender, EventArgs e)
        {
            QUERY obj = new QUERY();

            dataGridView1.DataSource = obj.table;
            obj.display();
        }
Exemple #3
0
        //UPDATE BUTTON
        private void button4_Click(object sender, EventArgs e)
        {
            QUERY obj = new QUERY();

            obj.LIST[0] = textBox1.Text;
            obj.LIST[1] = textBox2.Text;
            obj.LIST[2] = label1.Text;
            obj.LIST[3] = textBox3.Text;
            obj.LIST[4] = textBox4.Text;
            obj.LIST[5] = textBox5.Text;
            if (textBox3.Text == "" || textBox4.Text == "")
            {
                MessageBox.Show("ENTER YOUR CURRENT USER AND PASSWORD");
            }
            else
            {
                obj.AUTHENTICATE();
                if (obj.count == 1)
                {
                    MessageBox.Show("UsERname and password is valid, UPDATED");
                    dataGridView1.DataSource = obj.table;
                    obj.UPDATE();
                    obj.display();
                    textBox1.Text     = "";
                    textBox2.Text     = "";
                    textBox4.Text     = "";
                    label1.Text       = "";
                    textBox5.Text     = "";
                    btnsave.Enabled   = true;
                    btncleare.Enabled = false;
                    btnup.Enabled     = false;
                    btndel.Enabled    = false;
                }
                else
                {
                    MessageBox.Show("YOUR USER AND PASSWORD IS NOT VALID FOR YOUR ID");
                }
            }
        }