Beispiel #1
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            if (KTRONG() == false)
            {
                return;
            }
            else
            {
                Tram tempTram = new Tram();
                tempTram.id_tram  = txtIDTram.Text;
                tempTram.ten_tram = txtTenTram.Text;
                tempTram.dia_diem = txtDiaDiem.Text;
                BUS_Tram tram = new BUS_Tram();

                if (txtIDTram.Enabled == true)
                {
                    if (tram.ThemTram(tempTram) == 1)
                    {
                        FormQLTram qlTram = new FormQLTram();

                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Không Thêm Được");
                        return;
                    }
                }
                else
                {
                    if (tram.SuaTram(tempTram) == 1)
                    {
                        FormQLTram qlTram = new FormQLTram();
                        qlTram.LoadQLTram();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Không Sửa Được");
                        return;
                    }
                }
                txtIDTram.Enabled = true;
            }
        }
Beispiel #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            FormQLTram frm3 = new FormQLTram();

            frm3.Show();
        }