Exemplo n.º 1
0
        private void delBtn_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Selected entry will be deleted", "DELETE", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);

            if (result.Equals(DialogResult.OK))
            {
                dbClass db = new dbClass();
                if (this.activeTab == "Information")
                {
                    db.dbDelete("DELETE FROM tb_info WHERE id=" + this.del_id);
                }
                if (this.activeTab == "Department")
                {
                    db.dbDelete("DELETE FROM tb_department WHERE id=" + this.del_id);
                }
                if (this.activeTab == "Job")
                {
                    db.dbDelete("DELETE FROM tb_job WHERE id=" + this.del_id);
                }
                if (this.activeTab == "Employee")
                {
                    db.dbDelete("DELETE FROM tb_employee WHERE id=" + this.del_id);
                }
                getInfoData();
                getDeptData();
                getJobData();
                getEmployee();
                MessageBox.Show("DELETED!");
            }
            else
            {
            }
        }