public void Insert(PhieuTraHang info) { string sqlQuery = "insert into PhieuTraHang values ('" + info.MaKH + "','" + info.MaSach + "','" + info.MaKH + "',N'" + info.LyDoTra + "')"; ExecuteNonQuery(sqlQuery); }
public void Update(PhieuTraHang info) { string sqlQuery = "update PhieuTraHang" + " set MaSach='" + info.MaSach + "'," + "MaKH='" + info.MaKH + "'" + "LyDoTra='" + info.LyDoTra + "'" + "where MaTH='" + info.MaTH + "'"; ExecuteNonQuery(sqlQuery); }
public List<PhieuTraHang> GetList() { List<PhieuTraHang> list = new List<PhieuTraHang>(); string sqlQuery = "select * from PhieuTraHang"; reader = ExecuteReader(sqlQuery); while (reader.Read()) { PhieuTraHang phieuTraHang = new PhieuTraHang(); phieuTraHang.MaTH = reader["MaTH"].ToString(); phieuTraHang.MaSach = reader["MaSach"].ToString(); phieuTraHang.MaKH = reader["MaKH"].ToString(); phieuTraHang.LyDoTra = reader["LyDoTra"].ToString(); list.Add(phieuTraHang); } return list; }
public void Update(PhieuTraHang info) { data.Update(info); }
public void Insert(PhieuTraHang info) { data.Insert(info); }