private void button3_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == string.Empty)
            {
                MessageBox.Show("Please fill the required field");
            }
            else
            {
                try {
                    Pharmacy_Yasir.delete_data_base_table db = new delete_data_base_table();
                    bool Deleteuser = db.Deleteproduct(textBox1.Text);


                    textBox1.Clear(); textBox2.Clear();
                    show();
                }
                catch (Exception)
                {
                    MessageBox.Show("Database Error", "Error Code 5", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
예제 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox4.Text == string.Empty)
            {
                MessageBox.Show("Please type the correct name");
            }
            else
            {
                try
                {
                    Pharmacy_Yasir.delete_data_base_table db = new delete_data_base_table();
                    bool Deletesupplier = db.Deletesupplier(textBox4.Text);
                    textBox4.Clear();


                    show();
                }
                catch (Exception)
                {
                    MessageBox.Show("Database Error", "Error Code 4", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private void delete()
        {
            if (textBox7.Text == string.Empty)
            {
                MessageBox.Show("Please fill the required field");
            }
            else
            {
                try
                {
                    Pharmacy_Yasir.delete_data_base_table db = new delete_data_base_table();
                    bool Deleteuser = db.Deletestock(textBox7.Text);
                    MessageBox.Show("Record Deleted Successfully");
                    textBox7.Clear();

                    show();
                }
                catch (Exception)
                {
                    MessageBox.Show("Database Error", "Error Code 5", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
예제 #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox5.Text == string.Empty)
            {
                MessageBox.Show("Please enter full name to delete");
            }
            else
            {
                try
                {
                    Pharmacy_Yasir.delete_data_base_table db = new delete_data_base_table();
                    bool Deleteuser = db.Deleteemployee(textBox5.Text);


                    MessageBox.Show("Record Deleted Successfully");
                    textBox5.Clear();
                    show();
                }
                catch (Exception)
                {
                    MessageBox.Show("Database Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }