Ajoutez des fichiers projet.
This commit is contained in:
commit
ae6492bc76
30 changed files with 4970 additions and 0 deletions
63
.gitattributes
vendored
Normal file
63
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
###############################################################################
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
###############################################################################
|
||||
* text=auto
|
||||
|
||||
###############################################################################
|
||||
# Set default behavior for command prompt diff.
|
||||
#
|
||||
# This is need for earlier builds of msysgit that does not have it on by
|
||||
# default for csharp files.
|
||||
# Note: This is only used by command line
|
||||
###############################################################################
|
||||
#*.cs diff=csharp
|
||||
|
||||
###############################################################################
|
||||
# Set the merge driver for project and solution files
|
||||
#
|
||||
# Merging from the command prompt will add diff markers to the files if there
|
||||
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||
# the diff markers are never inserted). Diff markers may cause the following
|
||||
# file extensions to fail to load in VS. An alternative would be to treat
|
||||
# these files as binary and thus will always conflict and require user
|
||||
# intervention with every merge. To do so, just uncomment the entries below
|
||||
###############################################################################
|
||||
#*.sln merge=binary
|
||||
#*.csproj merge=binary
|
||||
#*.vbproj merge=binary
|
||||
#*.vcxproj merge=binary
|
||||
#*.vcproj merge=binary
|
||||
#*.dbproj merge=binary
|
||||
#*.fsproj merge=binary
|
||||
#*.lsproj merge=binary
|
||||
#*.wixproj merge=binary
|
||||
#*.modelproj merge=binary
|
||||
#*.sqlproj merge=binary
|
||||
#*.wwaproj merge=binary
|
||||
|
||||
###############################################################################
|
||||
# behavior for image files
|
||||
#
|
||||
# image files are treated as binary by default.
|
||||
###############################################################################
|
||||
#*.jpg binary
|
||||
#*.png binary
|
||||
#*.gif binary
|
||||
|
||||
###############################################################################
|
||||
# diff behavior for common document formats
|
||||
#
|
||||
# Convert binary document formats to text before diffing them. This feature
|
||||
# is only available from the command line. Turn it on by uncommenting the
|
||||
# entries below.
|
||||
###############################################################################
|
||||
#*.doc diff=astextplain
|
||||
#*.DOC diff=astextplain
|
||||
#*.docx diff=astextplain
|
||||
#*.DOCX diff=astextplain
|
||||
#*.dot diff=astextplain
|
||||
#*.DOT diff=astextplain
|
||||
#*.pdf diff=astextplain
|
||||
#*.PDF diff=astextplain
|
||||
#*.rtf diff=astextplain
|
||||
#*.RTF diff=astextplain
|
||||
363
.gitignore
vendored
Normal file
363
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,363 @@
|
|||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Ww][Ii][Nn]32/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Oo]ut/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUnit
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# ASP.NET Scaffolding
|
||||
ScaffoldingReadMe.txt
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Coverlet is a free, cross platform Code Coverage Tool
|
||||
coverage*.json
|
||||
coverage*.xml
|
||||
coverage*.info
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
25
MediaTekDocuments.sln
Normal file
25
MediaTekDocuments.sln
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.32413.511
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaTekDocuments", "MediaTekDocuments\MediaTekDocuments.csproj", "{75DE903D-6147-4E14-BBE0-FA20CD1F9840}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{75DE903D-6147-4E14-BBE0-FA20CD1F9840}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{75DE903D-6147-4E14-BBE0-FA20CD1F9840}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{75DE903D-6147-4E14-BBE0-FA20CD1F9840}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{75DE903D-6147-4E14-BBE0-FA20CD1F9840}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {9B2569CA-5E60-4743-9497-FCE8940AD153}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
16
MediaTekDocuments/App.config
Normal file
16
MediaTekDocuments/App.config
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
114
MediaTekDocuments/MediaTekDocuments.csproj
Normal file
114
MediaTekDocuments/MediaTekDocuments.csproj
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{75DE903D-6147-4E14-BBE0-FA20CD1F9840}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>MediaTekDocuments</RootNamespace>
|
||||
<AssemblyName>MediaTekDocuments</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942" />
|
||||
<Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604" />
|
||||
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d" />
|
||||
<Reference Include="MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL" />
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Configuration.Install" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Ubiety.Dns.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||
<Reference Include="ZstdNet, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="manager\ApiRest.cs" />
|
||||
<Compile Include="controller\FrmMediatekController.cs" />
|
||||
<Compile Include="dal\Access.cs" />
|
||||
<Compile Include="view\FrmMediatek.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="view\FrmMediatek.Designer.cs">
|
||||
<DependentUpon>FrmMediatek.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="model\Categorie.cs" />
|
||||
<Compile Include="model\Document.cs" />
|
||||
<Compile Include="model\Dvd.cs" />
|
||||
<Compile Include="model\Etat.cs" />
|
||||
<Compile Include="model\Exemplaire.cs" />
|
||||
<Compile Include="model\Genre.cs" />
|
||||
<Compile Include="model\Livre.cs" />
|
||||
<Compile Include="model\LivreDvd.cs" />
|
||||
<Compile Include="model\Public.cs" />
|
||||
<Compile Include="model\Rayon.cs" />
|
||||
<Compile Include="model\Revue.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="view\FrmMediatek.resx">
|
||||
<DependentUpon>FrmMediatek.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
20
MediaTekDocuments/Program.cs
Normal file
20
MediaTekDocuments/Program.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using MediaTekDocuments.view;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MediaTekDocuments
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Point d'entrée principal de l'application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new FrmMediatek());
|
||||
}
|
||||
}
|
||||
}
|
||||
36
MediaTekDocuments/Properties/AssemblyInfo.cs
Normal file
36
MediaTekDocuments/Properties/AssemblyInfo.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Les informations générales relatives à un assembly dépendent de
|
||||
// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
|
||||
// associées à un assembly.
|
||||
[assembly: AssemblyTitle("MediaTekDocuments")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MediaTekDocuments")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
|
||||
// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
|
||||
// COM, affectez la valeur true à l'attribut ComVisible sur ce type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
|
||||
[assembly: Guid("75de903d-6147-4e14-bbe0-fa20cd1f9840")]
|
||||
|
||||
// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
|
||||
//
|
||||
// Version principale
|
||||
// Version secondaire
|
||||
// Numéro de build
|
||||
// Révision
|
||||
//
|
||||
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
|
||||
// en utilisant '*', comme indiqué ci-dessous :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
70
MediaTekDocuments/Properties/Resources.Designer.cs
generated
Normal file
70
MediaTekDocuments/Properties/Resources.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Ce code a été généré par un outil.
|
||||
// Version du runtime :4.0.30319.42000
|
||||
//
|
||||
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
|
||||
// le code est régénéré.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace MediaTekDocuments.Properties
|
||||
{
|
||||
/// <summary>
|
||||
/// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
|
||||
/// </summary>
|
||||
// Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder
|
||||
// à l'aide d'un outil, tel que ResGen ou Visual Studio.
|
||||
// Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
|
||||
// avec l'option /str ou régénérez votre projet VS.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MediaTekDocuments.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remplace la propriété CurrentUICulture du thread actuel pour toutes
|
||||
/// les recherches de ressources à l'aide de cette classe de ressource fortement typée.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
MediaTekDocuments/Properties/Resources.resx
Normal file
117
MediaTekDocuments/Properties/Resources.resx
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
36
MediaTekDocuments/Properties/Settings.Designer.cs
generated
Normal file
36
MediaTekDocuments/Properties/Settings.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Ce code a été généré par un outil.
|
||||
// Version du runtime :4.0.30319.42000
|
||||
//
|
||||
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
|
||||
// le code est régénéré.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MediaTekDocuments.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("server=localhost;user id=root;database=mediatek86")]
|
||||
public string mediatek86ConnectionString {
|
||||
get {
|
||||
return ((string)(this["mediatek86ConnectionString"]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
14
MediaTekDocuments/Properties/Settings.settings
Normal file
14
MediaTekDocuments/Properties/Settings.settings
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="MediaTekDocuments.Properties" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="mediatek86ConnectionString" Type="(Connection string)" Scope="Application">
|
||||
<DesignTimeValue Profile="(Default)"><?xml version="1.0" encoding="utf-16"?>
|
||||
<SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<ConnectionString>server=localhost;user id=root;database=mediatek86</ConnectionString>
|
||||
<ProviderName>MySql.Data.MySqlClient</ProviderName>
|
||||
</SerializableConnectionString></DesignTimeValue>
|
||||
<Value Profile="(Default)">server=localhost;user id=root;database=mediatek86</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
100
MediaTekDocuments/controller/FrmMediatekController.cs
Normal file
100
MediaTekDocuments/controller/FrmMediatekController.cs
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
using System.Collections.Generic;
|
||||
using MediaTekDocuments.model;
|
||||
using MediaTekDocuments.dal;
|
||||
|
||||
namespace MediaTekDocuments.controller
|
||||
{
|
||||
/// <summary>
|
||||
/// Contrôleur lié à FrmMediatek
|
||||
/// </summary>
|
||||
class FrmMediatekController
|
||||
{
|
||||
/// <summary>
|
||||
/// Objet d'accès aux données
|
||||
/// </summary>
|
||||
private readonly Access access;
|
||||
|
||||
/// <summary>
|
||||
/// Récupération de l'instance unique d'accès aux données
|
||||
/// </summary>
|
||||
public FrmMediatekController()
|
||||
{
|
||||
access = Access.GetInstance();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// getter sur la liste des genres
|
||||
/// </summary>
|
||||
/// <returns>Liste d'objets Genre</returns>
|
||||
public List<Categorie> GetAllGenres()
|
||||
{
|
||||
return access.GetAllGenres();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// getter sur la liste des livres
|
||||
/// </summary>
|
||||
/// <returns>Liste d'objets Livre</returns>
|
||||
public List<Livre> GetAllLivres()
|
||||
{
|
||||
return access.GetAllLivres();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// getter sur la liste des Dvd
|
||||
/// </summary>
|
||||
/// <returns>Liste d'objets dvd</returns>
|
||||
public List<Dvd> GetAllDvd()
|
||||
{
|
||||
return access.GetAllDvd();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// getter sur la liste des revues
|
||||
/// </summary>
|
||||
/// <returns>Liste d'objets Revue</returns>
|
||||
public List<Revue> GetAllRevues()
|
||||
{
|
||||
return access.GetAllRevues();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// getter sur les rayons
|
||||
/// </summary>
|
||||
/// <returns>Liste d'objets Rayon</returns>
|
||||
public List<Categorie> GetAllRayons()
|
||||
{
|
||||
return access.GetAllRayons();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// getter sur les publics
|
||||
/// </summary>
|
||||
/// <returns>Liste d'objets Public</returns>
|
||||
public List<Categorie> GetAllPublics()
|
||||
{
|
||||
return access.GetAllPublics();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// récupère les exemplaires d'une revue
|
||||
/// </summary>
|
||||
/// <param name="idDocuement">id de la revue concernée</param>
|
||||
/// <returns>Liste d'objets Exemplaire</returns>
|
||||
public List<Exemplaire> GetExemplairesRevue(string idDocuement)
|
||||
{
|
||||
return access.GetExemplairesRevue(idDocuement);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Crée un exemplaire d'une revue dans la bdd
|
||||
/// </summary>
|
||||
/// <param name="exemplaire">L'objet Exemplaire concerné</param>
|
||||
/// <returns>True si la création a pu se faire</returns>
|
||||
public bool CreerExemplaire(Exemplaire exemplaire)
|
||||
{
|
||||
return access.CreerExemplaire(exemplaire);
|
||||
}
|
||||
}
|
||||
}
|
||||
248
MediaTekDocuments/dal/Access.cs
Normal file
248
MediaTekDocuments/dal/Access.cs
Normal file
|
|
@ -0,0 +1,248 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaTekDocuments.model;
|
||||
using MediaTekDocuments.manager;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Configuration;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaTekDocuments.dal
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe d'accès aux données
|
||||
/// </summary>
|
||||
public class Access
|
||||
{
|
||||
/// <summary>
|
||||
/// adresse de l'API
|
||||
/// </summary>
|
||||
private static readonly string uriApi = "http://localhost/rest_mediatekdocuments/";
|
||||
/// <summary>
|
||||
/// instance unique de la classe
|
||||
/// </summary>
|
||||
private static Access instance = null;
|
||||
/// <summary>
|
||||
/// instance de ApiRest pour envoyer des demandes vers l'api et recevoir la réponse
|
||||
/// </summary>
|
||||
private readonly ApiRest api = null;
|
||||
/// <summary>
|
||||
/// méthode HTTP pour select
|
||||
/// </summary>
|
||||
private const string GET = "GET";
|
||||
/// <summary>
|
||||
/// méthode HTTP pour insert
|
||||
/// </summary>
|
||||
private const string POST = "POST";
|
||||
/// <summary>
|
||||
/// méthode HTTP pour update
|
||||
|
||||
/// <summary>
|
||||
/// Méthode privée pour créer un singleton
|
||||
/// initialise l'accès à l'API
|
||||
/// </summary>
|
||||
private Access()
|
||||
{
|
||||
String authenticationString;
|
||||
try
|
||||
{
|
||||
authenticationString = "admin:adminpwd";
|
||||
api = ApiRest.GetInstance(uriApi, authenticationString);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Création et retour de l'instance unique de la classe
|
||||
/// </summary>
|
||||
/// <returns>instance unique de la classe</returns>
|
||||
public static Access GetInstance()
|
||||
{
|
||||
if(instance == null)
|
||||
{
|
||||
instance = new Access();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retourne tous les genres à partir de la BDD
|
||||
/// </summary>
|
||||
/// <returns>Liste d'objets Genre</returns>
|
||||
public List<Categorie> GetAllGenres()
|
||||
{
|
||||
IEnumerable<Genre> lesGenres = TraitementRecup<Genre>(GET, "genre", null);
|
||||
return new List<Categorie>(lesGenres);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retourne tous les rayons à partir de la BDD
|
||||
/// </summary>
|
||||
/// <returns>Liste d'objets Rayon</returns>
|
||||
public List<Categorie> GetAllRayons()
|
||||
{
|
||||
IEnumerable<Rayon> lesRayons = TraitementRecup<Rayon>(GET, "rayon", null);
|
||||
return new List<Categorie>(lesRayons);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retourne toutes les catégories de public à partir de la BDD
|
||||
/// </summary>
|
||||
/// <returns>Liste d'objets Public</returns>
|
||||
public List<Categorie> GetAllPublics()
|
||||
{
|
||||
IEnumerable<Public> lesPublics = TraitementRecup<Public>(GET, "public", null);
|
||||
return new List<Categorie>(lesPublics);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retourne toutes les livres à partir de la BDD
|
||||
/// </summary>
|
||||
/// <returns>Liste d'objets Livre</returns>
|
||||
public List<Livre> GetAllLivres()
|
||||
{
|
||||
List<Livre> lesLivres = TraitementRecup<Livre>(GET, "livre", null);
|
||||
return lesLivres;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retourne toutes les dvd à partir de la BDD
|
||||
/// </summary>
|
||||
/// <returns>Liste d'objets Dvd</returns>
|
||||
public List<Dvd> GetAllDvd()
|
||||
{
|
||||
List<Dvd> lesDvd = TraitementRecup<Dvd>(GET, "dvd", null);
|
||||
return lesDvd;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retourne toutes les revues à partir de la BDD
|
||||
/// </summary>
|
||||
/// <returns>Liste d'objets Revue</returns>
|
||||
public List<Revue> GetAllRevues()
|
||||
{
|
||||
List<Revue> lesRevues = TraitementRecup<Revue>(GET, "revue", null);
|
||||
return lesRevues;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Retourne les exemplaires d'une revue
|
||||
/// </summary>
|
||||
/// <param name="idDocument">id de la revue concernée</param>
|
||||
/// <returns>Liste d'objets Exemplaire</returns>
|
||||
public List<Exemplaire> GetExemplairesRevue(string idDocument)
|
||||
{
|
||||
String jsonIdDocument = convertToJson("id", idDocument);
|
||||
List<Exemplaire> lesExemplaires = TraitementRecup<Exemplaire>(GET, "exemplaire/" + jsonIdDocument, null);
|
||||
return lesExemplaires;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ecriture d'un exemplaire en base de données
|
||||
/// </summary>
|
||||
/// <param name="exemplaire">exemplaire à insérer</param>
|
||||
/// <returns>true si l'insertion a pu se faire (retour != null)</returns>
|
||||
public bool CreerExemplaire(Exemplaire exemplaire)
|
||||
{
|
||||
String jsonExemplaire = JsonConvert.SerializeObject(exemplaire, new CustomDateTimeConverter());
|
||||
try
|
||||
{
|
||||
List<Exemplaire> liste = TraitementRecup<Exemplaire>(POST, "exemplaire", "champs=" + jsonExemplaire);
|
||||
return (liste != null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Traitement de la récupération du retour de l'api, avec conversion du json en liste pour les select (GET)
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="methode">verbe HTTP (GET, POST, PUT, DELETE)</param>
|
||||
/// <param name="message">information envoyée dans l'url</param>
|
||||
/// <param name="parametres">paramètres à envoyer dans le body, au format "chp1=val1&chp2=val2&..."</param>
|
||||
/// <returns>liste d'objets récupérés (ou liste vide)</returns>
|
||||
private List<T> TraitementRecup<T> (String methode, String message, String parametres)
|
||||
{
|
||||
// trans
|
||||
List<T> liste = new List<T>();
|
||||
try
|
||||
{
|
||||
JObject retour = api.RecupDistant(methode, message, parametres);
|
||||
// extraction du code retourné
|
||||
String code = (String)retour["code"];
|
||||
if (code.Equals("200"))
|
||||
{
|
||||
// dans le cas du GET (select), récupération de la liste d'objets
|
||||
if (methode.Equals(GET))
|
||||
{
|
||||
String resultString = JsonConvert.SerializeObject(retour["result"]);
|
||||
// construction de la liste d'objets à partir du retour de l'api
|
||||
liste = JsonConvert.DeserializeObject<List<T>>(resultString, new CustomBooleanJsonConverter());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("code erreur = " + code + " message = " + (String)retour["message"]);
|
||||
}
|
||||
}catch(Exception e)
|
||||
{
|
||||
Console.WriteLine("Erreur lors de l'accès à l'API : "+e.Message);
|
||||
Environment.Exit(0);
|
||||
}
|
||||
return liste;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convertit en json un couple nom/valeur
|
||||
/// </summary>
|
||||
/// <param name="nom"></param>
|
||||
/// <param name="valeur"></param>
|
||||
/// <returns>couple au format json</returns>
|
||||
private String convertToJson(Object nom, Object valeur)
|
||||
{
|
||||
Dictionary<Object, Object> dictionary = new Dictionary<Object, Object>();
|
||||
dictionary.Add(nom, valeur);
|
||||
return JsonConvert.SerializeObject(dictionary);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Modification du convertisseur Json pour gérer le format de date
|
||||
/// </summary>
|
||||
private sealed class CustomDateTimeConverter : IsoDateTimeConverter
|
||||
{
|
||||
public CustomDateTimeConverter()
|
||||
{
|
||||
base.DateTimeFormat = "yyyy-MM-dd";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Modification du convertisseur Json pour prendre en compte les booléens
|
||||
/// classe trouvée sur le site :
|
||||
/// https://www.thecodebuzz.com/newtonsoft-jsonreaderexception-could-not-convert-string-to-boolean/
|
||||
/// </summary>
|
||||
private sealed class CustomBooleanJsonConverter : JsonConverter<bool>
|
||||
{
|
||||
public override bool ReadJson(JsonReader reader, Type objectType, bool existingValue, bool hasExistingValue, JsonSerializer serializer)
|
||||
{
|
||||
return Convert.ToBoolean(reader.ValueType == typeof(string) ? Convert.ToByte(reader.Value) : reader.Value);
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, bool value, JsonSerializer serializer)
|
||||
{
|
||||
serializer.Serialize(writer, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
96
MediaTekDocuments/manager/ApiRest.cs
Normal file
96
MediaTekDocuments/manager/ApiRest.cs
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
using System;
|
||||
using System.Net.Http;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace MediaTekDocuments.manager
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe indépendante d'accès à une api rest avec éventuellement une "basic authorization"
|
||||
/// </summary>
|
||||
class ApiRest
|
||||
{
|
||||
/// <summary>
|
||||
/// unique instance de la classe
|
||||
/// </summary>
|
||||
private static ApiRest instance = null;
|
||||
/// <summary>
|
||||
/// Objet de connexion à l'api
|
||||
/// </summary>
|
||||
private readonly HttpClient httpClient;
|
||||
/// <summary>
|
||||
/// Canal http pour l'envoi du message et la récupération de la réponse
|
||||
/// </summary>
|
||||
private HttpResponseMessage httpResponse;
|
||||
|
||||
/// <summary>
|
||||
/// Constructeur privé pour préparer la connexion (éventuellement sécurisée)
|
||||
/// </summary>
|
||||
/// <param name="uriApi">adresse de l'api</param>
|
||||
/// <param name="authenticationString">chaîne d'authentification</param>
|
||||
private ApiRest(String uriApi, String authenticationString="")
|
||||
{
|
||||
httpClient = new HttpClient() { BaseAddress = new Uri(uriApi) };
|
||||
// prise en compte dans l'url de l'authentificaiton (basic authorization), si elle n'est pas vide
|
||||
if (!String.IsNullOrEmpty(authenticationString))
|
||||
{
|
||||
String base64EncodedAuthenticationString = Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(authenticationString));
|
||||
httpClient.DefaultRequestHeaders.Add("Authorization", "Basic " + base64EncodedAuthenticationString);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Crée une instance unique de la classe
|
||||
/// </summary>
|
||||
/// <param name="uriApi">adresse de l'api</param>
|
||||
/// <param name="authenticationString">chaîne d'authentificatio (login:pwd)</param>
|
||||
/// <returns></returns>
|
||||
public static ApiRest GetInstance(String uriApi, String authenticationString)
|
||||
{
|
||||
if(instance == null)
|
||||
{
|
||||
instance = new ApiRest(uriApi, authenticationString);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Envoi une demande à l'API et récupère la réponse
|
||||
/// </summary>
|
||||
/// <param name="methode">verbe http (GET, POST, PUT, DELETE)</param>
|
||||
/// <param name="message">message à envoyer dans l'URL</param>
|
||||
/// <param name="parametres">contenu de variables à mettre dans body</param>
|
||||
/// <returns>liste d'objets (select) ou liste vide (ok) ou null si erreur</returns>
|
||||
public JObject RecupDistant(string methode, string message, String parametres)
|
||||
{
|
||||
// transformation des paramètres pour les mettre dans le body
|
||||
StringContent content = null;
|
||||
if(!(parametres is null))
|
||||
{
|
||||
content = new StringContent(parametres, System.Text.Encoding.UTF8, "application/x-www-form-urlencoded");
|
||||
}
|
||||
// envoi du message et attente de la réponse
|
||||
switch (methode)
|
||||
{
|
||||
case "GET":
|
||||
httpResponse = httpClient.GetAsync(message).Result;
|
||||
break;
|
||||
case "POST":
|
||||
httpResponse = httpClient.PostAsync(message, content).Result;
|
||||
break;
|
||||
case "PUT":
|
||||
httpResponse = httpClient.PutAsync(message, content).Result;
|
||||
break;
|
||||
case "DELETE":
|
||||
httpResponse = httpClient.DeleteAsync(message).Result;
|
||||
break;
|
||||
// methode incorrecte
|
||||
default:
|
||||
return new JObject();
|
||||
}
|
||||
// récupération de l'information retournée par l'api
|
||||
var json = httpResponse.Content.ReadAsStringAsync().Result;
|
||||
return JObject.Parse(json);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
28
MediaTekDocuments/model/Categorie.cs
Normal file
28
MediaTekDocuments/model/Categorie.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
namespace MediaTekDocuments.model
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe métier Categorie (réunit les informations des classes Public, Genre et Rayon)
|
||||
/// </summary>
|
||||
public class Categorie
|
||||
{
|
||||
public string Id { get; }
|
||||
public string Libelle { get; }
|
||||
|
||||
public Categorie(string id, string libelle)
|
||||
{
|
||||
this.Id = id;
|
||||
this.Libelle = libelle;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Récupération du libellé pour l'affichage dans les combos
|
||||
/// </summary>
|
||||
/// <returns>Libelle</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Libelle;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
32
MediaTekDocuments/model/Document.cs
Normal file
32
MediaTekDocuments/model/Document.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
namespace MediaTekDocuments.model
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe métier Document (réunit les infomations communes à tous les documents : Livre, Revue, Dvd)
|
||||
/// </summary>
|
||||
public class Document
|
||||
{
|
||||
public string Id { get; }
|
||||
public string Titre { get; }
|
||||
public string Image { get; }
|
||||
public string IdGenre { get; }
|
||||
public string Genre { get; }
|
||||
public string IdPublic { get; }
|
||||
public string Public { get; }
|
||||
public string IdRayon { get; }
|
||||
public string Rayon { get; }
|
||||
|
||||
public Document(string id, string titre, string image, string idGenre, string genre, string idPublic, string lePublic, string idRayon, string rayon)
|
||||
{
|
||||
Id = id;
|
||||
Titre = titre;
|
||||
Image = image;
|
||||
IdGenre = idGenre;
|
||||
Genre = genre;
|
||||
IdPublic = idPublic;
|
||||
Public = lePublic;
|
||||
IdRayon = idRayon;
|
||||
Rayon = rayon;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
MediaTekDocuments/model/Dvd.cs
Normal file
23
MediaTekDocuments/model/Dvd.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
namespace MediaTekDocuments.model
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe métier Dvd hérite de LivreDvd : contient des propriétés spécifiques aux dvd
|
||||
/// </summary>
|
||||
public class Dvd : LivreDvd
|
||||
{
|
||||
public int Duree { get; }
|
||||
public string Realisateur { get; }
|
||||
public string Synopsis { get; }
|
||||
|
||||
public Dvd(string id, string titre, string image, int duree, string realisateur, string synopsis,
|
||||
string idGenre, string genre, string idPublic, string lePublic, string idRayon, string rayon)
|
||||
: base(id, titre, image, idGenre, genre, idPublic, lePublic, idRayon, rayon)
|
||||
{
|
||||
this.Duree = duree;
|
||||
this.Realisateur = realisateur;
|
||||
this.Synopsis = synopsis;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
19
MediaTekDocuments/model/Etat.cs
Normal file
19
MediaTekDocuments/model/Etat.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
namespace MediaTekDocuments.model
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe métier Etat (état d'usure d'un document)
|
||||
/// </summary>
|
||||
public class Etat
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Libelle { get; set; }
|
||||
|
||||
public Etat(string id, string libelle)
|
||||
{
|
||||
this.Id = id;
|
||||
this.Libelle = libelle;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
26
MediaTekDocuments/model/Exemplaire.cs
Normal file
26
MediaTekDocuments/model/Exemplaire.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
|
||||
namespace MediaTekDocuments.model
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe métier Exemplaire (exemplaire d'une revue)
|
||||
/// </summary>
|
||||
public class Exemplaire
|
||||
{
|
||||
public int Numero { get; set; }
|
||||
public string Photo { get; set; }
|
||||
public DateTime DateAchat { get; set; }
|
||||
public string IdEtat { get; set; }
|
||||
public string Id { get; set; }
|
||||
|
||||
public Exemplaire(int numero, DateTime dateAchat, string photo, string idEtat, string idDocument)
|
||||
{
|
||||
this.Numero = numero;
|
||||
this.DateAchat = dateAchat;
|
||||
this.Photo = photo;
|
||||
this.IdEtat = idEtat;
|
||||
this.Id = idDocument;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
14
MediaTekDocuments/model/Genre.cs
Normal file
14
MediaTekDocuments/model/Genre.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
namespace MediaTekDocuments.model
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe métier Genre : hérite de Categorie
|
||||
/// </summary>
|
||||
public class Genre : Categorie
|
||||
{
|
||||
public Genre(string id, string libelle) : base(id, libelle)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
25
MediaTekDocuments/model/Livre.cs
Normal file
25
MediaTekDocuments/model/Livre.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
namespace MediaTekDocuments.model
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe métier Livre hérite de LivreDvd : contient des propriétés spécifiques aux livres
|
||||
/// </summary>
|
||||
public class Livre : LivreDvd
|
||||
{
|
||||
public string Isbn { get; }
|
||||
public string Auteur { get; }
|
||||
public string Collection { get; }
|
||||
|
||||
public Livre(string id, string titre, string image, string isbn, string auteur, string collection,
|
||||
string idGenre, string genre, string idPublic, string lePublic, string idRayon, string rayon)
|
||||
: base(id, titre, image, idGenre, genre, idPublic, lePublic, idRayon, rayon)
|
||||
{
|
||||
this.Isbn = isbn;
|
||||
this.Auteur = auteur;
|
||||
this.Collection = collection;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
16
MediaTekDocuments/model/LivreDvd.cs
Normal file
16
MediaTekDocuments/model/LivreDvd.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
namespace MediaTekDocuments.model
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe métier LivreDvd hérite de Document
|
||||
/// </summary>
|
||||
public abstract class LivreDvd : Document
|
||||
{
|
||||
protected LivreDvd(string id, string titre, string image, string idGenre, string genre,
|
||||
string idPublic, string lePublic, string idRayon, string rayon)
|
||||
: base(id, titre, image, idGenre, genre, idPublic, lePublic, idRayon, rayon)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
14
MediaTekDocuments/model/Public.cs
Normal file
14
MediaTekDocuments/model/Public.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
namespace MediaTekDocuments.model
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe métier Public (public concerné par le document) hérite de Categorie
|
||||
/// </summary>
|
||||
public class Public : Categorie
|
||||
{
|
||||
public Public(string id, string libelle) : base(id, libelle)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
14
MediaTekDocuments/model/Rayon.cs
Normal file
14
MediaTekDocuments/model/Rayon.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
namespace MediaTekDocuments.model
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe métier Rayon (rayon de classement du document) hérite de Categorie
|
||||
/// </summary>
|
||||
public class Rayon : Categorie
|
||||
{
|
||||
public Rayon(string id, string libelle) : base(id, libelle)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
22
MediaTekDocuments/model/Revue.cs
Normal file
22
MediaTekDocuments/model/Revue.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
namespace MediaTekDocuments.model
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe métier Revue hérite de Document : contient des propriétés spécifiques aux revues
|
||||
/// </summary>
|
||||
public class Revue : Document
|
||||
{
|
||||
public string Periodicite { get; set; }
|
||||
public int DelaiMiseADispo { get; set; }
|
||||
|
||||
public Revue(string id, string titre, string image, string idGenre, string genre,
|
||||
string idPublic, string lePublic, string idRayon, string rayon,
|
||||
string periodicite, int delaiMiseADispo)
|
||||
: base(id, titre, image, idGenre, genre, idPublic, lePublic, idRayon, rayon)
|
||||
{
|
||||
Periodicite = periodicite;
|
||||
DelaiMiseADispo = delaiMiseADispo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
4
MediaTekDocuments/packages.config
Normal file
4
MediaTekDocuments/packages.config
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
|
||||
</packages>
|
||||
1975
MediaTekDocuments/view/FrmMediatek.Designer.cs
generated
Normal file
1975
MediaTekDocuments/view/FrmMediatek.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
1243
MediaTekDocuments/view/FrmMediatek.cs
Normal file
1243
MediaTekDocuments/view/FrmMediatek.cs
Normal file
File diff suppressed because it is too large
Load diff
120
MediaTekDocuments/view/FrmMediatek.resx
Normal file
120
MediaTekDocuments/view/FrmMediatek.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
77
README.md
Normal file
77
README.md
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
# MediatekDocuments
|
||||
Cette application permet de gérer les documents (livres, DVD, revues) d'une médiathèque. Elle a été codée en C# sous Visual Studio 2019. C'est une application de bureau, prévue d'être installée sur plusieurs postes accédant à la même base de données.<br>
|
||||
L'application exploite une API REST pour accéder à la BDD MySQL. Des explications sont données plus loin, ainsi que le lien de récupération.
|
||||
## Présentation
|
||||
Actuellement l'application est partiellement codée. Voici les fonctionnalités actuellement opérationnelles : recherches et affichage d'informations sur les documents de la médiathèque (livres, DVD, revues), réception de nouveaux numéros de revues.<br>
|
||||

|
||||
<br>L'application ne comporte qu'une seule fenêtre divisée en plusieurs onglets.
|
||||
## Les différents onglets
|
||||
### Onglet 1 : Livres
|
||||
Cet onglet présente la liste des livres, triée par défaut sur le titre.<br>
|
||||
La liste comporte les informations suivantes : titre, auteur, collection, genre, public, rayon.
|
||||

|
||||
#### Recherches
|
||||
<strong>Par le titre :</strong> Il est possible de rechercher un ou plusieurs livres par le titre. La saisie dans la zone de recherche se fait en autocomplétions sans tenir compte de la casse. Seuls les livres concernés apparaissent dans la liste.<br>
|
||||
<strong>Par le numéro :</strong> il est possible de saisir un numéro et, en cliquant sur "Rechercher", seul le livre concerné apparait dans la liste (ou un message d'erreur si le livre n'est pas trouvé, avec la liste remplie à nouveau).
|
||||
#### Filtres
|
||||
Il est possible d'appliquer un filtre (un seul à la fois) sur une de ces 3 catégories : genre, public, rayon.<br>
|
||||
Un combo par catégorie permet de sélectionner un item. Seuls les livres correspondant à l'item sélectionné, apparaissent dans la liste (par exemple, en choisissant le genre "Policier", seuls les livres de genre "Policier" apparaissent).<br>
|
||||
Le fait de sélectionner un autre filtre ou de faire une recherche, annule le filtre actuel.<br>
|
||||
Il est possible aussi d'annuler le filtre en cliquant sur une des croix.
|
||||
#### Tris
|
||||
Le fait de cliquer sur le titre d'une des colonnes de la liste des livres, permet de trier la liste par rapport à la colonne choisie.
|
||||
#### Affichage des informations détaillées
|
||||
Si la liste des livres contient des éléments, par défaut il y en a toujours un de sélectionné. Il est aussi possible de sélectionner une ligne (donc un livre) en cliquant n'importe où sur la ligne.<br>
|
||||
La partie basse de la fenêtre affiche les informations détaillées du livre sélectionné (numéro de document, code ISBN, titre, auteur(e), collection, genre, public, rayon, chemin de l'image) ainsi que l'image.
|
||||
### Onglet 2 : DVD
|
||||
Cet onglet présente la liste des DVD, triée par titre.<br>
|
||||
La liste comporte les informations suivantes : titre, durée, réalisateur, genre, public, rayon.<br>
|
||||
Le fonctionnement est identique à l'onglet des livres.<br>
|
||||
La seule différence réside dans certaines informations détaillées, spécifiques aux DVD : durée (à la place de ISBN), réalisateur (à la place de l'auteur), synopsis (à la place de collection).
|
||||
### Onglet 3 : Revues
|
||||
Cet onglet présente la liste des revues, triées par titre.<br>
|
||||
La liste comporte les informations suivantes : titre, périodicité, délai mise à dispo, genre, public, rayon.<br>
|
||||
Le fonctionnement est identique à l'onglet des livres.<br>
|
||||
La seule différence réside dans certaines informations détaillées, spécifiques aux revues : périodicité (à la place de l'auteur), délai mise à dispo (à la place de collection).
|
||||
### Onglet 4 : Parutions des revues
|
||||
Cet onglet permet d'enregistrer la réception de nouvelles parutions d'une revue.<br>
|
||||
Il se décompose en 2 parties (groupbox).
|
||||
#### Partie "Recherche revue"
|
||||
Cette partie permet, à partir de la saisie d'un numéro de revue (puis en cliquant sur le bouton "Rechercher"), d'afficher toutes les informations de la revue (comme dans l'onglet précédent), ainsi que son image principale en petit, avec en plus la liste des parutions déjà reçues (numéro, date achat, chemin photo). Sur la sélection d'une ligne dans la liste des parutions, la photo de la parution correspondante s'affiche à droite.<br>
|
||||
Dès qu'un numéro de revue est reconnu et ses informations affichées, la seconde partie ("Nouvelle parution réceptionnée pour cette revue") devient accessible.<br>
|
||||
Si une modification est apportée au numéro de la revue, toutes les zones sont réinitialisées et la seconde partie est rendue inaccessible, tant que le bouton "Rechercher" n'est pas utilisé.
|
||||
#### Partie "Nouvelle parution réceptionnée pour cette revue"
|
||||
Cette partie n'est accessible que si une revue a bien été trouvée dans la première partie.<br>
|
||||
Il est possible alors de réceptionner une nouvelle parution en saisissant son numéro, en sélectionnant une date (date du jour proposée par défaut) et en cherchant l'image correspondante (optionnel) qui doit alors s'afficher à droite.<br>
|
||||
Le clic sur "Valider la réception" va permettre d'ajouter un tuple dans la table Exemplaire de la BDD. La parution correspondante apparaitra alors automatiquement dans la liste des parutions et les zones de la partie "Nouvelle parution réceptionnée pour cette revue" seront réinitialisées.<br>
|
||||
Si le numéro de la parution existe déjà, il n’est pas ajouté et un message est affiché.
|
||||

|
||||
## La base de données
|
||||
La base de données 'mediatek86 ' est au format MySQL.<br>
|
||||
Voici sa structure :<br>
|
||||

|
||||
<br>On distingue les documents "génériques" (ce sont les entités Document, Revue, Livres-DVD, Livre et DVD) des documents "physiques" qui sont les exemplaires de livres ou de DVD, ou bien les numéros d’une revue ou d’un journal.<br>
|
||||
Chaque exemplaire est numéroté à l’intérieur du document correspondant, et a donc un identifiant relatif. Cet identifiant est réel : ce n'est pas un numéro automatique. <br>
|
||||
Un exemplaire est caractérisé par :<br>
|
||||
. un état d’usure, les différents états étant mémorisés dans la table Etat ;<br>
|
||||
. sa date d’achat ou de parution dans le cas d’une revue ;<br>
|
||||
. un lien vers le fichier contenant sa photo de couverture de l'exemplaire, renseigné uniquement pour les exemplaires des revues, donc les parutions (chemin complet) ;
|
||||
<br>
|
||||
Un document a un titre (titre de livre, titre de DVD ou titre de la revue), concerne une catégorie de public, possède un genre et est entreposé dans un rayon défini. Les genres, les catégories de public et les rayons sont gérés dans la base de données. Un document possède aussi une image dont le chemin complet est mémorisé. Même les revues peuvent avoir une image générique, en plus des photos liées à chaque exemplaire (parution).<br>
|
||||
Une revue est un document, d’où le lien de spécialisation entre les 2 entités. Une revue est donc identifiée par son numéro de document. Elle a une périodicité (quotidien, hebdomadaire, etc.) et un délai de mise à disposition (temps pendant lequel chaque exemplaire est laissé en consultation). Chaque parution (exemplaire) d'une revue n'est disponible qu'en un seul "exemplaire".<br>
|
||||
Un livre a aussi pour identifiant son numéro de document, possède un code ISBN, un auteur et peut faire partie d’une collection. Les auteurs et les collections ne sont pas gérés dans des tables séparées (ce sont de simples champs textes dans la table Livre).<br>
|
||||
De même, un DVD est aussi identifié par son numéro de document, et possède un synopsis, un réalisateur et une durée. Les réalisateurs ne sont pas gérés dans une table séparée (c’est un simple champ texte dans la table DVD).
|
||||
Enfin, 3 tables permettent de mémoriser les données concernant les commandes de livres ou DVD et les abonnements. Une commande est effectuée à une date pour un certain montant. Un abonnement est une commande qui a pour propriété complémentaire la date de fin de l’abonnement : il concerne une revue. Une commande de livre ou DVD a comme caractéristique le nombre d’exemplaires commandé et concerne donc un livre ou un DVD.<br>
|
||||
<br>
|
||||
La base de données est remplie de quelques exemples pour pouvoir tester son application. Dans les champs image (de Document) et photo (de Exemplaire) doit normalement se trouver le chemin complet vers l'image correspondante. Pour les tests, vous devrez créer un dossier, le remplir de quelques images et mettre directement les chemins dans certains tuples de la base de données qui, pour le moment, ne contient aucune image.<br>
|
||||
Lorsque l'application sera opérationnelle, c'est le personnel de la médiathèque qui sera en charge de saisir les informations des documents.
|
||||
## L'API REST
|
||||
L'accès à la BDD se fait à travers une API REST protégée par une authentification basique.<br>
|
||||
Le code de l'API se trouve ici :<br>
|
||||
https://github.com/CNED-SLAM/rest_mediatekdocuments<br>
|
||||
avec toutes les explications pour l'utiliser (dans le readme).
|
||||
## Installation de l'application
|
||||
Ce mode opératoire permet d'installer l'application pour pouvoir travailler dessus.<br>
|
||||
- Installer Visual Studio 2019 entreprise et les extension Specflow et newtonsoft.json (pour ce dernier, voir l'article "Accéder à une API REST à partir d'une application C#" dans le wiki de ce dépôt : consulter juste le début pour la configuration, car la suite permet de comprendre le code existant).<br>
|
||||
- Télécharger le code et le dézipper puis renommer le dossier en "mediatekdocuments".<br>
|
||||
- Récupérer et installer l'API REST nécessaire (https://github.com/CNED-SLAM/rest_mediatekdocuments) ainsi que la base de données (les explications sont données dans le readme correspondant).
|
||||
Loading…
Reference in a new issue