예제 #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);
        }
예제 #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);
        }
예제 #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;
        }
예제 #4
0
 public void Update(PhieuNhapSach info)
 {
     data.Update(info);
 }
예제 #5
0
 public void Insert(PhieuNhapSach info)
 {
     data.Insert(info);
 }