Пример #1
0
        private void AdminPanel_Load(object sender, EventArgs e)
        {
            comboBox1.SelectedIndex = 0;
            label1.Visible          = false;
            LoginQueries a = new LoginQueries();

            a.Displaydb(listView1);
        }
Пример #2
0
        private void btnlog_Click(object sender, EventArgs e)
        {
            LoginQueries a = new LoginQueries();

            type = a.checkType(textBox1.Text, textBox2.Text);
            if (a.checkLogin(textBox1.Text, textBox2.Text))
            {
                this.DialogResult = DialogResult.OK;
                user = textBox1.Text;
            }
            else
            {
                textBox2.Clear();
            }
        }
Пример #3
0
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         if (textBox1.Text != "" && textBox2.Text == textBox3.Text)
         {
             LoginQueries a = new LoginQueries();
             a.Updatedb(textBox1.Text, textBox2.Text, comboBox1.Text);
             a.Displaydb(listView1);
             button2_Click(sender, e);
         }
         else
         {
             MessageBox.Show("Select an Entry from List to Update", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Check it again!");
     }
 }
Пример #4
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            try
            {
                if (textBox2.Text == textBox3.Text && textBox2.Text != "" && textBox1.Text != "")
                {
                    LoginQueries a = new LoginQueries();
                    a.Insertdb(textBox1.Text, textBox2.Text, comboBox1.Text);
                    a.Displaydb(listView1);
                    button2_Click(sender, e);
                }

                if (textBox1.Text == String.Empty || textBox2.Text == String.Empty)
                {
                    MessageBox.Show("Please fill required fields", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }