Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if ((textBox7.Text == "") || (textBox1.Text == "") || (textBox3.Text == "") || (textBox4.Text == "") || (textBox14.Text == "") || (textBox9.Text == "") || (comboBox3.Text == "") || (textBox5.Text == ""))
            {
                MessageBox.Show("All the fields must be Filled");
            }
            else
            {

                int User_ID = int.Parse(textBox7.Text);
                UserDbConnection userDB = new UserDbConnection();

                userDB.Delete(User_ID);
                clearUser();
            }
        }
Beispiel #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            if ((textBox7.Text == "") || (textBox1.Text == "") || (textBox3.Text == "") || (textBox4.Text == "") || (textBox14.Text == "") || (textBox9.Text == "") || (comboBox3.Text == "") || (textBox5.Text == ""))
            {
                MessageBox.Show("All the fields must be Filled");
            }
            else
            {
                int User_ID = int.Parse(textBox7.Text);
                string Name = textBox1.Text;
                string Address = textBox3.Text;
                int Phone = int.Parse(textBox4.Text);
                string User_Name = textBox14.Text;
                string Password = textBox9.Text;
                string Catagory = comboBox3.Text;
                string Others = textBox5.Text;

                UserDbConnection userDB = new UserDbConnection();
                userDB.Update(User_ID, Name, Address, Phone, User_Name, Password, Catagory, Others);
                clearUser();
            }
        }