Add project files.
This commit is contained in:
parent
61a1de9246
commit
58f5e326e0
25
.dockerignore
Normal file
25
.dockerignore
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
**/.classpath
|
||||||
|
**/.dockerignore
|
||||||
|
**/.env
|
||||||
|
**/.git
|
||||||
|
**/.gitignore
|
||||||
|
**/.project
|
||||||
|
**/.settings
|
||||||
|
**/.toolstarget
|
||||||
|
**/.vs
|
||||||
|
**/.vscode
|
||||||
|
**/*.*proj.user
|
||||||
|
**/*.dbmdl
|
||||||
|
**/*.jfm
|
||||||
|
**/azds.yaml
|
||||||
|
**/bin
|
||||||
|
**/charts
|
||||||
|
**/docker-compose*
|
||||||
|
**/Dockerfile*
|
||||||
|
**/node_modules
|
||||||
|
**/npm-debug.log
|
||||||
|
**/obj
|
||||||
|
**/secrets.dev.yaml
|
||||||
|
**/values.dev.yaml
|
||||||
|
LICENSE
|
||||||
|
README.md
|
||||||
34
FabitArchiwum.App/App.config
Normal file
34
FabitArchiwum.App/App.config
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
|
||||||
|
</startup>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0"/>
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2"/>
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1"/>
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.5.1" newVersion="4.0.5.1"/>
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
</configuration>
|
||||||
370
FabitArchiwum.App/AppForm.Designer.cs
generated
Normal file
370
FabitArchiwum.App/AppForm.Designer.cs
generated
Normal file
@ -0,0 +1,370 @@
|
|||||||
|
namespace FabitArchiwum.App
|
||||||
|
{
|
||||||
|
partial class AppForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AppForm));
|
||||||
|
this.treeView1 = new ComponentFactory.Krypton.Toolkit.KryptonTreeView();
|
||||||
|
this.listBox1 = new ComponentFactory.Krypton.Toolkit.KryptonListBox();
|
||||||
|
this.kryptonPanel1 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||||
|
this.kryptonPanel3 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||||
|
this.kryptonButton10 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||||
|
this.kryptonButton9 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||||
|
this.kryptonButton5 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||||
|
this.kryptonButton4 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||||
|
this.kryptonPanel2 = new ComponentFactory.Krypton.Toolkit.KryptonPanel();
|
||||||
|
this.kryptonButton11 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||||
|
this.kryptonButton3 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||||
|
this.kryptonButton2 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||||
|
this.kryptonButton1 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||||
|
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||||
|
this.oToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.ustawieniaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.wybórSkaneraToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.plikToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.pdfViewer1 = new PdfiumViewer.PdfViewer();
|
||||||
|
this.kryptonButton6 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||||
|
this.kryptonLabel1 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||||
|
this.kryptonButton7 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||||
|
this.kryptonButton8 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit();
|
||||||
|
this.kryptonPanel1.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel3)).BeginInit();
|
||||||
|
this.kryptonPanel3.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit();
|
||||||
|
this.kryptonPanel2.SuspendLayout();
|
||||||
|
this.menuStrip1.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// treeView1
|
||||||
|
//
|
||||||
|
this.treeView1.AllowDrop = true;
|
||||||
|
this.treeView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.treeView1.HideSelection = false;
|
||||||
|
this.treeView1.HotTracking = true;
|
||||||
|
this.treeView1.ItemStyle = ComponentFactory.Krypton.Toolkit.ButtonStyle.Gallery;
|
||||||
|
this.treeView1.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.treeView1.Name = "treeView1";
|
||||||
|
this.treeView1.Size = new System.Drawing.Size(435, 132);
|
||||||
|
this.treeView1.TabIndex = 1;
|
||||||
|
this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
|
||||||
|
this.treeView1.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.treeView1_ItemDrag);
|
||||||
|
this.treeView1.DragDrop += new System.Windows.Forms.DragEventHandler(this.treeView1_DragDrop);
|
||||||
|
this.treeView1.DragEnter += new System.Windows.Forms.DragEventHandler(this.treeView1_DragEnter);
|
||||||
|
//
|
||||||
|
// listBox1
|
||||||
|
//
|
||||||
|
this.listBox1.AllowDrop = true;
|
||||||
|
this.listBox1.Location = new System.Drawing.Point(3, 7);
|
||||||
|
this.listBox1.Name = "listBox1";
|
||||||
|
this.listBox1.Size = new System.Drawing.Size(429, 126);
|
||||||
|
this.listBox1.TabIndex = 2;
|
||||||
|
this.listBox1.SelectedValueChanged += new System.EventHandler(this.listBox1_SelectedValueChanged);
|
||||||
|
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
|
||||||
|
this.listBox1.DragDrop += new System.Windows.Forms.DragEventHandler(this.listBox1_DragDrop);
|
||||||
|
this.listBox1.DragEnter += new System.Windows.Forms.DragEventHandler(this.listBox1_DragEnter);
|
||||||
|
//
|
||||||
|
// kryptonPanel1
|
||||||
|
//
|
||||||
|
this.kryptonPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.kryptonPanel1.Controls.Add(this.kryptonPanel3);
|
||||||
|
this.kryptonPanel1.Controls.Add(this.kryptonPanel2);
|
||||||
|
this.kryptonPanel1.Location = new System.Drawing.Point(12, 45);
|
||||||
|
this.kryptonPanel1.Name = "kryptonPanel1";
|
||||||
|
this.kryptonPanel1.Size = new System.Drawing.Size(447, 531);
|
||||||
|
this.kryptonPanel1.TabIndex = 4;
|
||||||
|
this.kryptonPanel1.Resize += new System.EventHandler(this.kryptonPanel1_Resize);
|
||||||
|
//
|
||||||
|
// kryptonPanel3
|
||||||
|
//
|
||||||
|
this.kryptonPanel3.Controls.Add(this.kryptonButton10);
|
||||||
|
this.kryptonPanel3.Controls.Add(this.kryptonButton9);
|
||||||
|
this.kryptonPanel3.Controls.Add(this.kryptonButton5);
|
||||||
|
this.kryptonPanel3.Controls.Add(this.kryptonButton4);
|
||||||
|
this.kryptonPanel3.Controls.Add(this.listBox1);
|
||||||
|
this.kryptonPanel3.Location = new System.Drawing.Point(6, 218);
|
||||||
|
this.kryptonPanel3.Name = "kryptonPanel3";
|
||||||
|
this.kryptonPanel3.Size = new System.Drawing.Size(435, 229);
|
||||||
|
this.kryptonPanel3.TabIndex = 6;
|
||||||
|
//
|
||||||
|
// kryptonButton10
|
||||||
|
//
|
||||||
|
this.kryptonButton10.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||||
|
this.kryptonButton10.Enabled = false;
|
||||||
|
this.kryptonButton10.Location = new System.Drawing.Point(3, 194);
|
||||||
|
this.kryptonButton10.Name = "kryptonButton10";
|
||||||
|
this.kryptonButton10.Size = new System.Drawing.Size(90, 32);
|
||||||
|
this.kryptonButton10.TabIndex = 6;
|
||||||
|
this.kryptonButton10.Values.Text = "Dodaj";
|
||||||
|
this.kryptonButton10.Click += new System.EventHandler(this.kryptonButton10_Click);
|
||||||
|
//
|
||||||
|
// kryptonButton9
|
||||||
|
//
|
||||||
|
this.kryptonButton9.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||||
|
this.kryptonButton9.Enabled = false;
|
||||||
|
this.kryptonButton9.Location = new System.Drawing.Point(99, 194);
|
||||||
|
this.kryptonButton9.Name = "kryptonButton9";
|
||||||
|
this.kryptonButton9.Size = new System.Drawing.Size(90, 32);
|
||||||
|
this.kryptonButton9.TabIndex = 5;
|
||||||
|
this.kryptonButton9.Values.Text = "Pobierz";
|
||||||
|
this.kryptonButton9.Click += new System.EventHandler(this.kryptonButton9_Click);
|
||||||
|
//
|
||||||
|
// kryptonButton5
|
||||||
|
//
|
||||||
|
this.kryptonButton5.Enabled = false;
|
||||||
|
this.kryptonButton5.Location = new System.Drawing.Point(195, 194);
|
||||||
|
this.kryptonButton5.Name = "kryptonButton5";
|
||||||
|
this.kryptonButton5.Size = new System.Drawing.Size(90, 32);
|
||||||
|
this.kryptonButton5.TabIndex = 4;
|
||||||
|
this.kryptonButton5.Values.Text = "Zmień";
|
||||||
|
this.kryptonButton5.Click += new System.EventHandler(this.kryptonButton5_Click);
|
||||||
|
//
|
||||||
|
// kryptonButton4
|
||||||
|
//
|
||||||
|
this.kryptonButton4.Enabled = false;
|
||||||
|
this.kryptonButton4.Location = new System.Drawing.Point(291, 194);
|
||||||
|
this.kryptonButton4.Name = "kryptonButton4";
|
||||||
|
this.kryptonButton4.Size = new System.Drawing.Size(90, 32);
|
||||||
|
this.kryptonButton4.TabIndex = 3;
|
||||||
|
this.kryptonButton4.Values.Text = "Usuń";
|
||||||
|
this.kryptonButton4.Click += new System.EventHandler(this.kryptonButton4_Click);
|
||||||
|
//
|
||||||
|
// kryptonPanel2
|
||||||
|
//
|
||||||
|
this.kryptonPanel2.Controls.Add(this.kryptonButton11);
|
||||||
|
this.kryptonPanel2.Controls.Add(this.kryptonButton3);
|
||||||
|
this.kryptonPanel2.Controls.Add(this.kryptonButton2);
|
||||||
|
this.kryptonPanel2.Controls.Add(this.kryptonButton1);
|
||||||
|
this.kryptonPanel2.Controls.Add(this.treeView1);
|
||||||
|
this.kryptonPanel2.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.kryptonPanel2.Name = "kryptonPanel2";
|
||||||
|
this.kryptonPanel2.Size = new System.Drawing.Size(441, 209);
|
||||||
|
this.kryptonPanel2.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// kryptonButton11
|
||||||
|
//
|
||||||
|
this.kryptonButton11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.kryptonButton11.Location = new System.Drawing.Point(291, 174);
|
||||||
|
this.kryptonButton11.Name = "kryptonButton11";
|
||||||
|
this.kryptonButton11.Size = new System.Drawing.Size(90, 32);
|
||||||
|
this.kryptonButton11.TabIndex = 5;
|
||||||
|
this.kryptonButton11.Values.Text = "Odśwież";
|
||||||
|
this.kryptonButton11.Click += new System.EventHandler(this.kryptonButton11_Click);
|
||||||
|
//
|
||||||
|
// kryptonButton3
|
||||||
|
//
|
||||||
|
this.kryptonButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.kryptonButton3.Enabled = false;
|
||||||
|
this.kryptonButton3.Location = new System.Drawing.Point(195, 174);
|
||||||
|
this.kryptonButton3.Name = "kryptonButton3";
|
||||||
|
this.kryptonButton3.Size = new System.Drawing.Size(90, 32);
|
||||||
|
this.kryptonButton3.TabIndex = 4;
|
||||||
|
this.kryptonButton3.Values.Text = "Zmień";
|
||||||
|
this.kryptonButton3.Click += new System.EventHandler(this.kryptonButton3_Click);
|
||||||
|
//
|
||||||
|
// kryptonButton2
|
||||||
|
//
|
||||||
|
this.kryptonButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.kryptonButton2.Enabled = false;
|
||||||
|
this.kryptonButton2.Location = new System.Drawing.Point(99, 174);
|
||||||
|
this.kryptonButton2.Name = "kryptonButton2";
|
||||||
|
this.kryptonButton2.Size = new System.Drawing.Size(90, 32);
|
||||||
|
this.kryptonButton2.TabIndex = 3;
|
||||||
|
this.kryptonButton2.Values.Text = "Usuń";
|
||||||
|
this.kryptonButton2.Click += new System.EventHandler(this.kryptonButton2_Click);
|
||||||
|
//
|
||||||
|
// kryptonButton1
|
||||||
|
//
|
||||||
|
this.kryptonButton1.Anchor = System.Windows.Forms.AnchorStyles.Left;
|
||||||
|
this.kryptonButton1.Enabled = false;
|
||||||
|
this.kryptonButton1.Location = new System.Drawing.Point(3, 174);
|
||||||
|
this.kryptonButton1.Name = "kryptonButton1";
|
||||||
|
this.kryptonButton1.Size = new System.Drawing.Size(90, 32);
|
||||||
|
this.kryptonButton1.TabIndex = 2;
|
||||||
|
this.kryptonButton1.Values.Text = "Dodaj";
|
||||||
|
this.kryptonButton1.Click += new System.EventHandler(this.kryptonButton1_Click);
|
||||||
|
//
|
||||||
|
// menuStrip1
|
||||||
|
//
|
||||||
|
this.menuStrip1.Font = new System.Drawing.Font("Segoe UI", 9F);
|
||||||
|
this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||||
|
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.oToolStripMenuItem,
|
||||||
|
this.ustawieniaToolStripMenuItem,
|
||||||
|
this.plikToolStripMenuItem});
|
||||||
|
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.menuStrip1.Name = "menuStrip1";
|
||||||
|
this.menuStrip1.Size = new System.Drawing.Size(926, 30);
|
||||||
|
this.menuStrip1.TabIndex = 5;
|
||||||
|
this.menuStrip1.Text = "menuStrip1";
|
||||||
|
//
|
||||||
|
// oToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.oToolStripMenuItem.Name = "oToolStripMenuItem";
|
||||||
|
this.oToolStripMenuItem.Size = new System.Drawing.Size(108, 26);
|
||||||
|
this.oToolStripMenuItem.Text = "O programie";
|
||||||
|
this.oToolStripMenuItem.Click += new System.EventHandler(this.oToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// ustawieniaToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.ustawieniaToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.wybórSkaneraToolStripMenuItem});
|
||||||
|
this.ustawieniaToolStripMenuItem.Name = "ustawieniaToolStripMenuItem";
|
||||||
|
this.ustawieniaToolStripMenuItem.Size = new System.Drawing.Size(95, 26);
|
||||||
|
this.ustawieniaToolStripMenuItem.Text = "Ustawienia";
|
||||||
|
//
|
||||||
|
// wybórSkaneraToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.wybórSkaneraToolStripMenuItem.Name = "wybórSkaneraToolStripMenuItem";
|
||||||
|
this.wybórSkaneraToolStripMenuItem.Size = new System.Drawing.Size(190, 26);
|
||||||
|
this.wybórSkaneraToolStripMenuItem.Text = "Wybór skanera";
|
||||||
|
this.wybórSkaneraToolStripMenuItem.Click += new System.EventHandler(this.wybórSkaneraToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// plikToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.plikToolStripMenuItem.Name = "plikToolStripMenuItem";
|
||||||
|
this.plikToolStripMenuItem.Size = new System.Drawing.Size(73, 26);
|
||||||
|
this.plikToolStripMenuItem.Text = "Wyjście";
|
||||||
|
this.plikToolStripMenuItem.Click += new System.EventHandler(this.plikToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// pdfViewer1
|
||||||
|
//
|
||||||
|
this.pdfViewer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.pdfViewer1.AutoSize = true;
|
||||||
|
this.pdfViewer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.pdfViewer1.DefaultDocumentName = "";
|
||||||
|
this.pdfViewer1.Location = new System.Drawing.Point(460, 90);
|
||||||
|
this.pdfViewer1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
|
||||||
|
this.pdfViewer1.Name = "pdfViewer1";
|
||||||
|
this.pdfViewer1.Size = new System.Drawing.Size(453, 485);
|
||||||
|
this.pdfViewer1.TabIndex = 6;
|
||||||
|
this.pdfViewer1.Load += new System.EventHandler(this.pdfViewer1_Load);
|
||||||
|
//
|
||||||
|
// kryptonButton6
|
||||||
|
//
|
||||||
|
this.kryptonButton6.Enabled = false;
|
||||||
|
this.kryptonButton6.Location = new System.Drawing.Point(465, 45);
|
||||||
|
this.kryptonButton6.Name = "kryptonButton6";
|
||||||
|
this.kryptonButton6.Size = new System.Drawing.Size(132, 38);
|
||||||
|
this.kryptonButton6.TabIndex = 9;
|
||||||
|
this.kryptonButton6.Values.Text = "SKANUJ do PDF";
|
||||||
|
this.kryptonButton6.Click += new System.EventHandler(this.kryptonButton6_Click);
|
||||||
|
//
|
||||||
|
// kryptonLabel1
|
||||||
|
//
|
||||||
|
this.kryptonLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.kryptonLabel1.Location = new System.Drawing.Point(907, 59);
|
||||||
|
this.kryptonLabel1.Name = "kryptonLabel1";
|
||||||
|
this.kryptonLabel1.Size = new System.Drawing.Size(6, 2);
|
||||||
|
this.kryptonLabel1.TabIndex = 10;
|
||||||
|
this.kryptonLabel1.Values.Text = "";
|
||||||
|
//
|
||||||
|
// kryptonButton7
|
||||||
|
//
|
||||||
|
this.kryptonButton7.Enabled = false;
|
||||||
|
this.kryptonButton7.Location = new System.Drawing.Point(603, 45);
|
||||||
|
this.kryptonButton7.Name = "kryptonButton7";
|
||||||
|
this.kryptonButton7.Size = new System.Drawing.Size(109, 38);
|
||||||
|
this.kryptonButton7.TabIndex = 11;
|
||||||
|
this.kryptonButton7.Values.Text = "Wczytaj PDF";
|
||||||
|
this.kryptonButton7.Click += new System.EventHandler(this.kryptonButton7_Click_1);
|
||||||
|
//
|
||||||
|
// kryptonButton8
|
||||||
|
//
|
||||||
|
this.kryptonButton8.Enabled = false;
|
||||||
|
this.kryptonButton8.Location = new System.Drawing.Point(718, 45);
|
||||||
|
this.kryptonButton8.Name = "kryptonButton8";
|
||||||
|
this.kryptonButton8.Size = new System.Drawing.Size(168, 38);
|
||||||
|
this.kryptonButton8.TabIndex = 12;
|
||||||
|
this.kryptonButton8.Values.Text = "Wczytaj JPG do PDF";
|
||||||
|
this.kryptonButton8.Click += new System.EventHandler(this.kryptonButton8_Click);
|
||||||
|
//
|
||||||
|
// AppForm
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(926, 588);
|
||||||
|
this.Controls.Add(this.kryptonButton8);
|
||||||
|
this.Controls.Add(this.kryptonButton7);
|
||||||
|
this.Controls.Add(this.kryptonLabel1);
|
||||||
|
this.Controls.Add(this.kryptonButton6);
|
||||||
|
this.Controls.Add(this.kryptonPanel1);
|
||||||
|
this.Controls.Add(this.menuStrip1);
|
||||||
|
this.Controls.Add(this.pdfViewer1);
|
||||||
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
|
this.MainMenuStrip = this.menuStrip1;
|
||||||
|
this.Name = "AppForm";
|
||||||
|
this.Text = "Archiwum";
|
||||||
|
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||||
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.AppForm_FormClosing);
|
||||||
|
this.Shown += new System.EventHandler(this.AppForm_Shown);
|
||||||
|
this.SizeChanged += new System.EventHandler(this.AppForm_SizeChanged);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit();
|
||||||
|
this.kryptonPanel1.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel3)).EndInit();
|
||||||
|
this.kryptonPanel3.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).EndInit();
|
||||||
|
this.kryptonPanel2.ResumeLayout(false);
|
||||||
|
this.menuStrip1.ResumeLayout(false);
|
||||||
|
this.menuStrip1.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonTreeView treeView1;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonListBox listBox1;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel1;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel3;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonPanel kryptonPanel2;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton3;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton2;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton1;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton5;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton4;
|
||||||
|
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem plikToolStripMenuItem;
|
||||||
|
private PdfiumViewer.PdfViewer pdfViewer1;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton6;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem oToolStripMenuItem;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel1;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem ustawieniaToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem wybórSkaneraToolStripMenuItem;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton7;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton8;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton9;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton10;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton11;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
906
FabitArchiwum.App/AppForm.cs
Normal file
906
FabitArchiwum.App/AppForm.cs
Normal file
@ -0,0 +1,906 @@
|
|||||||
|
using ComponentFactory.Krypton.Toolkit;
|
||||||
|
using FabitArchiwum.App.Model;
|
||||||
|
using iTextSharp.text;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using PdfiumViewer;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using WIA;
|
||||||
|
using static System.Net.Mime.MediaTypeNames;
|
||||||
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.App
|
||||||
|
{
|
||||||
|
public partial class AppForm : ComponentFactory.Krypton.Toolkit.KryptonForm
|
||||||
|
{
|
||||||
|
LoginForm loginForm;
|
||||||
|
List<TreeModel> tree = new List<TreeModel>();
|
||||||
|
KryptonTreeView _fieldsTreeCache = new KryptonTreeView();
|
||||||
|
DeviceManager deviceManager = new DeviceManagerClass();
|
||||||
|
DeviceInfo selectedScanner = null;
|
||||||
|
Device device;
|
||||||
|
WIA.CommonDialog dialog;
|
||||||
|
|
||||||
|
public AppForm()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
//for (int i = 1; i <= deviceManager.DeviceInfos.Count; i++)
|
||||||
|
//{
|
||||||
|
// if (deviceManager.DeviceInfos[i].Type != WiaDeviceType.ScannerDeviceType)
|
||||||
|
// {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// kryptonComboBox1.Items.Add(deviceManager.DeviceInfos[i].Properties["Name"].get_Value().ToString());
|
||||||
|
//}
|
||||||
|
//if (kryptonComboBox1.Items.Count > 0)
|
||||||
|
//{
|
||||||
|
// kryptonComboBox1.SelectedIndex = 0;
|
||||||
|
// selectedScanner = deviceManager.DeviceInfos[kryptonComboBox1.SelectedIndex + 1];
|
||||||
|
//}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dialog = new WIA.CommonDialogClass();
|
||||||
|
device = dialog.ShowSelectDevice(AlwaysSelectDevice: true);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Brak skanera lub sterowników WIA", "Błąd");
|
||||||
|
}
|
||||||
|
bindTreeView();
|
||||||
|
treeView1.Nodes[0].Expand();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bindTreeView()
|
||||||
|
{
|
||||||
|
tree = JsonConvert.DeserializeObject<List<TreeModel>>(AppHelper.GetInstance().getTree());
|
||||||
|
treeView1.Nodes.Clear();
|
||||||
|
_fieldsTreeCache.Nodes.Clear();
|
||||||
|
TreeNodeCollection tnc = treeView1.Nodes;
|
||||||
|
bindTreeViewReq(0, tnc);
|
||||||
|
TreeNodeCollection tncCache = _fieldsTreeCache.Nodes;
|
||||||
|
bindTreeViewReq(0, tncCache);
|
||||||
|
//treeView1.ExpandAll();
|
||||||
|
kryptonButton1.Enabled = false;
|
||||||
|
kryptonButton2.Enabled = false;
|
||||||
|
kryptonButton3.Enabled = false;
|
||||||
|
kryptonButton4.Enabled = false;
|
||||||
|
kryptonButton5.Enabled = false;
|
||||||
|
kryptonButton9.Enabled = false;
|
||||||
|
kryptonButton10.Enabled = false;
|
||||||
|
kryptonButton6.Enabled = false;
|
||||||
|
kryptonButton7.Enabled = false;
|
||||||
|
kryptonButton8.Enabled = false;
|
||||||
|
listBox1.ClearSelected();
|
||||||
|
kryptonLabel1.Text = "";
|
||||||
|
pdfViewer1.Document?.Dispose();
|
||||||
|
var pdf = PdfDocument.Load(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\None.pdf");
|
||||||
|
pdfViewer1.Document = pdf;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void bindTreeViewReq(int parentKey, TreeNodeCollection n)
|
||||||
|
{
|
||||||
|
var st = tree.Where(a => a.ParentId == parentKey).ToList();
|
||||||
|
foreach (var item in st)
|
||||||
|
{
|
||||||
|
n.Add(item.Id.ToString(), item.Text);
|
||||||
|
var subtree = tree.Where(a => a.ParentId == item.Id).ToList();
|
||||||
|
if (subtree.Count() > 0) bindTreeViewReq((int)item.Id, n[n.Count - 1].Nodes);
|
||||||
|
}
|
||||||
|
treeView1.Scrollable = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void AppForm_Shown(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// this.Visible = false;
|
||||||
|
// loginForm = new LoginForm();
|
||||||
|
// loginForm.ShowDialog();
|
||||||
|
if (AppHelper.GetInstance().isLogged())
|
||||||
|
{
|
||||||
|
//bindTreeView();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] ImageToByteArray(System.Drawing.Image imageIn)
|
||||||
|
{
|
||||||
|
using (var ms = new MemoryStream())
|
||||||
|
{
|
||||||
|
imageIn.Save(ms, imageIn.RawFormat);
|
||||||
|
return ms.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
|
||||||
|
{
|
||||||
|
listBox1.Items.Clear();
|
||||||
|
int treeId = int.Parse(treeView1.SelectedNode.Name);
|
||||||
|
var doc = JsonConvert.DeserializeObject<List<DocumentModel>>(AppHelper.GetInstance().getDocumentsByTreeId(treeId));
|
||||||
|
var ds = doc.Where(d => d.TreeId == treeId).ToList();
|
||||||
|
foreach (var d in ds)
|
||||||
|
{
|
||||||
|
listBox1.Items.Add(d);
|
||||||
|
}
|
||||||
|
kryptonButton1.Enabled = true;
|
||||||
|
kryptonButton2.Enabled = true;
|
||||||
|
kryptonButton3.Enabled = true;
|
||||||
|
kryptonButton6.Enabled = true;
|
||||||
|
kryptonButton7.Enabled = true;
|
||||||
|
kryptonButton8.Enabled = true;
|
||||||
|
kryptonButton4.Enabled = false;
|
||||||
|
kryptonButton5.Enabled = false;
|
||||||
|
kryptonButton9.Enabled = false;
|
||||||
|
kryptonButton10.Enabled = true;
|
||||||
|
listBox1.ClearSelected();
|
||||||
|
kryptonLabel1.Text = "";
|
||||||
|
pdfViewer1.Document?.Dispose();
|
||||||
|
var pdf = PdfDocument.Load(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\None.pdf");
|
||||||
|
pdfViewer1.Document = pdf;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonPanel1_Resize(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonButton2_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show("Usunąć?", "Potwierdzenie", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
TreeNode tn = treeView1.SelectedNode;
|
||||||
|
AppHelper.GetInstance().deleteTree(int.Parse(tn.Name));
|
||||||
|
bindTreeView();
|
||||||
|
}
|
||||||
|
catch (UnauthorizedAccessException)
|
||||||
|
{
|
||||||
|
KryptonMessageBox.Show("Brak dostępu", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
KryptonMessageBox.Show("Błąd: " + ex.Message + ex.InnerException + ex.StackTrace, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void plikToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (listBox1.SelectedIndex != -1)
|
||||||
|
{
|
||||||
|
kryptonButton4.Enabled = true;
|
||||||
|
kryptonButton5.Enabled = true;
|
||||||
|
kryptonButton9.Enabled = true;
|
||||||
|
kryptonButton10.Enabled = true;
|
||||||
|
kryptonButton6.Enabled = true;
|
||||||
|
kryptonButton7.Enabled = true;
|
||||||
|
kryptonButton8.Enabled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
kryptonButton4.Enabled = false;
|
||||||
|
kryptonButton5.Enabled = false;
|
||||||
|
kryptonButton9.Enabled = false;
|
||||||
|
kryptonButton10.Enabled = true;
|
||||||
|
kryptonButton6.Enabled = false;
|
||||||
|
kryptonButton7.Enabled = false;
|
||||||
|
kryptonButton8.Enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void listBox1_SelectedValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (listBox1.SelectedIndex != -1)
|
||||||
|
{
|
||||||
|
kryptonButton4.Enabled = true;
|
||||||
|
kryptonButton5.Enabled = true;
|
||||||
|
kryptonButton9.Enabled = true;
|
||||||
|
kryptonButton10.Enabled = true;
|
||||||
|
DocumentModel d = AppHelper.GetInstance().getDocumentById(((DocumentModel)listBox1.SelectedItem).Id);
|
||||||
|
if (d != null && d.Image != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (MemoryStream ms = new MemoryStream(d.Image))
|
||||||
|
{
|
||||||
|
kryptonLabel1.Text = d.Name;
|
||||||
|
pdfViewer1.Document?.Dispose();
|
||||||
|
var pdf = PdfDocument.Load(ms);
|
||||||
|
pdf.Save(Path.GetTempPath()+"\\temp.pdf");
|
||||||
|
pdf = PdfDocument.Load(Path.GetTempPath() + "\\temp.pdf");
|
||||||
|
pdfViewer1.Document = pdf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
kryptonLabel1.Text = "";
|
||||||
|
pdfViewer1.Document?.Dispose();
|
||||||
|
var pdf = PdfDocument.Load(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\None.pdf");
|
||||||
|
pdfViewer1.Document = pdf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
kryptonButton4.Enabled = false;
|
||||||
|
kryptonButton5.Enabled = false;
|
||||||
|
kryptonButton9.Enabled = false;
|
||||||
|
kryptonButton10.Enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonButton1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var sn = treeView1.SelectedNode;
|
||||||
|
var nowyFolder = KryptonInputBox.Show("Wpisz nazwę nowego folderu:", "Nowy folder", "");
|
||||||
|
if (nowyFolder != "")
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
AppHelper.GetInstance().putTree(int.Parse(treeView1.SelectedNode.Name), nowyFolder);
|
||||||
|
bindTreeView();
|
||||||
|
treeView1.Focus();
|
||||||
|
KryptonMessageBox.Show("Zapisano", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
catch (UnauthorizedAccessException)
|
||||||
|
{
|
||||||
|
KryptonMessageBox.Show("Brak dostępu", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
KryptonMessageBox.Show("Błąd zapisu: " + ex.Message + ex.InnerException + ex.StackTrace, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
treeView1.SelectedNode = treeView1.Nodes.Find(sn.Name, true)[0];
|
||||||
|
treeView1.SelectedNode.Expand();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonButton3_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var nowaNazwa = KryptonInputBox.Show("Wpisz nową nazwę folderu:", "Zmiana nazwy", treeView1.SelectedNode.Text);
|
||||||
|
if (nowaNazwa != "")
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
TreeNode tn = treeView1.SelectedNode;
|
||||||
|
AppHelper.GetInstance().renameTree(int.Parse(tn.Name), nowaNazwa);
|
||||||
|
bindTreeView();
|
||||||
|
treeView1.SelectedNode = treeView1.Nodes.Find(tn.Name, true)[0];
|
||||||
|
treeView1.Focus();
|
||||||
|
KryptonMessageBox.Show("Zapisano", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
KryptonMessageBox.Show("Błąd zapisu: " + ex.Message + ex.InnerException + ex.StackTrace, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AppForm_SizeChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
kryptonPanel3.Height = (kryptonPanel1.Height / 2) - 6;
|
||||||
|
kryptonPanel2.Height = (kryptonPanel1.Height / 2) - 3;
|
||||||
|
kryptonPanel2.Top = 3;
|
||||||
|
kryptonPanel3.Top = (kryptonPanel1.Height / 2);
|
||||||
|
kryptonPanel3.Width = kryptonPanel1.Width - 6;
|
||||||
|
kryptonPanel2.Width = kryptonPanel1.Width - 6;
|
||||||
|
treeView1.Height = (kryptonPanel1.Height / 2) - 35;
|
||||||
|
listBox1.Height = (kryptonPanel1.Height / 2) - 38;
|
||||||
|
kryptonButton1.Top = (kryptonPanel1.Height / 2) - 32;
|
||||||
|
kryptonButton2.Top = (kryptonPanel1.Height / 2) - 32;
|
||||||
|
kryptonButton3.Top = (kryptonPanel1.Height / 2) - 32;
|
||||||
|
kryptonButton11.Top = (kryptonPanel1.Height / 2) - 32;
|
||||||
|
kryptonButton4.Top = (kryptonPanel1.Height / 2) - 32;
|
||||||
|
kryptonButton5.Top = (kryptonPanel1.Height / 2) - 32;
|
||||||
|
kryptonButton9.Top = (kryptonPanel1.Height / 2) - 32;
|
||||||
|
kryptonButton10.Top = (kryptonPanel1.Height / 2) - 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonButton5_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var nowaNazwa = KryptonInputBox.Show("Wpisz nową nazwę dokumentu:", "Zmiana nazwy", ((DocumentModel)listBox1.SelectedItem).Name);
|
||||||
|
var si = (DocumentModel)listBox1.SelectedItem;
|
||||||
|
if (nowaNazwa != "")
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
AppHelper.GetInstance().renameDocument(si.Id, nowaNazwa);
|
||||||
|
listBox1.Items.Clear();
|
||||||
|
int treeId = int.Parse(treeView1.SelectedNode.Name);
|
||||||
|
var doc = JsonConvert.DeserializeObject<List<DocumentModel>>(AppHelper.GetInstance().getDocumentsByTreeId(treeId));
|
||||||
|
var ds = doc.Where(d => d.TreeId == treeId).ToList();
|
||||||
|
foreach (var d in ds)
|
||||||
|
{
|
||||||
|
listBox1.Items.Add(d);
|
||||||
|
}
|
||||||
|
kryptonButton4.Enabled = false;
|
||||||
|
kryptonButton5.Enabled = false;
|
||||||
|
kryptonButton9.Enabled = false;
|
||||||
|
kryptonButton10.Enabled = true;
|
||||||
|
KryptonMessageBox.Show("Zapisano", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
KryptonMessageBox.Show("Błąd zapisu: " + ex.Message + ex.InnerException + ex.StackTrace, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonButton4_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show("Usunąć?", "Potwierdzenie", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var si = (DocumentModel)listBox1.SelectedItem;
|
||||||
|
AppHelper.GetInstance().deleteDocument(si.Id);
|
||||||
|
listBox1.Items.Clear();
|
||||||
|
int treeId = int.Parse(treeView1.SelectedNode.Name);
|
||||||
|
var doc = JsonConvert.DeserializeObject<List<DocumentModel>>(AppHelper.GetInstance().getDocumentsByTreeId(treeId));
|
||||||
|
var ds = doc.Where(d => d.TreeId == treeId).ToList();
|
||||||
|
foreach (var d in ds)
|
||||||
|
{
|
||||||
|
listBox1.Items.Add(d);
|
||||||
|
}
|
||||||
|
kryptonButton4.Enabled = false;
|
||||||
|
kryptonButton5.Enabled = false;
|
||||||
|
kryptonButton9.Enabled = false;
|
||||||
|
kryptonButton10.Enabled = true;
|
||||||
|
kryptonLabel1.Text = "";
|
||||||
|
pdfViewer1.Document?.Dispose();
|
||||||
|
var pdf = PdfDocument.Load(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\None.pdf");
|
||||||
|
pdfViewer1.Document = pdf;
|
||||||
|
}
|
||||||
|
catch (UnauthorizedAccessException)
|
||||||
|
{
|
||||||
|
KryptonMessageBox.Show("Brak dostępu", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
KryptonMessageBox.Show("Błąd: " + ex.Message + ex.InnerException + ex.StackTrace, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void oToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
OProgramieForm oProgramieForm = new OProgramieForm();
|
||||||
|
oProgramieForm.ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const string wiaFormatBMP = "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}";
|
||||||
|
const string wiaFormatJPEG = "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}";
|
||||||
|
class WIA_DPS_DOCUMENT_HANDLING_SELECT
|
||||||
|
{
|
||||||
|
public const uint FEEDER = 0x00000001;
|
||||||
|
public const uint FLATBED = 0x00000002;
|
||||||
|
}
|
||||||
|
class WIA_DPS_DOCUMENT_HANDLING_STATUS
|
||||||
|
{
|
||||||
|
public const uint FEED_READY = 0x00000001;
|
||||||
|
}
|
||||||
|
class WIA_PROPERTIES
|
||||||
|
{
|
||||||
|
public const uint WIA_RESERVED_FOR_NEW_PROPS = 1024;
|
||||||
|
public const uint WIA_DIP_FIRST = 2;
|
||||||
|
public const uint WIA_DPA_FIRST = WIA_DIP_FIRST + WIA_RESERVED_FOR_NEW_PROPS;
|
||||||
|
public const uint WIA_DPC_FIRST = WIA_DPA_FIRST + WIA_RESERVED_FOR_NEW_PROPS;
|
||||||
|
//
|
||||||
|
// Scanner only device properties (DPS)
|
||||||
|
//
|
||||||
|
public const uint WIA_DPS_FIRST = WIA_DPC_FIRST + WIA_RESERVED_FOR_NEW_PROPS;
|
||||||
|
public const uint WIA_DPS_DOCUMENT_HANDLING_STATUS = WIA_DPS_FIRST + 13;
|
||||||
|
public const uint WIA_DPS_DOCUMENT_HANDLING_SELECT = WIA_DPS_FIRST + 14;
|
||||||
|
}
|
||||||
|
public static List<System.Drawing.Image> Scan(string scannerId)
|
||||||
|
{
|
||||||
|
List<System.Drawing.Image> images = new List<System.Drawing.Image>();
|
||||||
|
|
||||||
|
// select the correct scanner using the provided scannerId parameter
|
||||||
|
WIA.DeviceManager manager = new WIA.DeviceManager();
|
||||||
|
WIA.Device device = null;
|
||||||
|
foreach (WIA.DeviceInfo info in manager.DeviceInfos)
|
||||||
|
{
|
||||||
|
if (info.DeviceID == scannerId)
|
||||||
|
{
|
||||||
|
// connect to scanner
|
||||||
|
device = info.Connect();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// device was not found
|
||||||
|
if (device == null)
|
||||||
|
{
|
||||||
|
// enumerate available devices
|
||||||
|
string availableDevices = "";
|
||||||
|
foreach (WIA.DeviceInfo info in manager.DeviceInfos)
|
||||||
|
{
|
||||||
|
availableDevices += info.DeviceID + "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
// show error with available devices
|
||||||
|
throw new Exception("The device with provided ID could not be found. Available Devices:\n" + availableDevices);
|
||||||
|
}
|
||||||
|
|
||||||
|
WIA.Item item = null;
|
||||||
|
WIA.CommonDialog dialog = new WIA.CommonDialog();
|
||||||
|
WIA.Items items = dialog.ShowSelectItems(device);
|
||||||
|
if (items == null)
|
||||||
|
return images;
|
||||||
|
|
||||||
|
item = items[1];
|
||||||
|
|
||||||
|
bool hasMorePages = true;
|
||||||
|
while (hasMorePages)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// scan image
|
||||||
|
WIA.ICommonDialog wiaCommonDialog = new WIA.CommonDialog();
|
||||||
|
WIA.ImageFile image = (WIA.ImageFile)wiaCommonDialog.ShowTransfer(item);
|
||||||
|
|
||||||
|
// save to temp file
|
||||||
|
string fileName = Path.GetTempFileName();
|
||||||
|
File.Delete(fileName);
|
||||||
|
image.SaveFile(fileName);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Marshal.FinalReleaseComObject(image);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
image = null;
|
||||||
|
}
|
||||||
|
// add file to output list
|
||||||
|
images.Add(System.Drawing.Image.FromFile(fileName));
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
//determine if there are any more pages waiting
|
||||||
|
WIA.Property documentHandlingSelect = null;
|
||||||
|
WIA.Property documentHandlingStatus = null;
|
||||||
|
foreach (WIA.Property prop in device.Properties)
|
||||||
|
{
|
||||||
|
if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT_HANDLING_SELECT)
|
||||||
|
documentHandlingSelect = prop;
|
||||||
|
if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT_HANDLING_STATUS)
|
||||||
|
documentHandlingStatus = prop;
|
||||||
|
}
|
||||||
|
// assume there are no more pages
|
||||||
|
hasMorePages = false;
|
||||||
|
// may not exist on flatbed scanner but required for feeder
|
||||||
|
if (documentHandlingSelect != null)
|
||||||
|
{
|
||||||
|
// check for document feeder
|
||||||
|
if ((Convert.ToUInt32(documentHandlingSelect.get_Value()) & WIA_DPS_DOCUMENT_HANDLING_SELECT.FEEDER) != 0)
|
||||||
|
{
|
||||||
|
hasMorePages = ((Convert.ToUInt32(documentHandlingStatus.get_Value()) & WIA_DPS_DOCUMENT_HANDLING_STATUS.FEED_READY) != 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return images;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setItem(IItem item, object property, object value)
|
||||||
|
{
|
||||||
|
WIA.Property aProperty = item.Properties.get_Item(ref property);
|
||||||
|
aProperty.set_Value(ref value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonButton6_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (device != null)
|
||||||
|
{
|
||||||
|
Document doc = new Document(PageSize.A4, 10f, 10f, 10f, 10f);
|
||||||
|
var output = new MemoryStream();
|
||||||
|
var writer = iTextSharp.text.pdf.PdfWriter.GetInstance(doc, output);
|
||||||
|
doc.Open();
|
||||||
|
bool firstTime = true;
|
||||||
|
int ilosc_stron = 0;
|
||||||
|
Items items;
|
||||||
|
|
||||||
|
items = dialog.ShowSelectItems(device, SingleSelect: false);
|
||||||
|
//items = device.Items;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
WIA.Item item;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
item = items[1] as WIA.Item;
|
||||||
|
//setItem(item, "6146", 1);
|
||||||
|
//setItem(item, "3097", 0);
|
||||||
|
//setItem(item, "6148", 200);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
bool hasMorePages = true;
|
||||||
|
while (hasMorePages)
|
||||||
|
{
|
||||||
|
if (!firstTime) doc.NewPage();
|
||||||
|
ImageFile imageFile = null;
|
||||||
|
// List<System.Drawing.Image> s = Scan(device.DeviceID);
|
||||||
|
object res = null;
|
||||||
|
if (items.Count >= 1)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//res = item.Transfer(wiaFormatJPEG);
|
||||||
|
res = dialog.ShowTransfer(item, wiaFormatJPEG);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//List<WIA.ImageFile> i = (List<WIA.ImageFile>)dialog.ShowTransfer(items[1]);
|
||||||
|
imageFile = (ImageFile)res;
|
||||||
|
}
|
||||||
|
if (imageFile != null)
|
||||||
|
{
|
||||||
|
iTextSharp.text.Rectangle pageSize = null;
|
||||||
|
pageSize = new iTextSharp.text.Rectangle(0, 0, imageFile.Width, imageFile.Height);
|
||||||
|
|
||||||
|
var imageBytes = (byte[])imageFile.FileData.get_BinaryData();
|
||||||
|
var ms = new MemoryStream(imageBytes);
|
||||||
|
var img = System.Drawing.Image.FromStream(ms);
|
||||||
|
|
||||||
|
var image = iTextSharp.text.Image.GetInstance(ImageToByteArray(img));
|
||||||
|
image.SetAbsolutePosition(0, 0);
|
||||||
|
image.ScaleAbsoluteHeight(doc.PageSize.Height);
|
||||||
|
image.ScaleAbsoluteWidth(doc.PageSize.Width);
|
||||||
|
doc.Add(image);
|
||||||
|
firstTime = false;
|
||||||
|
ilosc_stron++;
|
||||||
|
}
|
||||||
|
Marshal.FinalReleaseComObject(res);
|
||||||
|
WIA.Property documentHandlingSelect = null;
|
||||||
|
WIA.Property documentHandlingStatus = null;
|
||||||
|
foreach (WIA.Property prop in device.Properties)
|
||||||
|
{
|
||||||
|
if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT_HANDLING_SELECT)
|
||||||
|
documentHandlingSelect = prop;
|
||||||
|
if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT_HANDLING_STATUS)
|
||||||
|
documentHandlingStatus = prop;
|
||||||
|
}
|
||||||
|
// assume there are no more pages
|
||||||
|
hasMorePages = false;
|
||||||
|
// may not exist on flatbed scanner but required for feeder
|
||||||
|
if (documentHandlingSelect != null)
|
||||||
|
{
|
||||||
|
// check for document feeder
|
||||||
|
if ((Convert.ToUInt32(documentHandlingSelect.get_Value()) & WIA_DPS_DOCUMENT_HANDLING_SELECT.FEEDER) != 0)
|
||||||
|
{
|
||||||
|
hasMorePages = ((Convert.ToUInt32(documentHandlingStatus.get_Value()) & WIA_DPS_DOCUMENT_HANDLING_STATUS.FEED_READY) != 0);
|
||||||
|
object obj = new object();
|
||||||
|
obj = (WIA_DPS_DOCUMENT_HANDLING_SELECT.FEEDER);
|
||||||
|
documentHandlingSelect.set_Value(ref obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (items != null && MessageBox.Show("Następna strona", "Następna strona", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes);
|
||||||
|
//while (MessageBox.Show("Następna strona", "Następna strona", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes);
|
||||||
|
|
||||||
|
if (ilosc_stron > 0)
|
||||||
|
{
|
||||||
|
doc.Close();
|
||||||
|
var nazwaDokumentu = KryptonInputBox.Show("Wpisz nazwę dokumentu:", "Nowy dokument", "");
|
||||||
|
if (nazwaDokumentu != "")
|
||||||
|
{
|
||||||
|
DocumentModel docModel = new DocumentModel();
|
||||||
|
docModel.TreeId = int.Parse(treeView1.SelectedNode.Name);
|
||||||
|
docModel.Name = nazwaDokumentu + ".pdf";
|
||||||
|
docModel.Image = output.ToArray();
|
||||||
|
output.Close();
|
||||||
|
DocumentModel d = AppHelper.GetInstance().putDocument(docModel);
|
||||||
|
TreeNode tn = treeView1.SelectedNode;
|
||||||
|
bindTreeView();
|
||||||
|
treeView1.SelectedNode = treeView1.Nodes.Find(tn.Name, true)[0];
|
||||||
|
treeView1.Focus();
|
||||||
|
|
||||||
|
using (MemoryStream ms = new MemoryStream(d.Image))
|
||||||
|
{
|
||||||
|
pdfViewer1.Document?.Dispose();
|
||||||
|
var pdf = PdfDocument.Load(ms);
|
||||||
|
pdfViewer1.Document = pdf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Błędna nazwa dokumentu. Dokument nie zapisany!", "Błąd");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Brak wyboru skanera!", "Błąd");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonButton7_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private void wybórSkaneraToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dialog = new WIA.CommonDialog();
|
||||||
|
device = dialog.ShowSelectDevice(AlwaysSelectDevice: true);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Brak skanera lub sterowników WIA", "Błąd");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonButton7_Click_1(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||||
|
openFileDialog.Filter = "PDF Files|*.PDF";
|
||||||
|
openFileDialog.Multiselect = false;
|
||||||
|
DialogResult res = openFileDialog.ShowDialog();
|
||||||
|
|
||||||
|
DocumentModel docModel = new DocumentModel();
|
||||||
|
docModel.TreeId = int.Parse(treeView1.SelectedNode.Name);
|
||||||
|
docModel.Name = openFileDialog.SafeFileName;
|
||||||
|
pdfViewer1.Document?.Dispose();
|
||||||
|
PdfDocument pdf = PdfDocument.Load(openFileDialog.FileName);
|
||||||
|
pdfViewer1.Document = pdf;
|
||||||
|
MemoryStream m = new MemoryStream();
|
||||||
|
pdfViewer1.Document.Save(m);
|
||||||
|
docModel.Image = m.ToArray();
|
||||||
|
DocumentModel d = AppHelper.GetInstance().putDocument(docModel);
|
||||||
|
TreeNode tn = treeView1.SelectedNode;
|
||||||
|
bindTreeView();
|
||||||
|
treeView1.SelectedNode = treeView1.Nodes.Find(tn.Name, true)[0];
|
||||||
|
treeView1.Focus();
|
||||||
|
|
||||||
|
using (MemoryStream ms = new MemoryStream(d.Image))
|
||||||
|
{
|
||||||
|
pdfViewer1.Document?.Dispose();
|
||||||
|
var p = PdfDocument.Load(ms);
|
||||||
|
pdf.Save(Path.GetTempPath() + "\\temp.pdf");
|
||||||
|
pdf = PdfDocument.Load(Path.GetTempPath() + "\\temp.pdf");
|
||||||
|
pdfViewer1.Document = pdf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pdfViewer1_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void listBox1_DragDrop(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||||
|
foreach (var file in files)
|
||||||
|
{
|
||||||
|
DocumentModel docModel = new DocumentModel();
|
||||||
|
docModel.TreeId = int.Parse(treeView1.SelectedNode.Name);
|
||||||
|
docModel.Name = Path.GetFileName(file);
|
||||||
|
docModel.Image = File.ReadAllBytes(file);
|
||||||
|
DocumentModel d = AppHelper.GetInstance().putDocument(docModel);
|
||||||
|
}
|
||||||
|
listBox1.Items.Clear();
|
||||||
|
int treeId = int.Parse(treeView1.SelectedNode.Name);
|
||||||
|
var doc = JsonConvert.DeserializeObject<List<DocumentModel>>(AppHelper.GetInstance().getDocumentsByTreeId(treeId));
|
||||||
|
var ds = doc.Where(d => d.TreeId == treeId).ToList();
|
||||||
|
foreach (var d in ds)
|
||||||
|
{
|
||||||
|
listBox1.Items.Add(d);
|
||||||
|
}
|
||||||
|
kryptonButton1.Enabled = true;
|
||||||
|
kryptonButton2.Enabled = true;
|
||||||
|
kryptonButton3.Enabled = true;
|
||||||
|
kryptonButton6.Enabled = true;
|
||||||
|
kryptonButton7.Enabled = true;
|
||||||
|
kryptonButton8.Enabled = true;
|
||||||
|
kryptonButton4.Enabled = false;
|
||||||
|
kryptonButton5.Enabled = false;
|
||||||
|
kryptonButton9.Enabled = false;
|
||||||
|
kryptonButton10.Enabled = true;
|
||||||
|
listBox1.ClearSelected();
|
||||||
|
kryptonLabel1.Text = "";
|
||||||
|
pdfViewer1.Document?.Dispose();
|
||||||
|
var pdf = PdfDocument.Load(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\None.pdf");
|
||||||
|
pdfViewer1.Document = pdf;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void listBox1_DragEnter(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Data.GetDataPresent(DataFormats.FileDrop) && treeView1.SelectedNode != null)
|
||||||
|
{
|
||||||
|
e.Effect = DragDropEffects.Copy;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e.Effect = DragDropEffects.None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonButton8_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Document doc = new Document(PageSize.A4, 10f, 10f, 10f, 10f);
|
||||||
|
var output = new MemoryStream();
|
||||||
|
var writer = iTextSharp.text.pdf.PdfWriter.GetInstance(doc, output);
|
||||||
|
doc.Open();
|
||||||
|
bool firstTime = true;
|
||||||
|
int ilosc_stron = 0;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||||
|
openFileDialog.Filter = "Image Files|*.JPG";
|
||||||
|
DialogResult res = openFileDialog.ShowDialog();
|
||||||
|
if (res == DialogResult.OK)
|
||||||
|
{
|
||||||
|
if (!firstTime) doc.NewPage();
|
||||||
|
var img = System.Drawing.Image.FromFile(openFileDialog.FileName);
|
||||||
|
if (img != null)
|
||||||
|
{
|
||||||
|
iTextSharp.text.Rectangle pageSize = null;
|
||||||
|
pageSize = new iTextSharp.text.Rectangle(0, 0, img.Width, img.Height);
|
||||||
|
|
||||||
|
var image = iTextSharp.text.Image.GetInstance(ImageToByteArray(img));
|
||||||
|
image.SetAbsolutePosition(0, 0);
|
||||||
|
image.ScaleAbsoluteHeight(doc.PageSize.Height);
|
||||||
|
image.ScaleAbsoluteWidth(doc.PageSize.Width);
|
||||||
|
doc.Add(image);
|
||||||
|
firstTime = false;
|
||||||
|
ilosc_stron++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (MessageBox.Show("Następna strona", "Następna strona", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes);
|
||||||
|
|
||||||
|
if (ilosc_stron > 0)
|
||||||
|
{
|
||||||
|
doc.Close();
|
||||||
|
var nazwaDokumentu = KryptonInputBox.Show("Wpisz nazwę dokumentu:", "Nowy dokument", "");
|
||||||
|
if (nazwaDokumentu != "")
|
||||||
|
{
|
||||||
|
DocumentModel docModel = new DocumentModel();
|
||||||
|
docModel.TreeId = int.Parse(treeView1.SelectedNode.Name);
|
||||||
|
docModel.Name = nazwaDokumentu + ".pdf";
|
||||||
|
docModel.Image = output.ToArray();
|
||||||
|
output.Close();
|
||||||
|
DocumentModel d = AppHelper.GetInstance().putDocument(docModel);
|
||||||
|
TreeNode tn = treeView1.SelectedNode;
|
||||||
|
bindTreeView();
|
||||||
|
treeView1.SelectedNode = treeView1.Nodes.Find(tn.Name, true)[0];
|
||||||
|
treeView1.Focus();
|
||||||
|
|
||||||
|
using (MemoryStream ms = new MemoryStream(d.Image))
|
||||||
|
{
|
||||||
|
pdfViewer1.Document?.Dispose();
|
||||||
|
var pdf = PdfDocument.Load(ms);
|
||||||
|
pdfViewer1.Document = pdf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Błędna nazwa dokumentu. Dokument nie zapisany!", "Błąd");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonButton9_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var si = (DocumentModel)listBox1.SelectedItem;
|
||||||
|
SaveFileDialog saveFileDialog = new SaveFileDialog();
|
||||||
|
saveFileDialog.FileName = si.Name;
|
||||||
|
saveFileDialog.Filter = "All|*.*";
|
||||||
|
var res = saveFileDialog.ShowDialog();
|
||||||
|
if (res == DialogResult.OK)
|
||||||
|
{
|
||||||
|
var doc = AppHelper.GetInstance().getDocumentById(si.Id);
|
||||||
|
File.WriteAllBytes(saveFileDialog.FileName, doc.Image);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonButton11_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
bindTreeView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonButton10_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||||
|
openFileDialog.Filter = "All|*.*";
|
||||||
|
openFileDialog.Multiselect = true;
|
||||||
|
DialogResult res = openFileDialog.ShowDialog();
|
||||||
|
|
||||||
|
foreach (var file in openFileDialog.FileNames)
|
||||||
|
{
|
||||||
|
DocumentModel docModel = new DocumentModel();
|
||||||
|
docModel.TreeId = int.Parse(treeView1.SelectedNode.Name);
|
||||||
|
docModel.Name = Path.GetFileName(file);
|
||||||
|
docModel.Image = File.ReadAllBytes(file);
|
||||||
|
DocumentModel d = AppHelper.GetInstance().putDocument(docModel);
|
||||||
|
}
|
||||||
|
listBox1.Items.Clear();
|
||||||
|
int treeId = int.Parse(treeView1.SelectedNode.Name);
|
||||||
|
var doc = JsonConvert.DeserializeObject<List<DocumentModel>>(AppHelper.GetInstance().getDocumentsByTreeId(treeId));
|
||||||
|
var ds = doc.Where(d => d.TreeId == treeId).ToList();
|
||||||
|
foreach (var d in ds)
|
||||||
|
{
|
||||||
|
listBox1.Items.Add(d);
|
||||||
|
}
|
||||||
|
kryptonButton1.Enabled = true;
|
||||||
|
kryptonButton2.Enabled = true;
|
||||||
|
kryptonButton3.Enabled = true;
|
||||||
|
kryptonButton6.Enabled = true;
|
||||||
|
kryptonButton7.Enabled = true;
|
||||||
|
kryptonButton8.Enabled = true;
|
||||||
|
kryptonButton4.Enabled = false;
|
||||||
|
kryptonButton5.Enabled = false;
|
||||||
|
kryptonButton9.Enabled = false;
|
||||||
|
kryptonButton10.Enabled = true;
|
||||||
|
listBox1.ClearSelected();
|
||||||
|
kryptonLabel1.Text = "";
|
||||||
|
pdfViewer1.Document?.Dispose();
|
||||||
|
var pdf = PdfDocument.Load(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\None.pdf");
|
||||||
|
pdfViewer1.Document = pdf;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AppForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
pdfViewer1.Document?.Dispose();
|
||||||
|
File.Delete(Path.GetTempPath() + "\\temp.pdf");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void treeView1_ItemDrag(object sender, ItemDragEventArgs e)
|
||||||
|
{
|
||||||
|
treeView1.DoDragDrop(e.Item, DragDropEffects.Move);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void treeView1_DragEnter(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
e.Effect = DragDropEffects.Move;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void treeView1_DragDrop(object sender, DragEventArgs e)
|
||||||
|
{
|
||||||
|
TreeNode aNode;
|
||||||
|
if (e.Data.GetDataPresent("System.Windows.Forms.TreeNode", false))
|
||||||
|
{
|
||||||
|
Point apoint;
|
||||||
|
TreeNode targetNode;
|
||||||
|
apoint = ((ComponentFactory.Krypton.Toolkit.KryptonTreeView)sender).PointToClient(new Point(e.X, e.Y));
|
||||||
|
targetNode = ((ComponentFactory.Krypton.Toolkit.KryptonTreeView)sender).GetNodeAt(apoint);
|
||||||
|
aNode = (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode");
|
||||||
|
targetNode.Nodes.Add((TreeNode)aNode.Clone());
|
||||||
|
targetNode.Expand();
|
||||||
|
aNode.Remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7454
FabitArchiwum.App/AppForm.resx
Normal file
7454
FabitArchiwum.App/AppForm.resx
Normal file
File diff suppressed because it is too large
Load Diff
368
FabitArchiwum.App/AppHelper.cs
Normal file
368
FabitArchiwum.App/AppHelper.cs
Normal file
@ -0,0 +1,368 @@
|
|||||||
|
using CryptoNet.Models;
|
||||||
|
using CryptoNet;
|
||||||
|
using FabitArchiwum.App.Model;
|
||||||
|
using Microsoft.IdentityModel.Tokens;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Org.BouncyCastle.Ocsp;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Security.Claims;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using static System.Net.Mime.MediaTypeNames;
|
||||||
|
using static System.Net.WebRequestMethods;
|
||||||
|
using Org.BouncyCastle.Security;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.App
|
||||||
|
{
|
||||||
|
public sealed class AppHelper
|
||||||
|
{
|
||||||
|
private AppHelper() { }
|
||||||
|
private static AppHelper _instance;
|
||||||
|
private static string URL = "https://nzozepione.myqnapcloud.com:5555";
|
||||||
|
// private static string URL = "https://localhost:44309";
|
||||||
|
private static TokenModel tokenModel;
|
||||||
|
private static RSACryptoServiceProvider publicKey;
|
||||||
|
private static RSA privateKey;
|
||||||
|
private static X509Certificate2 certificate = new X509Certificate2("nzozepione.pl.pfx", "Pjmzha15", X509KeyStorageFlags.Exportable);
|
||||||
|
|
||||||
|
public static AppHelper GetInstance()
|
||||||
|
{
|
||||||
|
if (_instance == null)
|
||||||
|
{
|
||||||
|
_instance = new AppHelper();
|
||||||
|
}
|
||||||
|
if (tokenModel != null && tokenModel.token != null)
|
||||||
|
{
|
||||||
|
var principal = GetPrincipalFromExpiredToken(tokenModel.token);
|
||||||
|
var exp = long.Parse(principal.Claims.Where(c => c.Type == "exp").FirstOrDefault().Value);
|
||||||
|
var expDate = DateTimeOffset.FromUnixTimeSeconds(exp);
|
||||||
|
if (DateTime.Now >= expDate)
|
||||||
|
{
|
||||||
|
refrehToken();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _isLogged;
|
||||||
|
private string errorLogin;
|
||||||
|
|
||||||
|
private static ClaimsPrincipal GetPrincipalFromExpiredToken(string token)
|
||||||
|
{
|
||||||
|
var tokenValidationParameters = new TokenValidationParameters
|
||||||
|
{
|
||||||
|
ValidateAudience = false,
|
||||||
|
ValidateIssuer = false,
|
||||||
|
ValidateIssuerSigningKey = true,
|
||||||
|
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes("This is a sample secret key - please don't use in production environment.'")),
|
||||||
|
ValidateLifetime = false
|
||||||
|
};
|
||||||
|
|
||||||
|
var tokenHandler = new JwtSecurityTokenHandler();
|
||||||
|
var principal = tokenHandler.ValidateToken(token, tokenValidationParameters, out SecurityToken securityToken);
|
||||||
|
|
||||||
|
//if (securityToken is not JwtSecurityToken jwtSecurityToken || !jwtSecurityToken.Header.Alg.Equals(SecurityAlgorithms.HmacSha256, StringComparison.InvariantCultureIgnoreCase))
|
||||||
|
// throw new SecurityTokenException("Invalid token");
|
||||||
|
return principal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool login(UserModel user)
|
||||||
|
{
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
|
||||||
|
handler.ServerCertificateCustomValidationCallback =
|
||||||
|
(httpRequestMessage, cert, cetChain, policyErrors) =>
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
using (var client = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
var data = new StringContent(JsonConvert.SerializeObject(new
|
||||||
|
{
|
||||||
|
username = user.Username,
|
||||||
|
password = user.Password
|
||||||
|
}));
|
||||||
|
data.Headers.ContentType = new MediaTypeHeaderValue("application/json");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var response = client.PostAsync(URL + "/api/Authenticate/Login", data).Result;
|
||||||
|
var resp = response.Content.ReadAsStringAsync().Result;
|
||||||
|
tokenModel = JsonConvert.DeserializeObject<Model.TokenModel>(resp);
|
||||||
|
if (tokenModel.token == null)
|
||||||
|
{
|
||||||
|
_isLogged = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_isLogged = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_isLogged = false;
|
||||||
|
errorLogin = ex.Message;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void refrehToken()
|
||||||
|
{
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
|
||||||
|
handler.ServerCertificateCustomValidationCallback =
|
||||||
|
(httpRequestMessage, cert, cetChain, policyErrors) =>
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
using (var client = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
var data = new StringContent(JsonConvert.SerializeObject(new
|
||||||
|
{
|
||||||
|
token = tokenModel.token,
|
||||||
|
refreshToken = tokenModel.token
|
||||||
|
}));
|
||||||
|
data.Headers.ContentType = new MediaTypeHeaderValue("application/json");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var response = client.PostAsync(URL + "/api/Authenticate/RefreshToken", data).Result;
|
||||||
|
var resp = response.Content.ReadAsStringAsync().Result;
|
||||||
|
tokenModel = JsonConvert.DeserializeObject<Model.TokenModel>(resp);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void putTree(int parentId, string text)
|
||||||
|
{
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
|
||||||
|
handler.ServerCertificateCustomValidationCallback =
|
||||||
|
(httpRequestMessage, cert, cetChain, policyErrors) =>
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
using (var client = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenModel.token);
|
||||||
|
|
||||||
|
var data = new StringContent(JsonConvert.SerializeObject(new
|
||||||
|
{
|
||||||
|
}));
|
||||||
|
data.Headers.ContentType = new MediaTypeHeaderValue("application/json");
|
||||||
|
var response = client.PostAsync(URL + "/api/Archiwum/PutTree?ParentId=" + parentId + "&Text=" + text, data).Result;
|
||||||
|
var resp = response.Content.ReadAsStringAsync().Result;
|
||||||
|
if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized) throw new UnauthorizedAccessException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void renameTree(int Id, string text)
|
||||||
|
{
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
|
||||||
|
handler.ServerCertificateCustomValidationCallback =
|
||||||
|
(httpRequestMessage, cert, cetChain, policyErrors) =>
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
using (var client = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenModel.token);
|
||||||
|
|
||||||
|
var data = new StringContent(JsonConvert.SerializeObject(new
|
||||||
|
{
|
||||||
|
}));
|
||||||
|
data.Headers.ContentType = new MediaTypeHeaderValue("application/json");
|
||||||
|
var response = client.PostAsync(URL + "/api/Archiwum/RenameTree?Id=" + Id + "&Text=" + text, data).Result;
|
||||||
|
var resp = response.Content.ReadAsStringAsync().Result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void renameDocument(int Id, string text)
|
||||||
|
{
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
|
||||||
|
handler.ServerCertificateCustomValidationCallback =
|
||||||
|
(httpRequestMessage, cert, cetChain, policyErrors) =>
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
using (var client = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenModel.token);
|
||||||
|
|
||||||
|
var data = new StringContent(JsonConvert.SerializeObject(new
|
||||||
|
{
|
||||||
|
}));
|
||||||
|
data.Headers.ContentType = new MediaTypeHeaderValue("application/json");
|
||||||
|
var response = client.PostAsync(URL + "/api/Archiwum/RenameDocument?Id=" + Id + "&Name=" + text, data).Result;
|
||||||
|
var resp = response.Content.ReadAsStringAsync().Result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string getTree()
|
||||||
|
{
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
|
||||||
|
handler.ServerCertificateCustomValidationCallback =
|
||||||
|
(httpRequestMessage, cert, cetChain, policyErrors) =>
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
using (var client2 = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
client2.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenModel.token);
|
||||||
|
|
||||||
|
var response2 = client2.GetAsync(URL + "/api/Archiwum/GetTree").Result;
|
||||||
|
var resp2 = response2.Content.ReadAsStringAsync().Result;
|
||||||
|
return resp2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string getDocumentsByTreeId(int treeId)
|
||||||
|
{
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
|
||||||
|
handler.ServerCertificateCustomValidationCallback =
|
||||||
|
(httpRequestMessage, cert, cetChain, policyErrors) =>
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
using (var client2 = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
client2.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenModel.token);
|
||||||
|
|
||||||
|
var response2 = client2.GetAsync(URL + "/api/Archiwum/GetDocumentsByTreeId?TreeId=" + treeId.ToString()).Result;
|
||||||
|
var resp2 = response2.Content.ReadAsStringAsync().Result;
|
||||||
|
return resp2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool isLogged()
|
||||||
|
{
|
||||||
|
return _isLogged;
|
||||||
|
}
|
||||||
|
public string getErrorLogin()
|
||||||
|
{
|
||||||
|
return errorLogin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DocumentModel putDocument(DocumentModel doc)
|
||||||
|
{
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
|
||||||
|
handler.ServerCertificateCustomValidationCallback =
|
||||||
|
(httpRequestMessage, cert, cetChain, policyErrors) =>
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
using (var client = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
//ICryptoNet cryptoNetWithPublicKey = new CryptoNetRsa(certificate, KeyType.PublicKey);
|
||||||
|
//var r = cryptoNetWithPublicKey.EncryptFromBytes(doc.Image);
|
||||||
|
//doc.Image = r;
|
||||||
|
var data = new StringContent(JsonConvert.SerializeObject(doc));
|
||||||
|
data.Headers.ContentType = new MediaTypeHeaderValue("application/json");
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenModel.token);
|
||||||
|
|
||||||
|
var response = client.PostAsync(URL + "/api/Archiwum/PutDocument", data).Result;
|
||||||
|
var resp = response.Content.ReadAsStringAsync().Result;
|
||||||
|
return JsonConvert.DeserializeObject<DocumentModel>(resp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public DocumentModel getDocumentById(int id)
|
||||||
|
{
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
|
||||||
|
handler.ServerCertificateCustomValidationCallback =
|
||||||
|
(httpRequestMessage, cert, cetChain, policyErrors) =>
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
using (var client2 = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
client2.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenModel.token);
|
||||||
|
|
||||||
|
var response2 = client2.GetAsync(URL + "/api/Archiwum/GetDocumentById?Id=" + id.ToString()).Result;
|
||||||
|
var resp2 = response2.Content.ReadAsStringAsync().Result;
|
||||||
|
//ICryptoNet cryptoNetWithPrivateKey = new CryptoNetRsa(certificate, KeyType.PrivateKey);
|
||||||
|
var cert = DotNetUtilities.FromX509Certificate(certificate);
|
||||||
|
//var res = cryptoNetWithPrivateKey.DecryptToBytes(response2.Content.ReadAsByteArrayAsync().Result);
|
||||||
|
return JsonConvert.DeserializeObject<DocumentModel>(resp2);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteDocument(int Id)
|
||||||
|
{
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
|
||||||
|
handler.ServerCertificateCustomValidationCallback =
|
||||||
|
(httpRequestMessage, cert, cetChain, policyErrors) =>
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
using (var client = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenModel.token);
|
||||||
|
|
||||||
|
var data = new StringContent(JsonConvert.SerializeObject(new
|
||||||
|
{
|
||||||
|
}));
|
||||||
|
data.Headers.ContentType = new MediaTypeHeaderValue("application/json");
|
||||||
|
var response = client.PostAsync(URL + "/api/Archiwum/DeleteDocument?Id=" + Id, data).Result;
|
||||||
|
var resp = response.Content.ReadAsStringAsync().Result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteTree(int Id)
|
||||||
|
{
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
|
||||||
|
handler.ServerCertificateCustomValidationCallback =
|
||||||
|
(httpRequestMessage, cert, cetChain, policyErrors) =>
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
using (var client = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenModel.token);
|
||||||
|
|
||||||
|
var data = new StringContent(JsonConvert.SerializeObject(new
|
||||||
|
{
|
||||||
|
}));
|
||||||
|
data.Headers.ContentType = new MediaTypeHeaderValue("application/json");
|
||||||
|
var response = client.PostAsync(URL + "/api/Archiwum/DeleteTree?Id=" + Id, data).Result;
|
||||||
|
var resp = response.Content.ReadAsStringAsync().Result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
FabitArchiwum.App/CryptoNetLogo-icon.ico
Normal file
BIN
FabitArchiwum.App/CryptoNetLogo-icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
284
FabitArchiwum.App/FabitArchiwum.App.csproj
Normal file
284
FabitArchiwum.App/FabitArchiwum.App.csproj
Normal file
@ -0,0 +1,284 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="..\packages\PdfiumViewer.Native.x86_64.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86_64.v8-xfa.props" Condition="Exists('..\packages\PdfiumViewer.Native.x86_64.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86_64.v8-xfa.props')" />
|
||||||
|
<Import Project="..\packages\PdfiumViewer.Native.x86.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86.v8-xfa.props" Condition="Exists('..\packages\PdfiumViewer.Native.x86.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86.v8-xfa.props')" />
|
||||||
|
<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>{A0C42D69-546B-4EAB-9AAE-4CD0B3935198}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>FabitArchiwum.App</RootNamespace>
|
||||||
|
<AssemblyName>FabitArchiwum.App</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
|
<IsWebBootstrapper>true</IsWebBootstrapper>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
<PublishUrl>publish\</PublishUrl>
|
||||||
|
<Install>true</Install>
|
||||||
|
<InstallFrom>Web</InstallFrom>
|
||||||
|
<UpdateEnabled>true</UpdateEnabled>
|
||||||
|
<UpdateMode>Foreground</UpdateMode>
|
||||||
|
<UpdateInterval>7</UpdateInterval>
|
||||||
|
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||||
|
<UpdatePeriodically>false</UpdatePeriodically>
|
||||||
|
<UpdateRequired>false</UpdateRequired>
|
||||||
|
<MapFileExtensions>true</MapFileExtensions>
|
||||||
|
<InstallUrl>https://fabit.pl/epione/</InstallUrl>
|
||||||
|
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||||
|
<WebPage>index.htm</WebPage>
|
||||||
|
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
|
||||||
|
<ApplicationRevision>37</ApplicationRevision>
|
||||||
|
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||||
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
|
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||||
|
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||||
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
|
</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>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SignManifests>false</SignManifests>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ManifestCertificateThumbprint>3610351FDF7C66E94FA513E369B921083001CAFE</ManifestCertificateThumbprint>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ManifestKeyFile>
|
||||||
|
</ManifestKeyFile>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<SignAssembly>false</SignAssembly>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<GenerateManifests>true</GenerateManifests>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<AssemblyOriginatorKeyFile>fabit.pl.snk</AssemblyOriginatorKeyFile>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationIcon>ikona.ico</ApplicationIcon>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetZone>Internet</TargetZone>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="BouncyCastle.Crypto, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\BouncyCastle.NetCore.2.2.1\lib\net45\BouncyCastle.Crypto.dll</HintPath>
|
||||||
|
<Aliases>KF</Aliases>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ComponentFactory.Krypton.Design, Version=4.4.1.0, Culture=neutral, PublicKeyToken=a87e673e9ecb6e8e, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\KryptonWinFormControls.4.4.1.0\lib\net40\ComponentFactory.Krypton.Design.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ComponentFactory.Krypton.Docking, Version=4.4.1.0, Culture=neutral, PublicKeyToken=a87e673e9ecb6e8e, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\KryptonWinFormControls.4.4.1.0\lib\net40\ComponentFactory.Krypton.Docking.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ComponentFactory.Krypton.Navigator, Version=4.4.1.0, Culture=neutral, PublicKeyToken=a87e673e9ecb6e8e, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\KryptonWinFormControls.4.4.1.0\lib\net40\ComponentFactory.Krypton.Navigator.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ComponentFactory.Krypton.Ribbon, Version=4.4.1.0, Culture=neutral, PublicKeyToken=a87e673e9ecb6e8e, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\KryptonWinFormControls.4.4.1.0\lib\net40\ComponentFactory.Krypton.Ribbon.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ComponentFactory.Krypton.Toolkit, Version=4.4.1.0, Culture=neutral, PublicKeyToken=a87e673e9ecb6e8e, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\KryptonWinFormControls.4.4.1.0\lib\net40\ComponentFactory.Krypton.Toolkit.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="ComponentFactory.Krypton.Workspace, Version=4.4.1.0, Culture=neutral, PublicKeyToken=a87e673e9ecb6e8e, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\KryptonWinFormControls.4.4.1.0\lib\net40\ComponentFactory.Krypton.Workspace.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="CryptoNet, Version=2.4.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\CryptoNet.2.4.0\lib\netstandard2.0\CryptoNet.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="iTextSharp, Version=4.1.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca">
|
||||||
|
<HintPath>..\packages\iTextSharp-LGPL.4.1.6\lib\iTextSharp.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.Abstractions, Version=7.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.Abstractions.7.0.3\lib\net472\Microsoft.IdentityModel.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=7.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.7.0.3\lib\net472\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.Logging, Version=7.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.Logging.7.0.3\lib\net472\Microsoft.IdentityModel.Logging.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.IdentityModel.Tokens, Version=7.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.IdentityModel.Tokens.7.0.3\lib\net472\Microsoft.IdentityModel.Tokens.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="PdfiumViewer, Version=2.13.0.0, Culture=neutral, PublicKeyToken=91e4789cfb0609e0, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\PdfiumViewer.2.13.0.0\lib\net20\PdfiumViewer.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=7.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.7.0.3\lib\net472\System.IdentityModel.Tokens.Jwt.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Numerics" />
|
||||||
|
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Text.Encodings.Web, Version=4.0.5.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Text.Encodings.Web.4.7.2\lib\net461\System.Text.Encodings.Web.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Text.Json.4.7.2\lib\net461\System.Text.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<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" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="AppForm.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="AppForm.Designer.cs">
|
||||||
|
<DependentUpon>AppForm.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="AppHelper.cs" />
|
||||||
|
<Compile Include="LoginForm.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="LoginForm.Designer.cs">
|
||||||
|
<DependentUpon>LoginForm.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Model\DocumentModel.cs" />
|
||||||
|
<Compile Include="Model\TokenModel.cs" />
|
||||||
|
<Compile Include="Model\TreeModel.cs" />
|
||||||
|
<Compile Include="Model\UserModel.cs" />
|
||||||
|
<Compile Include="OProgramieForm.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="OProgramieForm.Designer.cs">
|
||||||
|
<DependentUpon>OProgramieForm.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<EmbeddedResource Include="AppForm.resx">
|
||||||
|
<DependentUpon>AppForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="LoginForm.resx">
|
||||||
|
<DependentUpon>LoginForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="OProgramieForm.resx">
|
||||||
|
<DependentUpon>OProgramieForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<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>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
</Compile>
|
||||||
|
<None Include="fabit.pl.pfx" />
|
||||||
|
<None Include="fabit.pl.snk" />
|
||||||
|
<None Include="FabitArchiwum.App_1_TemporaryKey.pfx" />
|
||||||
|
<None Include="FabitArchiwum.App_TemporaryKey.pfx" />
|
||||||
|
<Content Include="CryptoNetLogo-icon.ico" />
|
||||||
|
<Content Include="None.pdf">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="nzozepione.pl.pfx">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<None Include="Properties\app.manifest" />
|
||||||
|
<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>
|
||||||
|
<COMReference Include="WIA">
|
||||||
|
<Guid>{94A0E92D-43C0-494E-AC29-FD45948A5221}</Guid>
|
||||||
|
<VersionMajor>1</VersionMajor>
|
||||||
|
<VersionMinor>0</VersionMinor>
|
||||||
|
<Lcid>0</Lcid>
|
||||||
|
<WrapperTool>tlbimp</WrapperTool>
|
||||||
|
<Isolated>False</Isolated>
|
||||||
|
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||||
|
</COMReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
|
||||||
|
<Install>true</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||||
|
<Install>false</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="ikona.ico" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\PdfiumViewer.Native.x86.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86.v8-xfa.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\PdfiumViewer.Native.x86.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86.v8-xfa.props'))" />
|
||||||
|
<Error Condition="!Exists('..\packages\PdfiumViewer.Native.x86_64.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86_64.v8-xfa.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\PdfiumViewer.Native.x86_64.v8-xfa.2018.4.8.256\build\PdfiumViewer.Native.x86_64.v8-xfa.props'))" />
|
||||||
|
</Target>
|
||||||
|
</Project>
|
||||||
113
FabitArchiwum.App/LoginForm.Designer.cs
generated
Normal file
113
FabitArchiwum.App/LoginForm.Designer.cs
generated
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
namespace FabitArchiwum.App
|
||||||
|
{
|
||||||
|
partial class LoginForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginForm));
|
||||||
|
this.kryptonLabel1 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||||
|
this.kryptonLabel2 = new ComponentFactory.Krypton.Toolkit.KryptonLabel();
|
||||||
|
this.tbUser = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||||
|
this.tbPassword = new ComponentFactory.Krypton.Toolkit.KryptonTextBox();
|
||||||
|
this.btLogin = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// kryptonLabel1
|
||||||
|
//
|
||||||
|
this.kryptonLabel1.Location = new System.Drawing.Point(12, 23);
|
||||||
|
this.kryptonLabel1.Name = "kryptonLabel1";
|
||||||
|
this.kryptonLabel1.Size = new System.Drawing.Size(93, 24);
|
||||||
|
this.kryptonLabel1.TabIndex = 5;
|
||||||
|
this.kryptonLabel1.Values.Text = "Użytkownik:";
|
||||||
|
//
|
||||||
|
// kryptonLabel2
|
||||||
|
//
|
||||||
|
this.kryptonLabel2.Location = new System.Drawing.Point(51, 51);
|
||||||
|
this.kryptonLabel2.Name = "kryptonLabel2";
|
||||||
|
this.kryptonLabel2.Size = new System.Drawing.Size(54, 24);
|
||||||
|
this.kryptonLabel2.TabIndex = 6;
|
||||||
|
this.kryptonLabel2.Values.Text = "Hasło:";
|
||||||
|
//
|
||||||
|
// tbUser
|
||||||
|
//
|
||||||
|
this.tbUser.Location = new System.Drawing.Point(111, 20);
|
||||||
|
this.tbUser.Name = "tbUser";
|
||||||
|
this.tbUser.Size = new System.Drawing.Size(211, 27);
|
||||||
|
this.tbUser.TabIndex = 7;
|
||||||
|
this.tbUser.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tbUser_KeyDown_1);
|
||||||
|
//
|
||||||
|
// tbPassword
|
||||||
|
//
|
||||||
|
this.tbPassword.Location = new System.Drawing.Point(111, 53);
|
||||||
|
this.tbPassword.Name = "tbPassword";
|
||||||
|
this.tbPassword.PasswordChar = '*';
|
||||||
|
this.tbPassword.Size = new System.Drawing.Size(211, 27);
|
||||||
|
this.tbPassword.TabIndex = 8;
|
||||||
|
this.tbPassword.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tbPassword_KeyDown);
|
||||||
|
//
|
||||||
|
// btLogin
|
||||||
|
//
|
||||||
|
this.btLogin.Location = new System.Drawing.Point(111, 87);
|
||||||
|
this.btLogin.Name = "btLogin";
|
||||||
|
this.btLogin.Size = new System.Drawing.Size(120, 36);
|
||||||
|
this.btLogin.TabIndex = 9;
|
||||||
|
this.btLogin.Values.Text = "Zaloguj";
|
||||||
|
this.btLogin.Click += new System.EventHandler(this.btLogin_Click);
|
||||||
|
//
|
||||||
|
// LoginForm
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(334, 135);
|
||||||
|
this.Controls.Add(this.btLogin);
|
||||||
|
this.Controls.Add(this.tbPassword);
|
||||||
|
this.Controls.Add(this.tbUser);
|
||||||
|
this.Controls.Add(this.kryptonLabel2);
|
||||||
|
this.Controls.Add(this.kryptonLabel1);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||||
|
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "LoginForm";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "LOGOWANIE";
|
||||||
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.LoginForm_FormClosing);
|
||||||
|
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.LoginForm_FormClosed);
|
||||||
|
this.Shown += new System.EventHandler(this.LoginForm_Shown);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel1;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonLabel kryptonLabel2;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonTextBox tbUser;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonTextBox tbPassword;
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonButton btLogin;
|
||||||
|
}
|
||||||
|
}
|
||||||
68
FabitArchiwum.App/LoginForm.cs
Normal file
68
FabitArchiwum.App/LoginForm.cs
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
using FabitArchiwum.App.Model;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.App
|
||||||
|
{
|
||||||
|
public partial class LoginForm : ComponentFactory.Krypton.Toolkit.KryptonForm
|
||||||
|
{
|
||||||
|
public LoginForm()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoginForm_Shown(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
tbUser.Focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void tbUser_KeyDown_1(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.KeyCode == Keys.Enter)
|
||||||
|
{
|
||||||
|
e.SuppressKeyPress = true;
|
||||||
|
tbPassword.Focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void tbPassword_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.KeyCode == Keys.Enter)
|
||||||
|
{
|
||||||
|
e.SuppressKeyPress = true;
|
||||||
|
btLogin.Focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btLogin_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (AppHelper.GetInstance().login(new UserModel() { Username = tbUser.Text, Password = tbPassword.Text }))
|
||||||
|
{
|
||||||
|
this.Visible = false;
|
||||||
|
var appForm = new AppForm();
|
||||||
|
appForm.ShowDialog();
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Błąd logowania " + AppHelper.GetInstance().getErrorLogin(), "BŁĄD", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoginForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoginForm_FormClosed(object sender, FormClosedEventArgs e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7451
FabitArchiwum.App/LoginForm.resx
Normal file
7451
FabitArchiwum.App/LoginForm.resx
Normal file
File diff suppressed because it is too large
Load Diff
23
FabitArchiwum.App/Model/DocumentModel.cs
Normal file
23
FabitArchiwum.App/Model/DocumentModel.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.App.Model
|
||||||
|
{
|
||||||
|
public class DocumentModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public int TreeId { get; set; }
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public byte[] Image { get; set; }
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
16
FabitArchiwum.App/Model/TokenModel.cs
Normal file
16
FabitArchiwum.App/Model/TokenModel.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.App.Model
|
||||||
|
{
|
||||||
|
internal class TokenModel
|
||||||
|
{
|
||||||
|
public string token { get; set; }
|
||||||
|
public string refreshToken { get; set; }
|
||||||
|
public DateTime expiration { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
15
FabitArchiwum.App/Model/TreeModel.cs
Normal file
15
FabitArchiwum.App/Model/TreeModel.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.App.Model
|
||||||
|
{
|
||||||
|
public class TreeModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string Text { get; set; }
|
||||||
|
public Nullable<int> ParentId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
8
FabitArchiwum.App/Model/UserModel.cs
Normal file
8
FabitArchiwum.App/Model/UserModel.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace FabitArchiwum.App.Model
|
||||||
|
{
|
||||||
|
public class UserModel
|
||||||
|
{
|
||||||
|
public string Username { get; set; }
|
||||||
|
public string Password { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
FabitArchiwum.App/None.pdf
Normal file
BIN
FabitArchiwum.App/None.pdf
Normal file
Binary file not shown.
79
FabitArchiwum.App/OProgramieForm.Designer.cs
generated
Normal file
79
FabitArchiwum.App/OProgramieForm.Designer.cs
generated
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
namespace FabitArchiwum.App
|
||||||
|
{
|
||||||
|
partial class OProgramieForm
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OProgramieForm));
|
||||||
|
this.kryptonButton1 = new ComponentFactory.Krypton.Toolkit.KryptonButton();
|
||||||
|
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// kryptonButton1
|
||||||
|
//
|
||||||
|
this.kryptonButton1.Location = new System.Drawing.Point(42, 186);
|
||||||
|
this.kryptonButton1.Name = "kryptonButton1";
|
||||||
|
this.kryptonButton1.Size = new System.Drawing.Size(90, 32);
|
||||||
|
this.kryptonButton1.TabIndex = 0;
|
||||||
|
this.kryptonButton1.Values.Text = "Zamknij";
|
||||||
|
this.kryptonButton1.Click += new System.EventHandler(this.kryptonButton1_Click);
|
||||||
|
//
|
||||||
|
// pictureBox1
|
||||||
|
//
|
||||||
|
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
|
||||||
|
this.pictureBox1.Location = new System.Drawing.Point(12, 12);
|
||||||
|
this.pictureBox1.Name = "pictureBox1";
|
||||||
|
this.pictureBox1.Size = new System.Drawing.Size(153, 168);
|
||||||
|
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||||
|
this.pictureBox1.TabIndex = 1;
|
||||||
|
this.pictureBox1.TabStop = false;
|
||||||
|
//
|
||||||
|
// OProgramieForm
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(175, 229);
|
||||||
|
this.Controls.Add(this.pictureBox1);
|
||||||
|
this.Controls.Add(this.kryptonButton1);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "OProgramieForm";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "O programie";
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private ComponentFactory.Krypton.Toolkit.KryptonButton kryptonButton1;
|
||||||
|
private System.Windows.Forms.PictureBox pictureBox1;
|
||||||
|
}
|
||||||
|
}
|
||||||
30
FabitArchiwum.App/OProgramieForm.cs
Normal file
30
FabitArchiwum.App/OProgramieForm.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.App
|
||||||
|
{
|
||||||
|
public partial class OProgramieForm : Form
|
||||||
|
{
|
||||||
|
public OProgramieForm()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonButton1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void kryptonWrapLabel1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
287
FabitArchiwum.App/OProgramieForm.resx
Normal file
287
FabitArchiwum.App/OProgramieForm.resx
Normal file
@ -0,0 +1,287 @@
|
|||||||
|
<?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>
|
||||||
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
|
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
/9j/4AAQSkZJRgABAQEAAAAAAAD/2wBDAAsJCQcJCQcJCQkJCwkJCQkJCQsJCwsMCwsLDA0QDBEODQ4M
|
||||||
|
EhkSJRodJR0ZHxwpKRYlNzU2GioyPi0pMBk7IRP/2wBDAQcICAsJCxULCxUsHRkdLCwsLCwsLCwsLCws
|
||||||
|
LCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCz/wAARCAFfAV8DASIAAhEBAxEB/8QA
|
||||||
|
HAABAQACAwEBAAAAAAAAAAAAAAEGBwIDBAUI/8QAVxAAAgIBAgMDAwwMCwYEBwAAAAECAwQFEQYSITFB
|
||||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||||||
|
AD1EKQgACAAAAAAAgBKAgAAAACAAAAEhCkAAAAQAAAAgIUBKAAAQoCEBSBIAAgIUBKAAIAAAIUAf/9k=
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
24
FabitArchiwum.App/Program.cs
Normal file
24
FabitArchiwum.App/Program.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.App
|
||||||
|
{
|
||||||
|
internal static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The main entry point for the application.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
var loginForm = new LoginForm();
|
||||||
|
// var appForm = new AppForm();
|
||||||
|
Application.Run(loginForm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
FabitArchiwum.App/Properties/AssemblyInfo.cs
Normal file
36
FabitArchiwum.App/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("FabitArchiwum.App")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("FabitArchiwum.App")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("a0c42d69-546b-4eab-9aae-4cd0b3935198")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
63
FabitArchiwum.App/Properties/Resources.Designer.cs
generated
Normal file
63
FabitArchiwum.App/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace FabitArchiwum.App.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
/// </summary>
|
||||||
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
|
// class via a tool like ResGen or Visual Studio.
|
||||||
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
|
// with the /str option, or rebuild your VS project.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.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>
|
||||||
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FabitArchiwum.App.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
|
/// resource lookups using this strongly typed resource class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
117
FabitArchiwum.App/Properties/Resources.resx
Normal file
117
FabitArchiwum.App/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>
|
||||||
26
FabitArchiwum.App/Properties/Settings.Designer.cs
generated
Normal file
26
FabitArchiwum.App/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace FabitArchiwum.App.Properties {
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
FabitArchiwum.App/Properties/Settings.settings
Normal file
7
FabitArchiwum.App/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
73
FabitArchiwum.App/Properties/app.manifest
Normal file
73
FabitArchiwum.App/Properties/app.manifest
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
|
||||||
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||||
|
<security>
|
||||||
|
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<!-- UAC Manifest Options
|
||||||
|
If you want to change the Windows User Account Control level replace the
|
||||||
|
requestedExecutionLevel node with one of the following.
|
||||||
|
|
||||||
|
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||||
|
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||||
|
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||||
|
|
||||||
|
Specifying requestedExecutionLevel element will disable file and registry virtualization.
|
||||||
|
Remove this element if your application requires this virtualization for backwards
|
||||||
|
compatibility.
|
||||||
|
-->
|
||||||
|
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||||
|
</requestedPrivileges>
|
||||||
|
<applicationRequestMinimum>
|
||||||
|
<defaultAssemblyRequest permissionSetReference="Custom" />
|
||||||
|
<PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" Unrestricted="true" />
|
||||||
|
</applicationRequestMinimum>
|
||||||
|
</security>
|
||||||
|
</trustInfo>
|
||||||
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
|
<application>
|
||||||
|
<!-- A list of the Windows versions that this application has been tested on
|
||||||
|
and is designed to work with. Uncomment the appropriate elements
|
||||||
|
and Windows will automatically select the most compatible environment. -->
|
||||||
|
<!-- Windows Vista -->
|
||||||
|
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
|
||||||
|
<!-- Windows 7 -->
|
||||||
|
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
|
||||||
|
<!-- Windows 8 -->
|
||||||
|
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
|
||||||
|
<!-- Windows 8.1 -->
|
||||||
|
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
|
||||||
|
<!-- Windows 10 -->
|
||||||
|
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
|
||||||
|
</application>
|
||||||
|
</compatibility>
|
||||||
|
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
|
||||||
|
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
|
||||||
|
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
|
||||||
|
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config.
|
||||||
|
|
||||||
|
Makes the application long-path aware. See https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
|
||||||
|
<!--
|
||||||
|
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<windowsSettings>
|
||||||
|
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||||
|
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
||||||
|
</windowsSettings>
|
||||||
|
</application>
|
||||||
|
-->
|
||||||
|
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
|
||||||
|
<!--
|
||||||
|
<dependency>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity
|
||||||
|
type="win32"
|
||||||
|
name="Microsoft.Windows.Common-Controls"
|
||||||
|
version="6.0.0.0"
|
||||||
|
processorArchitecture="*"
|
||||||
|
publicKeyToken="6595b64144ccf1df"
|
||||||
|
language="*"
|
||||||
|
/>
|
||||||
|
</dependentAssembly>
|
||||||
|
</dependency>
|
||||||
|
-->
|
||||||
|
</assembly>
|
||||||
BIN
FabitArchiwum.App/fabit.pl.snk
Normal file
BIN
FabitArchiwum.App/fabit.pl.snk
Normal file
Binary file not shown.
BIN
FabitArchiwum.App/ikona.ico
Normal file
BIN
FabitArchiwum.App/ikona.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 429 KiB |
25
FabitArchiwum.App/packages.config
Normal file
25
FabitArchiwum.App/packages.config
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="BouncyCastle.NetCore" version="2.2.1" targetFramework="net48" />
|
||||||
|
<package id="CryptoNet" version="2.4.0" targetFramework="net472" />
|
||||||
|
<package id="iTextSharp-LGPL" version="4.1.6" targetFramework="net472" />
|
||||||
|
<package id="KryptonWinFormControls" version="4.4.1.0" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.0" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.IdentityModel.Abstractions" version="7.0.3" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.IdentityModel.JsonWebTokens" version="7.0.3" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.IdentityModel.Logging" version="7.0.3" targetFramework="net472" />
|
||||||
|
<package id="Microsoft.IdentityModel.Tokens" version="7.0.3" targetFramework="net472" />
|
||||||
|
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
||||||
|
<package id="PdfiumViewer" version="2.13.0.0" targetFramework="net472" />
|
||||||
|
<package id="PdfiumViewer.Native.x86.v8-xfa" version="2018.4.8.256" targetFramework="net472" />
|
||||||
|
<package id="PdfiumViewer.Native.x86_64.v8-xfa" version="2018.4.8.256" targetFramework="net472" />
|
||||||
|
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
|
||||||
|
<package id="System.IdentityModel.Tokens.Jwt" version="7.0.3" targetFramework="net472" />
|
||||||
|
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
|
||||||
|
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
|
||||||
|
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net472" />
|
||||||
|
<package id="System.Text.Encodings.Web" version="4.7.2" targetFramework="net472" />
|
||||||
|
<package id="System.Text.Json" version="4.7.2" targetFramework="net472" />
|
||||||
|
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
|
||||||
|
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />
|
||||||
|
</packages>
|
||||||
6
FabitArchiwum.Test/App.config
Normal file
6
FabitArchiwum.Test/App.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
58
FabitArchiwum.Test/FabitArchiwum.Test.csproj
Normal file
58
FabitArchiwum.Test/FabitArchiwum.Test.csproj
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?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>{C24BCF8C-4857-419F-AE46-9340015F1D1F}</ProjectGuid>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<RootNamespace>FabitArchiwum.Test</RootNamespace>
|
||||||
|
<AssemblyName>FabitArchiwum.Test</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="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Model\TokenModel.cs" />
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
16
FabitArchiwum.Test/Model/TokenModel.cs
Normal file
16
FabitArchiwum.Test/Model/TokenModel.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Test.Model
|
||||||
|
{
|
||||||
|
internal class TokenModel
|
||||||
|
{
|
||||||
|
public string token { get; set; }
|
||||||
|
public string refreshToken { get; set; }
|
||||||
|
public DateTime expiration { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
68
FabitArchiwum.Test/Program.cs
Normal file
68
FabitArchiwum.Test/Program.cs
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Security.Policy;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Test
|
||||||
|
{
|
||||||
|
internal class Program
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
var sha1 = System.Security.Cryptography.SHA1.Create();
|
||||||
|
var pwd = sha1.ComputeHash(Encoding.UTF8.GetBytes("krfkrf"));
|
||||||
|
Console.WriteLine(BitConverter.ToString(pwd).Replace("-","").ToLower());
|
||||||
|
Console.ReadLine();
|
||||||
|
const String WEBAPI_URL = "https://localhost:32787";
|
||||||
|
var handler = new HttpClientHandler();
|
||||||
|
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
|
||||||
|
handler.ServerCertificateCustomValidationCallback =
|
||||||
|
(httpRequestMessage, cert, cetChain, policyErrors) =>
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
using (var client = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
String user = "krf";
|
||||||
|
String password = "krfkrf";
|
||||||
|
|
||||||
|
var data = new StringContent(JsonConvert.SerializeObject(new
|
||||||
|
{
|
||||||
|
username = "krf",
|
||||||
|
password = "krfkrf"
|
||||||
|
}));
|
||||||
|
data.Headers.ContentType = new MediaTypeHeaderValue("application/json");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var response = client.PostAsync("https://192.168.0.99:5555/api/Authenticate/Login", data).Result;
|
||||||
|
var resp = response.Content.ReadAsStringAsync().Result;
|
||||||
|
Console.WriteLine(resp);
|
||||||
|
var tokenModel = JsonConvert.DeserializeObject<Model.TokenModel>(resp);
|
||||||
|
Console.ReadLine();
|
||||||
|
|
||||||
|
using (var client2 = new HttpClient(handler))
|
||||||
|
{
|
||||||
|
client2.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenModel.token);
|
||||||
|
|
||||||
|
var response2 = client2.GetAsync("https://192.168.0.99:5555/api/Archiwum/GetTree").Result;
|
||||||
|
var resp2 = response2.Content.ReadAsStringAsync().Result;
|
||||||
|
Console.WriteLine(resp2);
|
||||||
|
Console.ReadLine();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine(ex.Message+ex.StackTrace+ex.InnerException);
|
||||||
|
Console.ReadLine();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
FabitArchiwum.Test/Properties/AssemblyInfo.cs
Normal file
36
FabitArchiwum.Test/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("FabitArchiwum.Test")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("FabitArchiwum.Test")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("c24bcf8c-4857-419f-ae46-9340015f1d1f")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
4
FabitArchiwum.Test/packages.config
Normal file
4
FabitArchiwum.Test/packages.config
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
||||||
|
</packages>
|
||||||
37
FabitArchiwum.sln
Normal file
37
FabitArchiwum.sln
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.7.34202.233
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FabitArchiwum", "FabitArchiwum\FabitArchiwum.csproj", "{3C5B6C25-5331-423F-9E69-CA220689FCE9}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FabitArchiwum.Test", "FabitArchiwum.Test\FabitArchiwum.Test.csproj", "{C24BCF8C-4857-419F-AE46-9340015F1D1F}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FabitArchiwum.App", "FabitArchiwum.App\FabitArchiwum.App.csproj", "{A0C42D69-546B-4EAB-9AAE-4CD0B3935198}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{3C5B6C25-5331-423F-9E69-CA220689FCE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{3C5B6C25-5331-423F-9E69-CA220689FCE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{3C5B6C25-5331-423F-9E69-CA220689FCE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{3C5B6C25-5331-423F-9E69-CA220689FCE9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{C24BCF8C-4857-419F-AE46-9340015F1D1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{C24BCF8C-4857-419F-AE46-9340015F1D1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{C24BCF8C-4857-419F-AE46-9340015F1D1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{C24BCF8C-4857-419F-AE46-9340015F1D1F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{A0C42D69-546B-4EAB-9AAE-4CD0B3935198}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{A0C42D69-546B-4EAB-9AAE-4CD0B3935198}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{A0C42D69-546B-4EAB-9AAE-4CD0B3935198}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{A0C42D69-546B-4EAB-9AAE-4CD0B3935198}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {DE136107-1466-4376-9286-99E473DFC571}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
314
FabitArchiwum/Controllers/ArchiwumController.cs
Normal file
314
FabitArchiwum/Controllers/ArchiwumController.cs
Normal file
@ -0,0 +1,314 @@
|
|||||||
|
using FabitArchiwum.Model;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using static System.Net.Mime.MediaTypeNames;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
using Microsoft.IdentityModel.Tokens;
|
||||||
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
|
using System.Security.Claims;
|
||||||
|
using System.Text;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
using System.Net;
|
||||||
|
using System.Reflection;
|
||||||
|
using Microsoft.AspNetCore.Http.HttpResults;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Controllers
|
||||||
|
{
|
||||||
|
[Authorize]
|
||||||
|
[ApiController]
|
||||||
|
[Route("/api/[controller]/[action]")]
|
||||||
|
public class ArchiwumController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly ILogger<ArchiwumController> _logger;
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
|
||||||
|
public ArchiwumController(ILogger<ArchiwumController> logger, IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetIpAddressOfClient()
|
||||||
|
{
|
||||||
|
string ipAddress = string.Empty;
|
||||||
|
IPAddress ip = Request.HttpContext.Connection.RemoteIpAddress;
|
||||||
|
if (ip != null)
|
||||||
|
{
|
||||||
|
if (ip.AddressFamily == AddressFamily.InterNetworkV6)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ip = Dns.GetHostEntry(ip).AddressList.First(x => x.AddressFamily == AddressFamily.InterNetwork);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ipAddress = ip.ToString();
|
||||||
|
}
|
||||||
|
return ipAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult GetTree()
|
||||||
|
{
|
||||||
|
var userId = int.Parse(User.Claims.Where(c => c.Type == "Id").FirstOrDefault().Value);
|
||||||
|
using (var context = new EpioneContext(_configuration))
|
||||||
|
{
|
||||||
|
var user_rights = context.UsersRights.Where(u => u.IdUser == userId).ToList();
|
||||||
|
var t = context.Trees.ToList();
|
||||||
|
foreach (var _t in t)
|
||||||
|
{
|
||||||
|
var tree_rights = context.TreesRights.Where(x => x.IdTree == _t.Id).ToList();
|
||||||
|
var ok = false;
|
||||||
|
foreach(var tr in tree_rights)
|
||||||
|
{
|
||||||
|
if (userId==1 || user_rights.Where(u => u.IdGroup == tr.IdGroup).Count() > 0) ok = true;
|
||||||
|
}
|
||||||
|
if (!ok) _t.Text = "Brak uprawnieñ";
|
||||||
|
}
|
||||||
|
return Ok(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult GetDocumentById(int Id)
|
||||||
|
{
|
||||||
|
var userId = int.Parse(User.Claims.Where(c => c.Type == "Id").FirstOrDefault().Value);
|
||||||
|
using (var context = new EpioneContext(_configuration))
|
||||||
|
{
|
||||||
|
var t = context.Documents.Where(d=>d.Id == Id).FirstOrDefault();
|
||||||
|
var user_rights = context.UsersRights.Where(u => u.IdUser == userId).ToList();
|
||||||
|
var tree = context.Trees.Where(x => x.Id == t.TreeId).FirstOrDefault();
|
||||||
|
var tree_rights = context.TreesRights.Where(x => x.IdTree == tree.Id).ToList();
|
||||||
|
var ok = false;
|
||||||
|
foreach (var tr in tree_rights)
|
||||||
|
{
|
||||||
|
if (userId == 1 || user_rights.Where(u => u.IdGroup == tr.IdGroup).Count() > 0) ok = true;
|
||||||
|
}
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
context.Logs.Add(new Log { CreateDateTime = DateTime.Now, Method = MethodBase.GetCurrentMethod().Name, Value = "UserId: " + User.Claims.Where(c => c.Type == "Id").FirstOrDefault().Value + "; IP: " + GetIpAddressOfClient() + "; DocId: " + Id.ToString() });
|
||||||
|
context.SaveChanges();
|
||||||
|
return Ok(t);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return Unauthorized();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult GetDocumentsByTreeId(int TreeId)
|
||||||
|
{
|
||||||
|
var userId = int.Parse(User.Claims.Where(c => c.Type == "Id").FirstOrDefault().Value);
|
||||||
|
using (var context = new EpioneContext(_configuration))
|
||||||
|
{
|
||||||
|
var user_rights = context.UsersRights.Where(u => u.IdUser == userId).ToList();
|
||||||
|
var tree = context.Trees.Where(x => x.Id == TreeId).FirstOrDefault();
|
||||||
|
var tree_rights = context.TreesRights.Where(x => x.IdTree == tree.Id).ToList();
|
||||||
|
var ok = false;
|
||||||
|
foreach (var tr in tree_rights)
|
||||||
|
{
|
||||||
|
if (userId == 1 || user_rights.Where(u => u.IdGroup == tr.IdGroup).Count() > 0) ok = true;
|
||||||
|
}
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
var t = context.Documents.Where(d => d.TreeId == TreeId).Select(x => new { x.Id, x.TreeId, x.Name }).ToList();
|
||||||
|
return Ok(t);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Ok("[]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public IActionResult PutTree(int ParentId, string Text)
|
||||||
|
{
|
||||||
|
var userId = int.Parse(User.Claims.Where(c => c.Type == "Id").FirstOrDefault().Value);
|
||||||
|
|
||||||
|
using (var context = new EpioneContext(_configuration))
|
||||||
|
{
|
||||||
|
var user_rights = context.UsersRights.Where(u => u.IdUser == userId).ToList();
|
||||||
|
var tree = context.Trees.Where(x => x.Id == ParentId).FirstOrDefault();
|
||||||
|
var tree_rights = context.TreesRights.Where(x => x.IdTree == tree.Id).ToList();
|
||||||
|
var ok = false;
|
||||||
|
foreach (var tr in tree_rights)
|
||||||
|
{
|
||||||
|
if (userId == 1 || user_rights.Where(u => u.IdGroup == tr.IdGroup).Count() > 0) ok = true;
|
||||||
|
}
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
Tree t = new Tree();
|
||||||
|
t.ParentId = ParentId;
|
||||||
|
t.Text = Text;
|
||||||
|
t.CreateDateTime = DateTime.Now;
|
||||||
|
t = context.Trees.Add(t).Entity;
|
||||||
|
context.SaveChanges();
|
||||||
|
TreesRight tr = new TreesRight();
|
||||||
|
tr.IdGroup = tree_rights.FirstOrDefault().IdGroup;
|
||||||
|
tr.IdTree = t.Id;
|
||||||
|
context.TreesRights.Add(tr);
|
||||||
|
context.SaveChanges();
|
||||||
|
return Ok();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return Unauthorized();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public IActionResult RenameTree(int Id, string Text)
|
||||||
|
{
|
||||||
|
var userId = int.Parse(User.Claims.Where(c => c.Type == "Id").FirstOrDefault().Value);
|
||||||
|
using (var context = new EpioneContext(_configuration))
|
||||||
|
{
|
||||||
|
var user_rights = context.UsersRights.Where(u => u.IdUser == userId).ToList();
|
||||||
|
var tree = context.Trees.Where(x => x.Id == Id).FirstOrDefault();
|
||||||
|
var tree_rights = context.TreesRights.Where(x => x.IdTree == tree.Id).ToList();
|
||||||
|
var ok = false;
|
||||||
|
foreach (var tr in tree_rights)
|
||||||
|
{
|
||||||
|
if (userId == 1 || user_rights.Where(u => u.IdGroup == tr.IdGroup).Count() > 0) ok = true;
|
||||||
|
}
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
var t = context.Trees.Where(t => t.Id == Id).FirstOrDefault();
|
||||||
|
t.Text = Text;
|
||||||
|
context.SaveChanges();
|
||||||
|
return Ok();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return Unauthorized();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public IActionResult DeleteTree(int Id)
|
||||||
|
{
|
||||||
|
var userId = int.Parse(User.Claims.Where(c => c.Type == "Id").FirstOrDefault().Value);
|
||||||
|
using (var context = new EpioneContext(_configuration))
|
||||||
|
{
|
||||||
|
var user_rights = context.UsersRights.Where(u => u.IdUser == userId).ToList();
|
||||||
|
var tree = context.Trees.Where(x => x.Id == Id).FirstOrDefault();
|
||||||
|
var tree_rights = context.TreesRights.Where(x => x.IdTree == tree.Id).ToList();
|
||||||
|
var ok = false;
|
||||||
|
foreach (var tr in tree_rights)
|
||||||
|
{
|
||||||
|
if (userId == 1 || user_rights.Where(u => u.IdGroup == tr.IdGroup).Count() > 0) ok = true;
|
||||||
|
}
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
var t = context.Trees.Where(t => t.Id == Id).FirstOrDefault();
|
||||||
|
context.Remove(t);
|
||||||
|
context.SaveChanges();
|
||||||
|
return Ok();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return Unauthorized();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public IActionResult RenameDocument(int Id, string Name)
|
||||||
|
{
|
||||||
|
var userId = int.Parse(User.Claims.Where(c => c.Type == "Id").FirstOrDefault().Value);
|
||||||
|
using (var context = new EpioneContext(_configuration))
|
||||||
|
{
|
||||||
|
var user_rights = context.UsersRights.Where(u => u.IdUser == userId).ToList();
|
||||||
|
var t = context.Documents.Where(d => d.Id == Id).FirstOrDefault();
|
||||||
|
var tree = context.Trees.Where(x => x.Id == t.TreeId).FirstOrDefault();
|
||||||
|
var tree_rights = context.TreesRights.Where(x => x.IdTree == tree.Id).ToList();
|
||||||
|
var ok = false;
|
||||||
|
foreach (var tr in tree_rights)
|
||||||
|
{
|
||||||
|
if (userId == 1 || user_rights.Where(u => u.IdGroup == tr.IdGroup).Count() > 0) ok = true;
|
||||||
|
}
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
var d = context.Documents.Where(d => d.Id == Id).FirstOrDefault();
|
||||||
|
d.Name = Name;
|
||||||
|
context.SaveChanges();
|
||||||
|
return Ok();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return Unauthorized();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public IActionResult DeleteDocument(int Id)
|
||||||
|
{
|
||||||
|
var userId = int.Parse(User.Claims.Where(c => c.Type == "Id").FirstOrDefault().Value);
|
||||||
|
using (var context = new EpioneContext(_configuration))
|
||||||
|
{
|
||||||
|
var user_rights = context.UsersRights.Where(u => u.IdUser == userId).ToList();
|
||||||
|
var t = context.Documents.Where(d => d.Id == Id).FirstOrDefault();
|
||||||
|
var tree = context.Trees.Where(x => x.Id == t.TreeId).FirstOrDefault();
|
||||||
|
var tree_rights = context.TreesRights.Where(x => x.IdTree == tree.Id).ToList();
|
||||||
|
var ok = false;
|
||||||
|
foreach (var tr in tree_rights)
|
||||||
|
{
|
||||||
|
if (userId == 1 || user_rights.Where(u => u.IdGroup == tr.IdGroup).Count() > 0) ok = true;
|
||||||
|
}
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
var d = context.Documents.Where(d => d.Id == Id).FirstOrDefault();
|
||||||
|
context.Remove(d);
|
||||||
|
context.Logs.Add(new Log { CreateDateTime = DateTime.Now, Method = MethodBase.GetCurrentMethod().Name, Value = "UserId: " + User.Claims.Where(c => c.Type == "Id").FirstOrDefault().Value + "; IP: " + GetIpAddressOfClient() + "; DocId: " + Id.ToString() });
|
||||||
|
context.SaveChanges();
|
||||||
|
return Ok();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return Unauthorized();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public IActionResult PutDocument([FromBody]Document document)
|
||||||
|
{
|
||||||
|
var userId = int.Parse(User.Claims.Where(c => c.Type == "Id").FirstOrDefault().Value);
|
||||||
|
var accessToken = HttpContext.Request.Headers["Authorization"];
|
||||||
|
using (var context = new EpioneContext(_configuration))
|
||||||
|
{
|
||||||
|
var user_rights = context.UsersRights.Where(u => u.IdUser == userId).ToList();
|
||||||
|
var tree = context.Trees.Where(x => x.Id == document.TreeId).FirstOrDefault();
|
||||||
|
var tree_rights = context.TreesRights.Where(x => x.IdTree == tree.Id).ToList();
|
||||||
|
var ok = false;
|
||||||
|
foreach (var tr in tree_rights)
|
||||||
|
{
|
||||||
|
if (userId == 1 || user_rights.Where(u => u.IdGroup == tr.IdGroup).Count() > 0) ok = true;
|
||||||
|
}
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
Document d = new Document();
|
||||||
|
d.TreeId = document.TreeId;
|
||||||
|
d.Name = document.Name;
|
||||||
|
d.Image = document.Image;
|
||||||
|
d.CreateDateTime = DateTime.Now;
|
||||||
|
d.UserId = userId;
|
||||||
|
d = context.Documents.Add(d).Entity;
|
||||||
|
context.SaveChanges();
|
||||||
|
context.Logs.Add(new Log { CreateDateTime = DateTime.Now, Method = MethodBase.GetCurrentMethod().Name, Value = "UserId: " + User.Claims.Where(c => c.Type == "Id").FirstOrDefault().Value + "; IP: " + GetIpAddressOfClient() + "; DocId: " + d.Id.ToString() });
|
||||||
|
context.SaveChanges();
|
||||||
|
return Ok(d);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return Unauthorized();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
157
FabitArchiwum/Controllers/AuthenticateController.cs
Normal file
157
FabitArchiwum/Controllers/AuthenticateController.cs
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
using FabitArchiwum.Model;
|
||||||
|
using Microsoft.AspNetCore.Identity;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.IdentityModel.Tokens;
|
||||||
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
|
using System.Data;
|
||||||
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Security.Claims;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Controllers
|
||||||
|
{
|
||||||
|
[Route("api/[controller]/[action]")]
|
||||||
|
[ApiController]
|
||||||
|
public class AuthenticateController : ControllerBase
|
||||||
|
{
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
|
||||||
|
public AuthenticateController(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetIpAddressOfClient()
|
||||||
|
{
|
||||||
|
string ipAddress = string.Empty;
|
||||||
|
IPAddress ip = Request.HttpContext.Connection.RemoteIpAddress;
|
||||||
|
if (ip!=null)
|
||||||
|
{
|
||||||
|
if (ip.AddressFamily == AddressFamily.InterNetworkV6)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ip = Dns.GetHostEntry(ip).AddressList.First(x => x.AddressFamily == AddressFamily.InterNetwork);
|
||||||
|
} catch (Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ipAddress = ip.ToString();
|
||||||
|
}
|
||||||
|
return ipAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
[SwaggerResponse(200, "Token, RefreshToken, Expiration, Roles")]
|
||||||
|
public IActionResult Login([FromBody]UserModel login)
|
||||||
|
{
|
||||||
|
using (var context = new EpioneContext(_configuration))
|
||||||
|
{
|
||||||
|
var sha1 = System.Security.Cryptography.SHA1.Create();
|
||||||
|
var p = sha1.ComputeHash(Encoding.UTF8.GetBytes(login.Password));
|
||||||
|
var pwd = BitConverter.ToString(p).Replace("-", "").ToLower();
|
||||||
|
|
||||||
|
var loggedUser = context.Users.Where(u => u.Name == login.Username && u.Password == pwd).FirstOrDefault();
|
||||||
|
if (loggedUser!=null)
|
||||||
|
{
|
||||||
|
var authClaims = new List<Claim>
|
||||||
|
{
|
||||||
|
new Claim(ClaimTypes.Name, login.Username),
|
||||||
|
new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
|
||||||
|
new Claim("Id", loggedUser.Id.ToString()),
|
||||||
|
new Claim(ClaimTypes.Role, "User")
|
||||||
|
};
|
||||||
|
var token = CreateToken(authClaims);
|
||||||
|
var refreshToken = GenerateRefreshToken();
|
||||||
|
context.Logs.Add(new Log { CreateDateTime = DateTime.Now, Method = MethodBase.GetCurrentMethod().Name, Value = "UserId: "+loggedUser.Id+"; IP: " + GetIpAddressOfClient() });
|
||||||
|
context.SaveChanges();
|
||||||
|
return Ok(new
|
||||||
|
{
|
||||||
|
Token = new JwtSecurityTokenHandler().WriteToken(token),
|
||||||
|
RefreshToken = refreshToken,
|
||||||
|
Expiration = token.ValidTo
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return Unauthorized();
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public IActionResult RefreshToken([FromBody]TokenModel tokenModel)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(tokenModel.Token) || string.IsNullOrEmpty(tokenModel.RefreshToken))
|
||||||
|
{
|
||||||
|
return BadRequest("Invalid client request");
|
||||||
|
}
|
||||||
|
|
||||||
|
var authClaims = new List<Claim>
|
||||||
|
{
|
||||||
|
new Claim(ClaimTypes.Name, GetPrincipalFromExpiredToken(tokenModel.Token).Identity.Name),
|
||||||
|
new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
|
||||||
|
new Claim("Id", GetPrincipalFromExpiredToken(tokenModel.Token).Claims.Where(c=>c.Type=="Id").FirstOrDefault().Value)
|
||||||
|
};
|
||||||
|
|
||||||
|
var newAccessToken = CreateToken(authClaims);
|
||||||
|
var newRefreshToken = GenerateRefreshToken();
|
||||||
|
|
||||||
|
return new ObjectResult(new
|
||||||
|
{
|
||||||
|
Token = new JwtSecurityTokenHandler().WriteToken(newAccessToken),
|
||||||
|
RefreshToken = newRefreshToken,
|
||||||
|
Expiration = newAccessToken.ValidTo
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private JwtSecurityToken CreateToken(List<Claim> authClaims)
|
||||||
|
{
|
||||||
|
var authSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_configuration["JWT:Key"]));
|
||||||
|
_ = int.TryParse(_configuration["JWT:TokenValidityInMinutes"], out int tokenValidityInMinutes);
|
||||||
|
|
||||||
|
var token = new JwtSecurityToken(
|
||||||
|
issuer: _configuration["JWT:Issuer"],
|
||||||
|
audience: _configuration["JWT:Audience"],
|
||||||
|
expires: DateTime.Now.AddMinutes(tokenValidityInMinutes),
|
||||||
|
claims: authClaims,
|
||||||
|
signingCredentials: new SigningCredentials(authSigningKey, SecurityAlgorithms.HmacSha256)
|
||||||
|
);
|
||||||
|
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string GenerateRefreshToken()
|
||||||
|
{
|
||||||
|
var randomNumber = new byte[64];
|
||||||
|
using var rng = RandomNumberGenerator.Create();
|
||||||
|
rng.GetBytes(randomNumber);
|
||||||
|
return Convert.ToBase64String(randomNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ClaimsPrincipal? GetPrincipalFromExpiredToken(string? token)
|
||||||
|
{
|
||||||
|
var tokenValidationParameters = new TokenValidationParameters
|
||||||
|
{
|
||||||
|
ValidateAudience = false,
|
||||||
|
ValidateIssuer = false,
|
||||||
|
ValidateIssuerSigningKey = true,
|
||||||
|
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_configuration["JWT:Key"])),
|
||||||
|
ValidateLifetime = false
|
||||||
|
};
|
||||||
|
|
||||||
|
var tokenHandler = new JwtSecurityTokenHandler();
|
||||||
|
var principal = tokenHandler.ValidateToken(token, tokenValidationParameters, out SecurityToken securityToken);
|
||||||
|
if (securityToken is not JwtSecurityToken jwtSecurityToken || !jwtSecurityToken.Header.Alg.Equals(SecurityAlgorithms.HmacSha256, StringComparison.InvariantCultureIgnoreCase))
|
||||||
|
throw new SecurityTokenException("Invalid token");
|
||||||
|
return principal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
26
FabitArchiwum/Dockerfile
Normal file
26
FabitArchiwum/Dockerfile
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0.12-bookworm-slim-arm64v8 AS base
|
||||||
|
#FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
|
||||||
|
WORKDIR /app
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
||||||
|
WORKDIR /src
|
||||||
|
COPY ["FabitArchiwum/FabitArchiwum.csproj", "FabitArchiwum/"]
|
||||||
|
RUN dotnet restore "FabitArchiwum/FabitArchiwum.csproj"
|
||||||
|
COPY . .
|
||||||
|
WORKDIR "/src/FabitArchiwum"
|
||||||
|
RUN dotnet build "FabitArchiwum.csproj" -c Release -o /app/build
|
||||||
|
|
||||||
|
FROM build AS publish
|
||||||
|
RUN dotnet publish "FabitArchiwum.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||||
|
|
||||||
|
FROM base AS final
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=publish /app/publish .
|
||||||
|
ENTRYPOINT ["dotnet", "FabitArchiwum.dll"]
|
||||||
|
ARG ASPNETCORE_Kestrel__Certificates__Default__Path=aspnetapp.pfx
|
||||||
|
ARG ASPNETCORE_Kestrel__Certificates__Default__Password=password
|
||||||
|
ARG ASPNETCORE_HTTPS_PORT=5555
|
||||||
|
ARG ASPNETCORE_URLS=https://+:443
|
||||||
31
FabitArchiwum/FabitArchiwum.csproj
Normal file
31
FabitArchiwum/FabitArchiwum.csproj
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<UserSecretsId>c6d83268-6ea1-44fd-b9d9-153bf3318f8f</UserSecretsId>
|
||||||
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.12" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.12" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.12">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.4" />
|
||||||
|
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
|
||||||
|
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Design" Version="1.1.2" />
|
||||||
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||||
|
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.5.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Update="aspnetapp.pfx">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
19
FabitArchiwum/Model/Document.cs
Normal file
19
FabitArchiwum/Model/Document.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Model;
|
||||||
|
|
||||||
|
public partial class Document
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public int TreeId { get; set; }
|
||||||
|
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
public byte[]? Image { get; set; }
|
||||||
|
|
||||||
|
public DateTime? CreateDateTime { get; set; }
|
||||||
|
|
||||||
|
public int UserId { get; set; }
|
||||||
|
}
|
||||||
142
FabitArchiwum/Model/EpioneContext.cs
Normal file
142
FabitArchiwum/Model/EpioneContext.cs
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Model;
|
||||||
|
|
||||||
|
public partial class EpioneContext : DbContext
|
||||||
|
{
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
|
||||||
|
public EpioneContext(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EpioneContext(DbContextOptions<EpioneContext> options)
|
||||||
|
: base(options)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual DbSet<Document> Documents { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<Group> Groups { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<Log> Logs { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<Tree> Trees { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<TreesRight> TreesRights { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<User> Users { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<UsersRight> UsersRights { get; set; }
|
||||||
|
|
||||||
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) => optionsBuilder
|
||||||
|
.UseMySql(_configuration["DB:ConnectionString"],
|
||||||
|
Microsoft.EntityFrameworkCore.ServerVersion.Parse("10.5.8-mariadb"));
|
||||||
|
|
||||||
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
modelBuilder
|
||||||
|
.UseCollation("latin1_swedish_ci")
|
||||||
|
.HasCharSet("latin1");
|
||||||
|
|
||||||
|
modelBuilder.Entity<Document>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
||||||
|
|
||||||
|
entity.ToTable("documents");
|
||||||
|
|
||||||
|
entity.Property(e => e.Id).HasColumnType("int(11)");
|
||||||
|
entity.Property(e => e.CreateDateTime).HasColumnType("datetime");
|
||||||
|
entity.Property(e => e.Name)
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.UseCollation("utf8_general_ci")
|
||||||
|
.HasCharSet("utf8");
|
||||||
|
entity.Property(e => e.TreeId).HasColumnType("int(11)");
|
||||||
|
entity.Property(e => e.UserId).HasColumnType("int(11)");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<Group>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
||||||
|
|
||||||
|
entity.ToTable("groups");
|
||||||
|
|
||||||
|
entity.Property(e => e.Id).HasColumnType("int(11)");
|
||||||
|
entity.Property(e => e.Name).HasColumnType("text");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<Log>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
||||||
|
|
||||||
|
entity.ToTable("logs");
|
||||||
|
|
||||||
|
entity.Property(e => e.Id).HasColumnType("int(11)");
|
||||||
|
entity.Property(e => e.CreateDateTime).HasColumnType("datetime");
|
||||||
|
entity.Property(e => e.Method).HasMaxLength(50);
|
||||||
|
entity.Property(e => e.Value).HasColumnType("text");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<Tree>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
||||||
|
|
||||||
|
entity.ToTable("trees");
|
||||||
|
|
||||||
|
entity.Property(e => e.Id).HasColumnType("int(11)");
|
||||||
|
entity.Property(e => e.CreateDateTime).HasColumnType("datetime");
|
||||||
|
entity.Property(e => e.ParentId).HasColumnType("int(11)");
|
||||||
|
entity.Property(e => e.Text)
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.UseCollation("utf8_general_ci")
|
||||||
|
.HasCharSet("utf8");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<TreesRight>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
||||||
|
|
||||||
|
entity.ToTable("trees_rights");
|
||||||
|
|
||||||
|
entity.Property(e => e.Id).HasColumnType("int(11)");
|
||||||
|
entity.Property(e => e.IdGroup)
|
||||||
|
.HasColumnType("int(11)")
|
||||||
|
.HasColumnName("Id_Group");
|
||||||
|
entity.Property(e => e.IdTree)
|
||||||
|
.HasColumnType("int(11)")
|
||||||
|
.HasColumnName("Id_Tree");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<User>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
||||||
|
|
||||||
|
entity.ToTable("users");
|
||||||
|
|
||||||
|
entity.Property(e => e.Id).HasColumnType("int(11)");
|
||||||
|
entity.Property(e => e.Name).HasMaxLength(50);
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<UsersRight>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
||||||
|
|
||||||
|
entity.ToTable("users_rights");
|
||||||
|
|
||||||
|
entity.Property(e => e.Id).HasColumnType("int(11)");
|
||||||
|
entity.Property(e => e.IdGroup)
|
||||||
|
.HasColumnType("int(11)")
|
||||||
|
.HasColumnName("Id_Group");
|
||||||
|
entity.Property(e => e.IdUser)
|
||||||
|
.HasColumnType("int(11)")
|
||||||
|
.HasColumnName("Id_User");
|
||||||
|
});
|
||||||
|
|
||||||
|
OnModelCreatingPartial(modelBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
|
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||||
|
}
|
||||||
82
FabitArchiwum/Model/EpioneContextOLD.cs
Normal file
82
FabitArchiwum/Model/EpioneContextOLD.cs
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Model;
|
||||||
|
|
||||||
|
public partial class EpioneContextOLD : DbContext
|
||||||
|
{
|
||||||
|
private readonly IConfiguration _configuration;
|
||||||
|
|
||||||
|
public EpioneContextOLD(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EpioneContextOLD(DbContextOptions<EpioneContext> options)
|
||||||
|
: base(options)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual DbSet<Document> Documents { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<Tree> Trees { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<User> Users { get; set; }
|
||||||
|
|
||||||
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) => optionsBuilder
|
||||||
|
.UseMySql(_configuration["DB:ConnectionString"],
|
||||||
|
Microsoft.EntityFrameworkCore.ServerVersion.Parse("10.5.8-mariadb"));
|
||||||
|
|
||||||
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
modelBuilder
|
||||||
|
.UseCollation("latin1_swedish_ci")
|
||||||
|
.HasCharSet("latin1");
|
||||||
|
|
||||||
|
modelBuilder.Entity<Document>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
||||||
|
|
||||||
|
entity.ToTable("document");
|
||||||
|
|
||||||
|
entity.Property(e => e.Id).HasColumnType("int(11)");
|
||||||
|
entity.Property(e => e.CreateDateTime).HasColumnType("datetime");
|
||||||
|
entity.Property(e => e.Name)
|
||||||
|
.HasMaxLength(200)
|
||||||
|
.UseCollation("utf8_general_ci")
|
||||||
|
.HasCharSet("utf8");
|
||||||
|
entity.Property(e => e.TreeId).HasColumnType("int(11)");
|
||||||
|
entity.Property(e => e.UserId).HasColumnType("int(11)");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<Tree>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
||||||
|
|
||||||
|
entity.ToTable("tree");
|
||||||
|
|
||||||
|
entity.Property(e => e.Id).HasColumnType("int(11)");
|
||||||
|
entity.Property(e => e.CreateDateTime).HasColumnType("datetime");
|
||||||
|
entity.Property(e => e.ParentId).HasColumnType("int(11)");
|
||||||
|
entity.Property(e => e.Text)
|
||||||
|
.HasMaxLength(100)
|
||||||
|
.UseCollation("utf8_general_ci")
|
||||||
|
.HasCharSet("utf8");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<User>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasKey(e => e.Id).HasName("PRIMARY");
|
||||||
|
|
||||||
|
entity.ToTable("user");
|
||||||
|
|
||||||
|
entity.Property(e => e.Id).HasColumnType("int(11)");
|
||||||
|
entity.Property(e => e.Name).HasMaxLength(50);
|
||||||
|
});
|
||||||
|
|
||||||
|
OnModelCreatingPartial(modelBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
|
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||||
|
}
|
||||||
11
FabitArchiwum/Model/Group.cs
Normal file
11
FabitArchiwum/Model/Group.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Model;
|
||||||
|
|
||||||
|
public partial class Group
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public string Name { get; set; } = null!;
|
||||||
|
}
|
||||||
15
FabitArchiwum/Model/Log.cs
Normal file
15
FabitArchiwum/Model/Log.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Model;
|
||||||
|
|
||||||
|
public partial class Log
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public DateTime CreateDateTime { get; set; }
|
||||||
|
|
||||||
|
public string Method { get; set; } = null!;
|
||||||
|
|
||||||
|
public string Value { get; set; } = null!;
|
||||||
|
}
|
||||||
13
FabitArchiwum/Model/Right.cs
Normal file
13
FabitArchiwum/Model/Right.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Model;
|
||||||
|
|
||||||
|
public partial class Right
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public int IdGroup { get; set; }
|
||||||
|
|
||||||
|
public int IdUser { get; set; }
|
||||||
|
}
|
||||||
9
FabitArchiwum/Model/TokenModel.cs
Normal file
9
FabitArchiwum/Model/TokenModel.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
namespace FabitArchiwum.Model
|
||||||
|
{
|
||||||
|
public class TokenModel
|
||||||
|
{
|
||||||
|
public string Token { get; set; }
|
||||||
|
public string RefreshToken { get; set; }
|
||||||
|
public DateTime? Expiration { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
15
FabitArchiwum/Model/Tree.cs
Normal file
15
FabitArchiwum/Model/Tree.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Model;
|
||||||
|
|
||||||
|
public partial class Tree
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public string? Text { get; set; }
|
||||||
|
|
||||||
|
public int? ParentId { get; set; }
|
||||||
|
|
||||||
|
public DateTime? CreateDateTime { get; set; }
|
||||||
|
}
|
||||||
13
FabitArchiwum/Model/TreesRight.cs
Normal file
13
FabitArchiwum/Model/TreesRight.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Model;
|
||||||
|
|
||||||
|
public partial class TreesRight
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public int IdGroup { get; set; }
|
||||||
|
|
||||||
|
public int IdTree { get; set; }
|
||||||
|
}
|
||||||
13
FabitArchiwum/Model/User.cs
Normal file
13
FabitArchiwum/Model/User.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Model;
|
||||||
|
|
||||||
|
public partial class User
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public string Name { get; set; } = null!;
|
||||||
|
|
||||||
|
public string Password { get; set; } = null!;
|
||||||
|
}
|
||||||
8
FabitArchiwum/Model/UserModel.cs
Normal file
8
FabitArchiwum/Model/UserModel.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace FabitArchiwum.Model
|
||||||
|
{
|
||||||
|
public class UserModel
|
||||||
|
{
|
||||||
|
public string Username { get; set; }
|
||||||
|
public string Password { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
13
FabitArchiwum/Model/UsersRight.cs
Normal file
13
FabitArchiwum/Model/UsersRight.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Model;
|
||||||
|
|
||||||
|
public partial class UsersRight
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public int IdGroup { get; set; }
|
||||||
|
|
||||||
|
public int IdUser { get; set; }
|
||||||
|
}
|
||||||
67
FabitArchiwum/Program.cs
Normal file
67
FabitArchiwum/Program.cs
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
using FabitArchiwum.Model;
|
||||||
|
using FabitArchiwum.Swagger;
|
||||||
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.IdentityModel.Tokens;
|
||||||
|
using Microsoft.OpenApi.Models;
|
||||||
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
|
using System.Security.Claims;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
builder.Services.AddAuthentication(options =>
|
||||||
|
{
|
||||||
|
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||||
|
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||||
|
options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||||
|
}).AddJwtBearer(o =>
|
||||||
|
{
|
||||||
|
o.TokenValidationParameters = new TokenValidationParameters
|
||||||
|
{
|
||||||
|
ValidIssuer = builder.Configuration["Jwt:Issuer"],
|
||||||
|
ValidAudience = builder.Configuration["Jwt:Audience"],
|
||||||
|
IssuerSigningKey = new SymmetricSecurityKey
|
||||||
|
(Encoding.UTF8.GetBytes(builder.Configuration["Jwt:Key"])),
|
||||||
|
ValidateIssuer = true,
|
||||||
|
ValidateAudience = true,
|
||||||
|
ValidateLifetime = true,
|
||||||
|
ValidateIssuerSigningKey = true,
|
||||||
|
ClockSkew = TimeSpan.FromSeconds(5)
|
||||||
|
};
|
||||||
|
});
|
||||||
|
builder.Services.AddAuthorization();
|
||||||
|
|
||||||
|
builder.Services.AddControllers().AddJsonOptions(options =>
|
||||||
|
{
|
||||||
|
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.Services.AddControllers();
|
||||||
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||||
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
|
builder.Services.AddSwaggerGen(c =>
|
||||||
|
{
|
||||||
|
// c.SwaggerDoc("v1", new OpenApiInfo { Version="v1", Title="FabitArchiwum", Description="asdfasdf"});
|
||||||
|
c.EnableAnnotations();
|
||||||
|
c.AddSecurityDefinition("Bearer", OpenApiSecuritySwagger.SecurityScheme());
|
||||||
|
c.AddSecurityRequirement(OpenApiSecuritySwagger.SecurityRequirement());
|
||||||
|
c.OperationFilter<OperationFilterSwagger>();
|
||||||
|
c.ParameterFilter<ParameterFilterSwagger>();
|
||||||
|
});
|
||||||
|
|
||||||
|
var app = builder.Build();
|
||||||
|
app.UseHttpsRedirection();
|
||||||
|
app.UseSwagger();
|
||||||
|
app.UseSwaggerUI(options =>
|
||||||
|
{
|
||||||
|
options.SwaggerEndpoint("/swagger/v1/swagger.json", "FabitArchiwum v1.0.1");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
app.UseAuthentication();
|
||||||
|
app.UseAuthorization();
|
||||||
|
app.UseHttpsRedirection();
|
||||||
|
app.MapControllers();
|
||||||
|
|
||||||
|
app.Run();
|
||||||
51
FabitArchiwum/Properties/launchSettings.json
Normal file
51
FabitArchiwum/Properties/launchSettings.json
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
"profiles": {
|
||||||
|
"http": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "swagger",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
},
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"applicationUrl": "http://localhost:5068"
|
||||||
|
},
|
||||||
|
"https": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "swagger",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
},
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"applicationUrl": "https://localhost:7110;http://localhost:5068"
|
||||||
|
},
|
||||||
|
"IIS Express": {
|
||||||
|
"commandName": "IISExpress",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "swagger",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Docker": {
|
||||||
|
"commandName": "Docker",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_URLS": "https://+:443;http://+:80"
|
||||||
|
},
|
||||||
|
"publishAllPorts": true,
|
||||||
|
"useSSL": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||||
|
"iisSettings": {
|
||||||
|
"windowsAuthentication": false,
|
||||||
|
"anonymousAuthentication": true,
|
||||||
|
"iisExpress": {
|
||||||
|
"applicationUrl": "http://localhost:39320",
|
||||||
|
"sslPort": 44309
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
FabitArchiwum/ReadMe.txt
Normal file
19
FabitArchiwum/ReadMe.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
dotnet ef dbcontext scaffold "Server=192.168.0.99;User=epione;Password=??????;Database=epione" "Pomelo.EntityFrameworkCore.MySql" -o Model -t user -t document -t tree
|
||||||
|
dotnet ef dbcontext scaffold "Server=192.168.0.120;User=epione;Password=epioneepione;Database=epione" "Pomelo.EntityFrameworkCore.MySql" -o Model -t user -t document -t tree -t logs -f
|
||||||
|
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
fabitarchiwum:
|
||||||
|
image: krffam/fabitarchiwum:latest
|
||||||
|
# stdin_open: true
|
||||||
|
# tty: true
|
||||||
|
ports:
|
||||||
|
- 5555:443
|
||||||
|
environment:
|
||||||
|
- ASPNETCORE_Kestrel__Certificates__Default__Path=aspnetapp.pfx
|
||||||
|
- ASPNETCORE_Kestrel__Certificates__Default__Password=epioneepione
|
||||||
|
- ASPNETCORE_HTTPS_PORT=5555
|
||||||
|
- ASPNETCORE_URLS=https://+:443
|
||||||
|
extra_hosts:
|
||||||
|
- "host.docker.internal:host-gateway"
|
||||||
37
FabitArchiwum/Swagger/OpenApiSecuritySwagger.cs
Normal file
37
FabitArchiwum/Swagger/OpenApiSecuritySwagger.cs
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
using Microsoft.OpenApi.Models;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Swagger
|
||||||
|
{
|
||||||
|
public class OpenApiSecuritySwagger
|
||||||
|
{
|
||||||
|
public static OpenApiSecurityScheme SecurityScheme()
|
||||||
|
{
|
||||||
|
return new OpenApiSecurityScheme
|
||||||
|
{
|
||||||
|
Description = "e.g. Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJS...",
|
||||||
|
Name = "Authorization",
|
||||||
|
In = ParameterLocation.Header,
|
||||||
|
Type = SecuritySchemeType.ApiKey,
|
||||||
|
Scheme = "Bearer"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static OpenApiSecurityRequirement SecurityRequirement()
|
||||||
|
{
|
||||||
|
return new OpenApiSecurityRequirement
|
||||||
|
{
|
||||||
|
{
|
||||||
|
new OpenApiSecurityScheme
|
||||||
|
{
|
||||||
|
Reference = new OpenApiReference
|
||||||
|
{
|
||||||
|
Type = ReferenceType.SecurityScheme,
|
||||||
|
Id = "Bearer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Array.Empty<string>()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
20
FabitArchiwum/Swagger/OperationFilterSwagger.cs
Normal file
20
FabitArchiwum/Swagger/OperationFilterSwagger.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
using Microsoft.OpenApi.Models;
|
||||||
|
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Swagger
|
||||||
|
{
|
||||||
|
public class OperationFilterSwagger : IOperationFilter
|
||||||
|
{
|
||||||
|
public void Apply(OpenApiOperation operation, OperationFilterContext context)
|
||||||
|
{
|
||||||
|
operation.Parameters = operation.Parameters.Where(v =>
|
||||||
|
v.Name != "Groups" &&
|
||||||
|
v.Name != "Aggregates" &&
|
||||||
|
v.Name != "GroupPaging" &&
|
||||||
|
v.Name != "IncludeSubGroupCount" &&
|
||||||
|
v.Name != "Skip" &&
|
||||||
|
v.Name != "Take"
|
||||||
|
).ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
59
FabitArchiwum/Swagger/ParameterFilterSwagger.cs
Normal file
59
FabitArchiwum/Swagger/ParameterFilterSwagger.cs
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
using Microsoft.OpenApi.Models;
|
||||||
|
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||||
|
|
||||||
|
namespace FabitArchiwum.Swagger
|
||||||
|
{
|
||||||
|
public class ParameterFilterSwagger : IParameterFilter
|
||||||
|
{
|
||||||
|
public void Apply(OpenApiParameter parameter, ParameterFilterContext context)
|
||||||
|
{
|
||||||
|
switch (parameter.Name)
|
||||||
|
{
|
||||||
|
case "Filters":
|
||||||
|
parameter.Name = "Filter";
|
||||||
|
parameter.Schema.Type = "string";
|
||||||
|
parameter.Examples = new Dictionary<string, OpenApiExample>
|
||||||
|
{
|
||||||
|
{
|
||||||
|
"One column",
|
||||||
|
new OpenApiExample()
|
||||||
|
{
|
||||||
|
Description = "" +
|
||||||
|
"[column]~[operator]~[value]" +
|
||||||
|
"<br /><br />" +
|
||||||
|
"e.g. name~contains~'test'"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Many columns",
|
||||||
|
new OpenApiExample()
|
||||||
|
{
|
||||||
|
Description = "" +
|
||||||
|
"([column1]~[operator1]~[value1]~[logic]~[column2]~[operator2]~[value2]~...)" +
|
||||||
|
"<br /><br />" +
|
||||||
|
"e.g. (name1~contains~'test1'~and~name2~contains~'test2')"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
case "Sorts":
|
||||||
|
parameter.Name = "Sort";
|
||||||
|
parameter.Schema.Type = "string";
|
||||||
|
parameter.Examples = new Dictionary<string, OpenApiExample>
|
||||||
|
{
|
||||||
|
{
|
||||||
|
"One column",
|
||||||
|
new OpenApiExample()
|
||||||
|
{
|
||||||
|
Description = "" +
|
||||||
|
"[column]-[direction]" +
|
||||||
|
"<br /><br />" +
|
||||||
|
"e.g. name-asc"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
FabitArchiwum/appsettings.Development.json
Normal file
8
FabitArchiwum/appsettings.Development.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
20
FabitArchiwum/appsettings.json
Normal file
20
FabitArchiwum/appsettings.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Jwt": {
|
||||||
|
"Issuer": "https://joydipkanjilal.com/",
|
||||||
|
"Audience": "https://joydipkanjilal.com/",
|
||||||
|
"Key": "This is a sample secret key - please don't use in production environment.'",
|
||||||
|
"TokenValidityInMinutes": 10,
|
||||||
|
"RefreshTokenValidityInDays": 7
|
||||||
|
},
|
||||||
|
"DB": {
|
||||||
|
"ConnectionString": "server=host.docker.internal;user=epione;password=epioneepione;database=epione"
|
||||||
|
//"ConnectionString": "server=192.168.1.3;user=epione;password=epioneepione;database=epione"
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*"
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user