public int nhapNXB(NXBDTO nxbDTO) { try { connect = new ConnectionData(); int Nparamater = 5; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@manxb"; value[0] = nxbDTO.MaNXB; name[1] = "@tennxb"; value[1] = nxbDTO.TenNXB; name[2] = "@diachi"; value[2] = nxbDTO.DiaChi; name[3] = "@email"; value[3] = nxbDTO.Email; name[4] = "@sdt"; value[4] = nxbDTO.Sdt; return connect.UpdateData("NXB_InsertUpdate", name, value, Nparamater); } catch (SqlException ex) { throw ex; } }
public int GetTuoiNhoNhat() { try { connect = new ConnectionData(); DataTable dt= connect.GetData("GETTUOINHONHAT"); return int.Parse(dt.Rows[0][0].ToString()); }catch(SqlException ex){ throw ex; } }
public DataTable LoadTenLoaiDG() { try { connect = new ConnectionData(); return connect.GetData("LoadTenLoaiDG"); } catch(SqlException ex) { throw ex; } }
public DataTable Load() { try { connect = new ConnectionData(); return connect.GetData("NXB_Load"); } catch (SqlException ex) { throw ex; } }
public DataTable QuyDinh_LoadDuLieu() { try { connect = new ConnectionData(); return connect.GetData("QuyDinh_LoadDuLieu"); } catch (SqlException ex) { throw ex; } }
public DataTable DauSach_LoadSach() { try { connect = new ConnectionData(); return connect.GetData("DAUSACH_LOAD"); } catch (SqlException ex) { throw ex; } }
public DataTable TheLoai_GetByLast() { try { connect = new ConnectionData(); return connect.GetData("TheLoai_GetByLast"); } catch (SqlException ex) { throw ex; } }
public DataTable TheLoai_LoadTheLoai() { try { connect = new ConnectionData(); return connect.GetData("TheLoai_LoadDuLieu"); } catch (SqlException ex) { throw ex; } }
public DataTable DauSach_TraCuu() { try { connect = new ConnectionData(); return connect.GetData("DauSach_TraCuu"); } catch (SqlException ex) { throw ex; } }
public DataTable LoaiDG_LoadDuLieu() { try { connect = new ConnectionData(); return connect.GetData("[LoaiDG_LoadDuLieu]"); } catch (SqlException ex) { throw ex; } }
public DataTable LoadTL_CoTenTL() { try { connect = new ConnectionData(); return connect.GetData("THELOAI_LoadDuLieuCoTenTL"); } catch (SqlException ex) { throw ex; } }
public int LoaiDocGia_Xoa(LoaiDGDTO dgDTO) { try { connect = new ConnectionData(); int Nparamater = 1; string[] name=new string[Nparamater]; object[] values=new object[Nparamater]; name[0] = "@MaLDG"; values[0] = dgDTO.MaLDG; return connect.UpdateData("LoaiDocGia_Xoa",name,values,Nparamater); }catch(SqlException ex){ throw ex; } }
public DataTable timDauSachTheoTheLoai(DauSachDTO dsDTO) { try { connect = new ConnectionData(); int Nparamater = 1; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@theloai"; value[0] = dsDTO.MaTL; return connect.GetData("DauSach_TimTheoTheLoai", name, value, Nparamater); } catch (SqlException ex) { throw ex; } }
public DataTable timDauSachDayDu(DauSachDTO dsDTO) { try { connect = new ConnectionData(); int Nparamater = 1; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@search"; value[0] = dsDTO.TenDS; return connect.GetData("DauSach_TimDayDu", name, value, Nparamater); } catch (SqlException ex) { throw ex; } }
public int Sach_Xoa(SachDTO sDTO) { try { connect = new ConnectionData(); int Nparamater = 1; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@mas"; value[0] = sDTO.MaSach; return connect.UpdateData("Sach_Xoa", name, value, Nparamater); } catch (SqlException ex) { throw ex; } }
//Chưa dùng public DataTable DauSach_LoadMaDauSach(DauSachDTO p) { try { connect = new ConnectionData(); int Nparamater = 1; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@tends"; value[0] = p.TenDS; return connect.GetData("DAUSACH_LOADMADAUSACH", name, value, Nparamater); } catch (SqlException ex) { throw ex; } }
// Xóa độc giả public int XoaDG_MaDG(DocGiaDTO dgDTO) { try { connect = new ConnectionData(); int Nparamater = 1; string[] name = new string[Nparamater]; object[] values = new object[Nparamater]; name[0] = "@MaDG"; values[0] = dgDTO.MaDG; return connect.UpdateData("Delete_DocGia_ByMaDG", name, values, Nparamater); } catch (SqlException ex) { throw ex; } }
public DataTable TheLoai_LoadDuLieuCotMaTL(TheLoaiDTO tlDTO) { try { connect = new ConnectionData(); int Nparamater = 1; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@matl"; value[0] = tlDTO.MaTL; return connect.GetData("TheLoai_LoadDuLieuCotMaTL", name, value, Nparamater); } catch(SqlException ex) { throw ex; } }
public DataTable LoaiDG_LoadDuLieuCotMaLDG(LoaiDGDTO ldgDTO) { try { connect = new ConnectionData(); int Nparamater = 1; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@maldg"; value[0] = ldgDTO.MaLDG; return connect.GetData("LoaiDocGia_LoadDuLieuCotMaLDG", name, value, Nparamater); } catch (SqlException ex) { throw ex; } }
public DataTable LoadMaTacGia(TacGiaDTO tgDTO) { try { connect = new ConnectionData(); int Nparamater = 1; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@matg"; value[0] = tgDTO.MaTG; return connect.GetData("TacGia_LoadDuLieuCotMaTG", name, value, Nparamater); } catch (SqlException ex) { throw ex; } }
public DataTable PhieuMuonSach_TimSach_MaDS(DauSachDTO p) { try { connect = new ConnectionData(); int Nparamater = 1; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@MaDS"; value[0] = p.MaDS; return connect.GetData("PHIEUSACH_PhieuMuonSach_TimSach_MaDS", name, value, Nparamater); } catch (SqlException ex) { throw ex; } }
public DataTable LoadSach_ThemSach(SachDTO p) { try { connect = new ConnectionData(); int Nparamater = 1; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@MaSach"; value[0] = p.MaSach; return connect.GetData("PHIEUSACH_THEMSACH", name, value, Nparamater); } catch (SqlException ex) { throw ex; } }
public DataTable LoadDuLieuCotMaNXB(NXBDTO nxbDTO) { try { connect = new ConnectionData(); int Nparamater = 1; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@manxb"; value[0] = nxbDTO.MaNXB; return connect.GetData("NXB_LoadDuLieuCotMaNXB", name, value, Nparamater); } catch (SqlException ex) { throw ex; } }
public DataTable TimTheoTen(NXBDTO nxbDTO) { try { connect = new ConnectionData(); int Nparamater = 1; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@search"; value[0] = nxbDTO.TenNXB; return connect.GetData("NXB_TimTheoTen", name, value, Nparamater); } catch (SqlException ex) { throw ex; } }
public int nhapCTP(PhieuSachDTO p,CTPhieuDTO c) { try { connect = new ConnectionData(); int Nparamater = 2; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@MaDG"; value[0] = p.MaDG; name[1] = "@MaSach"; value[1] = c.MaSach; return connect.UpdateData("CTPhieu_Insert", name, value, Nparamater); } catch (Exception) { throw; } }
public DataTable CheckDangNhap(DangNhapDTO p) { try { connect = new ConnectionData(); int Nparameter = 2; string[] name = new string[Nparameter]; object[] value = new object[Nparameter]; name[0] = "@TenDangNhap"; value[0] = p.TenDangNhap; name[1] = "@MatKhau"; value[1] = p.MatKhau; return connect.GetData("DANGNHAP_KiemTra", name, value, Nparameter); } catch (SqlException ex) { throw ex; } }
public int nhapTacGia(TacGiaDTO tgDTO) { try { connect = new ConnectionData(); int Nparamater = 2; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@matg"; value[0] = tgDTO.MaTG; name[1] = "@tentg"; value[1] = tgDTO.TenTG; return connect.UpdateData("TacGia_InsertUpdate", name, value, Nparamater); } catch (SqlException ex) { throw ex; } }
public int nhapLDG(LoaiDGDTO ldgDTO) { try { connect = new ConnectionData(); int Nparamater = 2; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@maldg"; value[0] = ldgDTO.MaLDG; name[1] = "@tenldg"; value[1] = ldgDTO.TenLDG; return connect.UpdateData("loaiDocGia_InsertUpdate", name, value, Nparamater); } catch (SqlException ex) { throw ex; } }
public int nhapSach(SachDTO sDTO) { try { connect = new ConnectionData(); int Nparamater = 3; string[] name = new string[Nparamater]; object[] value = new object[Nparamater]; name[0] = "@mas"; value[0] = sDTO.MaSach; name[1] = "@mads"; value[1] = sDTO.MaDS; name[2] = "@tt"; value[2] = sDTO.TinhTrang; return connect.UpdateData("Sach_InsertUpdate", name, value, Nparamater); } catch (SqlException ex) { throw ex; } }
// Thêm độc giả public int InsertDG(DocGiaDTO dgDTO) { connect = new ConnectionData(); try { //var binding = BindingObject(dgDTO); // return connect.UpdateData("sp_DocGia_Insert", binding.Names, binding.Values, binding.Names.Length); int Nparamater = 9; String[] name = new string[Nparamater]; object[] values = new object[Nparamater]; name[0] = "@MaDG"; values[0] = dgDTO.MaDG; name[1] = "@HoVaTen"; values[1] = dgDTO.HoVaTen; name[2] = "@GioiTinh"; values[2] = dgDTO.GioiTinh; name[3] = "@NgaySinh"; values[3] = dgDTO.NgaySinh; name[4] = "@DiaChi"; values[4] = dgDTO.DiaChi; name[5] = "@Email"; values[5] = dgDTO.Email; name[6] = "@MaLDG"; values[6] = dgDTO.MaLDG; name[7] = "@NgayLap"; values[7] = dgDTO.NgayLap; name[8] = "@NgayHetHan"; values[8] = dgDTO.NgayHetHan; return connect.UpdateData("sp_DocGia_Insert", name, values, Nparamater); } catch (SqlException ex) { throw ex; } }