Esempio n. 1
0
        public static TuyenBay GetTuyenBay(int maSBDi, int maSBDen)
        {
            string    cmdText = String.Format("select * from TUYENBAY Where MaSBDi={0} and MaSBDen = {1}", maSBDi, maSBDen);
            DataTable dt      = DataProvider.ExecuteReader(cmdText);

            if (dt != null && dt.Rows.Count > 0)
            {
                TuyenBay tb = new TuyenBay((int)dt.Rows[0]["MaTB"], DAL_SanBay.GetSanBay((int)dt.Rows[0]["MaSBDi"]), DAL_SanBay.GetSanBay((int)dt.Rows[0]["MaSBDen"]));
                return(tb);
            }
            return(null);
        }
Esempio n. 2
0
        public static List <CTCB> GetCTCBs(int maCB)
        {
            string    cmdText = String.Format("select * from CTCB where MaCB = {0}", maCB);
            DataTable dt      = DataProvider.ExecuteReader(cmdText);

            if (dt != null && dt.Rows.Count > 0)
            {
                List <CTCB> cTCB = new List <CTCB>();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    CTCB ctcb = new CTCB((int)dt.Rows[i]["MaCB"], DAL_SanBay.GetSanBay((int)dt.Rows[i]["MaSBTG"]), (int)dt.Rows[i]["TGDung"], dt.Rows[i]["GhiChu"].ToString());
                    cTCB.Add(ctcb);
                }
                return(cTCB);
            }
            return(null);
        }
Esempio n. 3
0
        public static List <TuyenBay> SearchMaTB(string maTB)
        {
            string    cmdText = String.Format("select * from TUYENBAY where MaTB like '%{0}%'", maTB == "" ? maTB : DataProvider.ConvertToInt(maTB));
            DataTable dt      = DataProvider.ExecuteReader(cmdText);

            if (dt != null && dt.Rows.Count > 0)
            {
                List <TuyenBay> TuyenBay = new List <TuyenBay>();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    TuyenBay tb = new TuyenBay((int)dt.Rows[i]["MaTB"], DAL_SanBay.GetSanBay((int)dt.Rows[i]["MaSBDi"]), DAL_SanBay.GetSanBay((int)dt.Rows[i]["MaSBDen"]));
                    TuyenBay.Add(tb);
                }
                return(TuyenBay);
            }
            return(null);
        }
Esempio n. 4
0
        public static List <TuyenBay> GetTuyenBays()
        {
            string    cmdText = @"select * from TuyenBay";
            DataTable dt      = DataProvider.ExecuteReader(cmdText);

            if (dt != null && dt.Rows.Count > 0)
            {
                List <TuyenBay> TuyenBay = new List <TuyenBay>();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    TuyenBay tb = new TuyenBay((int)dt.Rows[i]["MaTB"], DAL_SanBay.GetSanBay((int)dt.Rows[i]["MaSBDi"]), DAL_SanBay.GetSanBay((int)dt.Rows[i]["MaSBDen"]));
                    TuyenBay.Add(tb);
                }
                return(TuyenBay);
            }
            return(null);
        }
Esempio n. 5
0
        public static List <TuyenBay> SearchTenSBDen(string tenSBDen)
        {
            string    cmdText = String.Format("select * from TUYENBAY inner join SANBAY on MASBDEN = MASB where TENSB like N'%{0}%'", tenSBDen);
            DataTable dt      = DataProvider.ExecuteReader(cmdText);

            if (dt != null && dt.Rows.Count > 0)
            {
                List <TuyenBay> TuyenBay = new List <TuyenBay>();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    TuyenBay tb = new TuyenBay((int)dt.Rows[i]["MaTB"], DAL_SanBay.GetSanBay((int)dt.Rows[i]["MaSBDi"]), DAL_SanBay.GetSanBay((int)dt.Rows[i]["MaSBDen"]));
                    TuyenBay.Add(tb);
                }
                return(TuyenBay);
            }
            return(null);
        }