//Thêm sách vào cơ sở dữ liệu public static string ThemSach(Sach_DTO ds) { if (Sach_DAO.SelectSachByName(ds.TenSach) == null) { return(Sach_DAO.Insert(ds)); } else { return("Đầu sách đã tồn tại trong CSDL"); } }
public int Them(Sach s) { if (string.IsNullOrEmpty(s.MaSach)) { return(0); } if (!sachDao.Insert(s)) { return(-1); } return(1); }
//Thêm 1 cuốn sách vào bảng SÁCH static public string Insert(Sach_DTO s) { return(Sach_DAO.Insert(s)); }