Пример #1
0
        public void Insert(PhieuTraHang info)
        {
            string sqlQuery = "insert into PhieuTraHang values ('" +
                info.MaKH + "','" +
                info.MaSach + "','" +
                info.MaKH + "',N'" +
                info.LyDoTra + "')";

            ExecuteNonQuery(sqlQuery);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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;
        }
Пример #4
0
 public void Update(PhieuTraHang info)
 {
     data.Update(info);
 }
Пример #5
0
 public void Insert(PhieuTraHang info)
 {
     data.Insert(info);
 }