Ejemplo n.º 1
0
        public void Insert(PhieuNhapSach info)
        {
            string sqlQuery = "insert into PhieuNhapSach values ('" +
                info.MaPN + "','" +
                info.MaSach + "','" +
                info.MaNCC + "'," +
                info.SoLuong + ",'" +
                info.NgayNhap.ToShortDateString() + "')";

            ExecuteNonQuery(sqlQuery);
        }
Ejemplo n.º 2
0
        public void Update(PhieuNhapSach info)
        {
            string sqlQuery = "update PhieuNhapSach" +
                              " set MaSach='" + info.MaSach + "'," +
                              "MaNCC='" + info.MaNCC + "'" +
                              "SoLuong=" + info.SoLuong +
                              "NgayNhap='" + info.NgayNhap.ToShortDateString() + "'"+
                              "where MaPN='" + info.MaPN + "'";

            ExecuteNonQuery(sqlQuery);
        }
Ejemplo n.º 3
0
        public List<PhieuNhapSach> GetList()
        {
            List<PhieuNhapSach> list = new List<PhieuNhapSach>();

            string sqlQuery = "select * from PhieuNhapSach";

            reader = ExecuteReader(sqlQuery);

            while (reader.Read())
            {
                PhieuNhapSach phieuNhapSach = new PhieuNhapSach();

                phieuNhapSach.MaPN = reader["MaPN"].ToString();
                phieuNhapSach.MaSach = reader["MaSach"].ToString();
                phieuNhapSach.MaNCC = reader["MaNCC"].ToString();
                phieuNhapSach.SoLuong = (int)reader["SoLuong"];
                phieuNhapSach.NgayNhap = (DateTime)reader["NgayNhap"];
                list.Add(phieuNhapSach);
            }

            return list;
        }
Ejemplo n.º 4
0
 public void Update(PhieuNhapSach info)
 {
     data.Update(info);
 }
Ejemplo n.º 5
0
 public void Insert(PhieuNhapSach info)
 {
     data.Insert(info);
 }