コード例 #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);
 }