コード例 #1
0
 public bool AddSach(SachDTO s)
 {
     if (!objSach.IsRowExists(s.MaSach) && objTheLoai.IsRowExists(s.MaTheLoai))
     {
         return(objSach.AddRow(s));
     }
     else
     {
         return(false);
     }
 }
コード例 #2
0
        public void AddRowTest()
        {
            Sach sach = new Sach()
            {
                MaSach     = "B0009",
                TenSach    = "Ten Sach Thu Nghiem",
                TacGia     = "TacGia1",
                DonGia     = 20000,
                MaTheLoai  = "TL01",
                SoLuongTon = 30,
                AnhBia     = null,
                SoTrang    = 20,
                MoTa       = "Noi dung mo ta",
                NamXuatBan = 2019,
                NhaXuatBan = "NXB NhaXuatBan",
            };

            Assert.IsTrue(sachTable.AddRow(sach));
        }