Exemple #1
0
        public static List <ChuyenBay> SearchTenSBDen(string tenSBDen)
        {
            string    cmdText = String.Format("select * from CHUYENBAY inner join TUYENBAY on CHUYENBAY.MATB = TUYENBAY.MATB inner join SANBAY on TUYENBAY.MASBDEN = SANBAY.MASB where SANBAY.TENSB like N'%{0}%'", tenSBDen);
            DataTable dt      = DataProvider.ExecuteReader(cmdText);

            if (dt != null && dt.Rows.Count > 0)
            {
                List <ChuyenBay> chuyenBay = new List <ChuyenBay>();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ChuyenBay cb = new ChuyenBay((int)dt.Rows[i]["MaCB"], DAL_TuyenBay.GetTuyenBay((int)dt.Rows[i]["MaTB"]), (int)dt.Rows[i]["DonGia"], (DateTime)dt.Rows[i]["ThoiGian"], (int)dt.Rows[i]["ThoiLuong"], (int)dt.Rows[i]["SLGheTrong"], (int)dt.Rows[i]["SLGheDat"]);
                    chuyenBay.Add(cb);
                }
                return(chuyenBay);
            }
            return(null);
        }
Exemple #2
0
        public static List <ChuyenBay> SearchThoiLuong(string thoiLuong)
        {
            string    cmdText = String.Format("select * from CHUYENBAY where ThoiLuong like '%{0}%'", thoiLuong == "" ? thoiLuong : DataProvider.ConvertToInt(thoiLuong));
            DataTable dt      = DataProvider.ExecuteReader(cmdText);

            if (dt != null && dt.Rows.Count > 0)
            {
                List <ChuyenBay> chuyenBay = new List <ChuyenBay>();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ChuyenBay cb = new ChuyenBay((int)dt.Rows[i]["MaCB"], DAL_TuyenBay.GetTuyenBay((int)dt.Rows[i]["MaTB"]), (int)dt.Rows[i]["DonGia"], (DateTime)dt.Rows[i]["ThoiGian"], (int)dt.Rows[i]["ThoiLuong"], (int)dt.Rows[i]["SoGheTrong"], (int)dt.Rows[i]["SoGheDat"]);
                    chuyenBay.Add(cb);
                }
                return(chuyenBay);
            }
            return(null);
        }
Exemple #3
0
        public static List <ChuyenBay> GetChuyenBays()
        {
            string    cmdText = @"select * from CHUYENBAY";
            DataTable dt      = DataProvider.ExecuteReader(cmdText);

            if (dt != null && dt.Rows.Count > 0)
            {
                List <ChuyenBay> chuyenBay = new List <ChuyenBay>();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ChuyenBay cb = new ChuyenBay((int)dt.Rows[i]["MaCB"], DAL_TuyenBay.GetTuyenBay((int)dt.Rows[i]["MaTB"]), (int)dt.Rows[i]["DonGia"], (DateTime)dt.Rows[i]["ThoiGian"], (int)dt.Rows[i]["ThoiLuong"], (int)dt.Rows[i]["SLGheTrong"], (int)dt.Rows[i]["SLGheDat"]);
                    chuyenBay.Add(cb);
                }
                return(chuyenBay);
            }
            return(null);
        }