public bool DongPhieuMuon(PhieuMuonSach pms) { OpenConnection(); SqlCommand command = new SqlCommand(); command.CommandType = CommandType.Text; command.CommandText = "Update PhieuMuonSach set NgayTraSach='" + pms.NgayTraSach + "' ,TrangThai=N'Đã Trả Sách' where PhieuId='" + pms.MaPhieuMuon + "'"; command.Connection = conn; int ketqua = command.ExecuteNonQuery(); return(ketqua > 0); }
public bool XuLySachLoi(PhieuMuonSach pms) { OpenConnection(); SqlCommand command = new SqlCommand(); command.CommandType = CommandType.Text; command.CommandText = "update PhieuMuonSach set TrangThai=N'Sách lỗi đã được xử lý' where PhieuId='" + pms.MaPhieuMuon + "'"; command.Connection = conn; int ketqua = command.ExecuteNonQuery(); return(ketqua > 0); }
public bool TuChoiPhieuChoMuon(PhieuMuonSach pms) { OpenConnection(); SqlCommand command = new SqlCommand(); command.CommandType = CommandType.Text; command.CommandText = "update PhieuMuonSach set TrangThai=N'Đọc giả không đến' " + "where PhieuId='" + pms.MaPhieuMuon + "'"; command.Connection = conn; int ketqua = command.ExecuteNonQuery(); return(ketqua > 0); }
public bool ChapThuanPhieuDuyet(PhieuMuonSach pms) { OpenConnection(); SqlCommand command = new SqlCommand(); command.CommandType = CommandType.Text; command.CommandText = "update PhieuMuonSach set TrangThai=N'Chờ đọc giả' " + "where PhieuId='" + pms.MaPhieuMuon + "'"; command.Connection = conn; int ketqua = command.ExecuteNonQuery(); return(ketqua > 0); }
public bool DocGiaTaoPhieu(PhieuMuonSach pms) { OpenConnection(); SqlCommand command = new SqlCommand(); command.CommandType = CommandType.Text; command.CommandText = "insert into PhieuMuonSach(NguoiMuonSachId,SachId,NgayMuon,NgayDuKienTra,TrangThai) " + "values('" + pms.NguoiMuonSachId + "','" + pms.SachId + "','" + pms.NgayMuon + "','" + pms.NgayDuKienTra + "',N'Chờ duyệt')" + " update Sach set TrangThai=N'Đang cho mượn' where Id='" + pms.SachId + "'"; command.Connection = conn; int ketqua = command.ExecuteNonQuery(); return(ketqua > 0); }
public bool Them(PhieuMuonSach pPhieuMuonSach) { try { string sql = string.Format("INSERT INTO PhieuMuonSach " + "VALUES (N'{0}',NULL,N'{2}')", pPhieuMuonSach.NgayMuon, pPhieuMuonSach.NgayTra, pPhieuMuonSach.MaDocGia); SqlCommand cmd = new SqlCommand(sql, _sqlConn); cmd.Connection.Open(); cmd.ExecuteNonQuery(); cmd.Connection.Close(); return(true); } catch { return(false); } }
public bool Sua(PhieuMuonSach pPhieuMuonSach, string idx) { try { string sql = string.Format("UPDATE PhieuMuonSach " + "SET NgayMuon = '{0}', NgayTra = '{1}', MaDocGia = '{2}' " + "WHERE MaPhieuMuon = " + idx, pPhieuMuonSach.NgayMuon, pPhieuMuonSach.NgayTra, pPhieuMuonSach.MaDocGia); SqlCommand cmd = new SqlCommand(sql, _sqlConn); cmd.Connection.Open(); cmd.ExecuteNonQuery(); cmd.Connection.Close(); return(true); } catch { return(false); } }
private void detach_PhieuMuonSaches(PhieuMuonSach entity) { this.SendPropertyChanging(); entity.NhanVien = null; }
partial void DeletePhieuMuonSach(PhieuMuonSach instance);
partial void UpdatePhieuMuonSach(PhieuMuonSach instance);
partial void InsertPhieuMuonSach(PhieuMuonSach instance);
private void attach_PhieuMuonSaches(PhieuMuonSach entity) { this.SendPropertyChanging(); entity.SinhVien = this; }