//LOGIN FORM private void button1_Click(object sender, EventArgs e) { ////try { QUERY obj = new QUERY(); obj.LIST[0] = textBox1.Text; obj.LIST[1] = textBox2.Text; if (textBox1.Text == "" || textBox2.Text == "") { MessageBox.Show("Please fill In the empty boxes"); } else { obj.LOGIN(); if (obj.count == 1) { MessageBox.Show("USRENAME and PASSWORD is valid"); Form1 IN = new Form1(); this.Hide(); IN.ShowDialog(); } else { MessageBox.Show("Wrong Password"); } } } }
//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 = ""; } } }
private void Form3_Load(object sender, EventArgs e) { QUERY obj = new QUERY(); dataGridView1.DataSource = obj.table; obj.display(); }
//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"); } } }