예제 #1
0
        public void Tuyen_XoaTuyen(DataGridView dgv)
        {
            DAO_Tuyen daTuyen = new DAO_Tuyen();
            int       cr      = dgv.CurrentCell.RowIndex;
            int       id      = Convert.ToInt32(dgv.Rows[cr].Cells[0].Value);

            daTuyen.Delete_Tuyen(id);
        }
예제 #2
0
        public void Tuyen_AuToId(TextBox txt)
        {
            DAO_Tuyen daTuyen  = new DAO_Tuyen();
            int       iD_Tuyen = daTuyen.Find_MaTuyen();

            iD_Tuyen++;
            txt.Text = iD_Tuyen.ToString();
        }
예제 #3
0
        public void Tuyen_SuaTuyen(ComboBox cbb, DTO.Tuyen tuyen)
        {
            DAO_Tuyen daTuyen = new DAO_Tuyen();

            if (cbb.Items.Count > 0)
            {
                daTuyen.Update_Tuyen(tuyen);
            }
            else
            {
                daTuyen.Update_TuyenKhongTram2(tuyen);
            }
        }
예제 #4
0
        public void Tuyen_FillDGV(ComboBox cbb, DataGridView dgv)
        {
            DAO_Tuyen daTuyen = new DAO_Tuyen();
            DAO_Tram  daTram  = new DAO_Tram();
            string    tenTram = "";

            if (cbb.Items.Count > 0)
            {
                tenTram = cbb.SelectedValue.ToString();
            }
            int ID_Tram1 = Convert.ToInt32(daTram.Find_IDTramByName(tenTram));

            dgv.DataSource = daTuyen.Fill_TuyenXe(ID_Tram1);
        }
예제 #5
0
        public void Tuyen_ThemTuyen(DTO.Tuyen tuyen)
        {
            DAO_Tuyen daTuyen = new DAO_Tuyen();

            daTuyen.Add_Tuyen(tuyen);
        }