public static List <CTHV> GetNewCTHVs() { var hvs = DAL_HangVe.GetHangVes(); var CTHVs = new List <CTHV>(); for (int i = 0; i < hvs.Count; i++) { CTHV cthv = new CTHV(0, hvs[i], 0, 0, 0, 0); CTHVs.Add(cthv); } return(CTHVs); }
public static List <CTHV> GetCTHVs(int maCB) { string cmdText = String.Format("select * from CTHV where MaCB = {0}", maCB); DataTable dt = DataProvider.ExecuteReader(cmdText); if (dt != null && dt.Rows.Count > 0) { List <CTHV> cTHV = new List <CTHV>(); for (int i = 0; i < dt.Rows.Count; i++) { CTHV cthv = new CTHV((int)dt.Rows[i]["MaCB"], DAL_HangVe.GetHangVe((int)dt.Rows[i]["MaHV"]), (int)dt.Rows[i]["GiaVe"], (int)dt.Rows[i]["SLGhe"], (int)dt.Rows[i]["SLGheTrong"], (int)dt.Rows[i]["SLGheBan"]); cTHV.Add(cthv); } return(cTHV); } return(null); }
public static List <Ve> SearchCMND(string cMND) { string cmdText = String.Format("select * from Ve where CMND like '%{0}%'", cMND); DataTable dt = DataProvider.ExecuteReader(cmdText); if (dt != null && dt.Rows.Count > 0) { List <Ve> Ve = new List <Ve>(); for (int i = 0; i < dt.Rows.Count; i++) { Ve ve = new Ve((int)dt.Rows[i]["MaVe"], (int)dt.Rows[i]["MaCB"], dt.Rows[i]["TenHK"].ToString(), dt.Rows[i]["CMND"].ToString(), dt.Rows[i]["DienThoai"].ToString(), (DateTime)dt.Rows[i]["ThoiGian"], DAL_HangVe.GetHangVe((int)dt.Rows[i]["MaHV"]), (int)dt.Rows[i]["GiaVe"]); Ve.Add(ve); } return(Ve); } return(null); }
public static List <PhieuDatCho> SearchCMND(string cMND) { string cmdText = String.Format("select * from PHIEUDATCHO where CMND like '%{0}%'", cMND); DataTable dt = DataProvider.ExecuteReader(cmdText); if (dt != null && dt.Rows.Count > 0) { List <PhieuDatCho> phieudatcho = new List <PhieuDatCho>(); for (int i = 0; i < dt.Rows.Count; i++) { PhieuDatCho pdc = new PhieuDatCho((int)dt.Rows[i]["MaVe"], (int)dt.Rows[i]["MaCB"], dt.Rows[i]["TenHK"].ToString(), dt.Rows[i]["CMND"].ToString(), dt.Rows[i]["DienThoai"].ToString(), (DateTime)dt.Rows[i]["ThoiGian"], DAL_HangVe.GetHangVe((int)dt.Rows[i]["MaHV"]), (int)dt.Rows[i]["GiaVe"], (int)dt.Rows[i]["TinhTrang"]); phieudatcho.Add(pdc); } return(phieudatcho); } return(null); }