Browse Source

Projektdateien hinzufügen.

Sebastian Drüen 1 year ago
parent
commit
8c0961eb2f
100 changed files with 21274 additions and 0 deletions
  1. 68
    0
      GVO Lager alt.sln
  2. 14
    0
      LagerVerwaltung/App.config
  3. 402
    0
      LagerVerwaltung/Articles/ArticlesOverview.Designer.cs
  4. 236
    0
      LagerVerwaltung/Articles/ArticlesOverview.cs
  5. 150
    0
      LagerVerwaltung/Articles/ArticlesOverview.resx
  6. 84
    0
      LagerVerwaltung/Articles/BLL/ArticleToBranchesBLL.cs
  7. 267
    0
      LagerVerwaltung/Articles/BLL/ArticlesBLL.cs
  8. 163
    0
      LagerVerwaltung/Articles/BLL/ArticlesInventoryBLL.cs
  9. 61
    0
      LagerVerwaltung/Articles/BO/ArticleToBranchesBO.cs
  10. 139
    0
      LagerVerwaltung/Articles/BO/ArticlesBO.cs
  11. 48
    0
      LagerVerwaltung/Articles/BO/ArticlesInventoryBO.cs
  12. 132
    0
      LagerVerwaltung/Articles/DAL/ArticleToBranchesDAL.cs
  13. 425
    0
      LagerVerwaltung/Articles/DAL/ArticlesDAL.cs
  14. 190
    0
      LagerVerwaltung/Articles/DAL/ArticlesInventoryDAL.cs
  15. 274
    0
      LagerVerwaltung/Articles/EditArticle.Designer.cs
  16. 309
    0
      LagerVerwaltung/Articles/EditArticle.cs
  17. 144
    0
      LagerVerwaltung/Articles/EditArticle.resx
  18. 203
    0
      LagerVerwaltung/Branches/BLL/BranchesBLL.cs
  19. 131
    0
      LagerVerwaltung/Branches/BO/BranchesBO.cs
  20. 288
    0
      LagerVerwaltung/Branches/BranchesOverview.Designer.cs
  21. 336
    0
      LagerVerwaltung/Branches/BranchesOverview.cs
  22. 123
    0
      LagerVerwaltung/Branches/BranchesOverview.resx
  23. 265
    0
      LagerVerwaltung/Branches/DAL/BranchesDAL.cs
  24. 92
    0
      LagerVerwaltung/ChangeBranch.Designer.cs
  25. 109
    0
      LagerVerwaltung/ChangeBranch.cs
  26. 120
    0
      LagerVerwaltung/ChangeBranch.resx
  27. 18
    0
      LagerVerwaltung/CheckException.cs
  28. 532
    0
      LagerVerwaltung/ClassDiagram1.cd
  29. 118
    0
      LagerVerwaltung/Database.cs
  30. 123
    0
      LagerVerwaltung/ExceptionHandler.Designer.cs
  31. 110
    0
      LagerVerwaltung/ExceptionHandler.cs
  32. 127
    0
      LagerVerwaltung/ExceptionHandler.resx
  33. 76
    0
      LagerVerwaltung/FormLog.Designer.cs
  34. 141
    0
      LagerVerwaltung/FormLog.cs
  35. 123
    0
      LagerVerwaltung/FormLog.resx
  36. 11
    0
      LagerVerwaltung/Func.cs
  37. 38
    0
      LagerVerwaltung/Globals.cs
  38. 301
    0
      LagerVerwaltung/Inventory/AdjustingEntry.Designer.cs
  39. 323
    0
      LagerVerwaltung/Inventory/AdjustingEntry.cs
  40. 123
    0
      LagerVerwaltung/Inventory/AdjustingEntry.resx
  41. 197
    0
      LagerVerwaltung/Inventory/AdjustingEntryAddArticle.Designer.cs
  42. 175
    0
      LagerVerwaltung/Inventory/AdjustingEntryAddArticle.cs
  43. 120
    0
      LagerVerwaltung/Inventory/AdjustingEntryAddArticle.resx
  44. 176
    0
      LagerVerwaltung/Inventory/ArticleQuantityInBranches.Designer.cs
  45. 132
    0
      LagerVerwaltung/Inventory/ArticleQuantityInBranches.cs
  46. 120
    0
      LagerVerwaltung/Inventory/ArticleQuantityInBranches.resx
  47. 186
    0
      LagerVerwaltung/Inventory/BLL/InventoryJournalBLL.cs
  48. 256
    0
      LagerVerwaltung/Inventory/BO/InventoryJournalBO.cs
  49. 333
    0
      LagerVerwaltung/Inventory/BranchExchange.Designer.cs
  50. 480
    0
      LagerVerwaltung/Inventory/BranchExchange.cs
  51. 123
    0
      LagerVerwaltung/Inventory/BranchExchange.resx
  52. 196
    0
      LagerVerwaltung/Inventory/BranchExchangeAddArticle.Designer.cs
  53. 207
    0
      LagerVerwaltung/Inventory/BranchExchangeAddArticle.cs
  54. 120
    0
      LagerVerwaltung/Inventory/BranchExchangeAddArticle.resx
  55. 354
    0
      LagerVerwaltung/Inventory/DAL/InventoryJournalDAL.cs
  56. 282
    0
      LagerVerwaltung/Inventory/InventoryInput.Designer.cs
  57. 323
    0
      LagerVerwaltung/Inventory/InventoryInput.cs
  58. 123
    0
      LagerVerwaltung/Inventory/InventoryInput.resx
  59. 221
    0
      LagerVerwaltung/Inventory/InventoryInputAddArticle.Designer.cs
  60. 168
    0
      LagerVerwaltung/Inventory/InventoryInputAddArticle.cs
  61. 120
    0
      LagerVerwaltung/Inventory/InventoryInputAddArticle.resx
  62. 575
    0
      LagerVerwaltung/Inventory/InventoryJournalOverview.Designer.cs
  63. 993
    0
      LagerVerwaltung/Inventory/InventoryJournalOverview.cs
  64. 141
    0
      LagerVerwaltung/Inventory/InventoryJournalOverview.resx
  65. 577
    0
      LagerVerwaltung/Inventory/Overview.Designer.cs.bak
  66. 763
    0
      LagerVerwaltung/Inventory/Overview.cs.bak
  67. 456
    0
      LagerVerwaltung/Inventory/SellReturn.Designer.cs
  68. 799
    0
      LagerVerwaltung/Inventory/SellReturn.cs
  69. 132
    0
      LagerVerwaltung/Inventory/SellReturn.resx
  70. 246
    0
      LagerVerwaltung/Inventory/SellReturnAddArticle.Designer.cs
  71. 191
    0
      LagerVerwaltung/Inventory/SellReturnAddArticle.cs
  72. 123
    0
      LagerVerwaltung/Inventory/SellReturnAddArticle.resx
  73. 210
    0
      LagerVerwaltung/Inventory/VerifyInventoryStock.Designer.cs
  74. 369
    0
      LagerVerwaltung/Inventory/VerifyInventoryStock.cs
  75. 158
    0
      LagerVerwaltung/Inventory/VerifyInventoryStock.resx
  76. 637
    0
      LagerVerwaltung/LagerVerwaltung.csproj
  77. 19
    0
      LagerVerwaltung/Lagerverwaltung.log4net.config
  78. 160
    0
      LagerVerwaltung/ListViewColumnSorter.cs
  79. 147
    0
      LagerVerwaltung/ListViewHelper.cs
  80. 470
    0
      LagerVerwaltung/MainForm.Designer.cs
  81. 406
    0
      LagerVerwaltung/MainForm.cs
  82. 155
    0
      LagerVerwaltung/MainForm.resx
  83. 21
    0
      LagerVerwaltung/PanelPage.cs
  84. 80
    0
      LagerVerwaltung/Parallel.cs
  85. 85
    0
      LagerVerwaltung/Personnel/BLL/PersonnelBLL.cs
  86. 71
    0
      LagerVerwaltung/Personnel/BLL/PersonnelBankDataBLL.cs
  87. 129
    0
      LagerVerwaltung/Personnel/BO/PersonnelBO.cs
  88. 59
    0
      LagerVerwaltung/Personnel/BO/PersonnelBankDataBO.cs
  89. 119
    0
      LagerVerwaltung/Personnel/DAL/PersonnelBankDataDAL.cs
  90. 227
    0
      LagerVerwaltung/Personnel/DAL/PersonnelDAL.cs
  91. 180
    0
      LagerVerwaltung/Personnel/PersonnelSearch.Designer.cs
  92. 152
    0
      LagerVerwaltung/Personnel/PersonnelSearch.cs
  93. 120
    0
      LagerVerwaltung/Personnel/PersonnelSearch.resx
  94. 84
    0
      LagerVerwaltung/PersonnelAccess/BLL/BranchesToPersonnelAccessBLL.cs
  95. 237
    0
      LagerVerwaltung/PersonnelAccess/BLL/PersonnelAccessBLL.cs
  96. 61
    0
      LagerVerwaltung/PersonnelAccess/BO/BranchesToPersonnelAccessBO.cs
  97. 100
    0
      LagerVerwaltung/PersonnelAccess/BO/PersonnelAccessBO.cs
  98. 140
    0
      LagerVerwaltung/PersonnelAccess/DAL/BranchesToPersonnelAccessDAL.cs
  99. 333
    0
      LagerVerwaltung/PersonnelAccess/DAL/PersonnelAccessDAL.cs
  100. 0
    0
      LagerVerwaltung/PersonnelAccess/PersonnelAccessOverview.Designer.cs

+ 68
- 0
GVO Lager alt.sln View File

@@ -0,0 +1,68 @@
1
+
2
+Microsoft Visual Studio Solution File, Format Version 12.00
3
+# Visual Studio Version 16
4
+VisualStudioVersion = 16.0.29806.167
5
+MinimumVisualStudioVersion = 10.0.40219.1
6
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LagerVerwaltung", "LagerVerwaltung\LagerVerwaltung.csproj", "{A5EB346F-9629-415F-B42D-D915BF80790C}"
7
+EndProject
8
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pp.Basic", "Pp.Basic\Pp.Basic.csproj", "{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}"
9
+EndProject
10
+Global
11
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
12
+		Debug|Any CPU = Debug|Any CPU
13
+		Debug|x64 = Debug|x64
14
+		Debug|x86 = Debug|x86
15
+		Documentation|Any CPU = Documentation|Any CPU
16
+		Documentation|x64 = Documentation|x64
17
+		Documentation|x86 = Documentation|x86
18
+		Release|Any CPU = Release|Any CPU
19
+		Release|x64 = Release|x64
20
+		Release|x86 = Release|x86
21
+	EndGlobalSection
22
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
23
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Debug|Any CPU.ActiveCfg = Debug|x86
24
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Debug|Any CPU.Build.0 = Debug|x86
25
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Debug|x64.ActiveCfg = Debug|x64
26
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Debug|x64.Build.0 = Debug|x64
27
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Debug|x86.ActiveCfg = Debug|x86
28
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Debug|x86.Build.0 = Debug|x86
29
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
30
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Documentation|Any CPU.Build.0 = Documentation|Any CPU
31
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Documentation|x64.ActiveCfg = Documentation|x64
32
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Documentation|x64.Build.0 = Documentation|x64
33
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Documentation|x86.ActiveCfg = Documentation|x86
34
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Documentation|x86.Build.0 = Documentation|x86
35
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Release|Any CPU.ActiveCfg = Release|x86
36
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Release|Any CPU.Build.0 = Release|x86
37
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Release|x64.ActiveCfg = Release|x64
38
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Release|x64.Build.0 = Release|x64
39
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Release|x86.ActiveCfg = Release|x86
40
+		{A5EB346F-9629-415F-B42D-D915BF80790C}.Release|x86.Build.0 = Release|x86
41
+		{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42
+		{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
43
+		{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}.Debug|x64.ActiveCfg = Debug|x86
44
+		{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}.Debug|x86.ActiveCfg = Debug|x86
45
+		{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}.Debug|x86.Build.0 = Debug|x86
46
+		{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}.Documentation|Any CPU.ActiveCfg = Debug-KP|x86
47
+		{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}.Documentation|x64.ActiveCfg = Debug-KP|x86
48
+		{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}.Documentation|x86.ActiveCfg = Debug-KP|x86
49
+		{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}.Documentation|x86.Build.0 = Debug-KP|x86
50
+		{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
51
+		{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}.Release|Any CPU.Build.0 = Release|Any CPU
52
+		{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}.Release|x64.ActiveCfg = Release|x86
53
+		{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}.Release|x86.ActiveCfg = Release|x86
54
+		{F2A96DC4-C656-45B5-B518-F6EA915A3CD2}.Release|x86.Build.0 = Release|x86
55
+	EndGlobalSection
56
+	GlobalSection(SolutionProperties) = preSolution
57
+		HideSolutionNode = FALSE
58
+	EndGlobalSection
59
+	GlobalSection(ExtensibilityGlobals) = postSolution
60
+		CodeStyleEnforcer_RulesLocation = 0
61
+		CodeStyleEnforcer_Active = -1
62
+		SolutionGuid = {3655B9FD-69C3-45E6-8803-599C2A1417DC}
63
+	EndGlobalSection
64
+	GlobalSection(SubversionScc) = preSolution
65
+		Svn-Managed = True
66
+		Manager = AnkhSVN - Subversion Support for Visual Studio
67
+	EndGlobalSection
68
+EndGlobal

+ 14
- 0
LagerVerwaltung/App.config View File

@@ -0,0 +1,14 @@
1
+<?xml version="1.0" encoding="utf-8" ?>
2
+<configuration>
3
+  <appSettings>
4
+    <add key="DBUserInt" value="sysdba" />
5
+    <add key="DbPwInt" value="masterkey" />
6
+    <add key="DbFileInt" value="C:\FirebirdDB\LAGERVERWALTUNG.FDB" />
7
+    <add key="DbDataSourceInt" value="192.168.200.17" />
8
+
9
+    <add key="DBUserExt" value="sysdba" />
10
+    <add key="DbPwExt" value="masterkey" />
11
+    <add key="DbFileExt" value="C:\FirebirdDB\MAND1.GDB" />
12
+    <add key="DbDataSourceExt" value="192.168.200.17" />
13
+ </appSettings>
14
+</configuration>

+ 402
- 0
LagerVerwaltung/Articles/ArticlesOverview.Designer.cs View File

@@ -0,0 +1,402 @@
1
+namespace LagerVerwaltung.Articles
2
+{
3
+    partial class ArticlesOverview
4
+    {
5
+        /// <summary>
6
+        /// Erforderliche Designervariable.
7
+        /// </summary>
8
+        private System.ComponentModel.IContainer components = null;
9
+
10
+        /// <summary>
11
+        /// Verwendete Ressourcen bereinigen.
12
+        /// </summary>
13
+        /// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
14
+        protected override void Dispose(bool disposing)
15
+        {
16
+            if (disposing && (components != null))
17
+            {
18
+                components.Dispose();
19
+            }
20
+            base.Dispose(disposing);
21
+        }
22
+
23
+        #region Vom Windows Form-Designer generierter Code
24
+
25
+        /// <summary>
26
+        /// Erforderliche Methode für die Designerunterstützung.
27
+        /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
28
+        /// </summary>
29
+        private void InitializeComponent()
30
+        {
31
+            this.components = new System.ComponentModel.Container();
32
+            System.Windows.Forms.Label label1;
33
+            System.Windows.Forms.Label label2;
34
+            System.Windows.Forms.GroupBox groupBox1;
35
+            System.Windows.Forms.Label label5;
36
+            System.Windows.Forms.Label label6;
37
+            System.Windows.Forms.Label label4;
38
+            System.Windows.Forms.Label label3;
39
+            System.Windows.Forms.Label label7;
40
+            System.Windows.Forms.GroupBox groupBox3;
41
+            this.cb_ArticleInactiv = new System.Windows.Forms.CheckBox();
42
+            this.tb_PriceVK = new System.Windows.Forms.TextBox();
43
+            this.tb_InStock = new System.Windows.Forms.TextBox();
44
+            this.tb_Supplier = new System.Windows.Forms.TextBox();
45
+            this.tb_ArticleNumber = new System.Windows.Forms.TextBox();
46
+            this.tb_PriceEK = new System.Windows.Forms.TextBox();
47
+            this.clb_Articel2Branches = new System.Windows.Forms.CheckedListBox();
48
+            this.cb_BranchArticle = new System.Windows.Forms.CheckBox();
49
+            this.articlesList = new System.Windows.Forms.ListView();
50
+            this.ch_Number = new System.Windows.Forms.ColumnHeader();
51
+            this.ch_Name = new System.Windows.Forms.ColumnHeader();
52
+            this.ch_Price = new System.Windows.Forms.ColumnHeader();
53
+            this.cms_ArticlesList = new System.Windows.Forms.ContextMenuStrip(this.components);
54
+            this.newArticleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
55
+            this.editArticleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
56
+            this.deleteArticleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
57
+            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
58
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
59
+            this.tb_BranchStock = new System.Windows.Forms.TextBox();
60
+            label1 = new System.Windows.Forms.Label();
61
+            label2 = new System.Windows.Forms.Label();
62
+            groupBox1 = new System.Windows.Forms.GroupBox();
63
+            label5 = new System.Windows.Forms.Label();
64
+            label6 = new System.Windows.Forms.Label();
65
+            label4 = new System.Windows.Forms.Label();
66
+            label3 = new System.Windows.Forms.Label();
67
+            label7 = new System.Windows.Forms.Label();
68
+            groupBox3 = new System.Windows.Forms.GroupBox();
69
+            groupBox1.SuspendLayout();
70
+            groupBox3.SuspendLayout();
71
+            this.cms_ArticlesList.SuspendLayout();
72
+            this.splitContainer1.Panel1.SuspendLayout();
73
+            this.splitContainer1.Panel2.SuspendLayout();
74
+            this.splitContainer1.SuspendLayout();
75
+            this.groupBox2.SuspendLayout();
76
+            this.SuspendLayout();
77
+            // 
78
+            // label1
79
+            // 
80
+            label1.AutoSize = true;
81
+            label1.Location = new System.Drawing.Point(5, 25);
82
+            label1.Name = "label1";
83
+            label1.Size = new System.Drawing.Size(49, 13);
84
+            label1.TabIndex = 4;
85
+            label1.Text = "Nummer:";
86
+            // 
87
+            // label2
88
+            // 
89
+            label2.AutoSize = true;
90
+            label2.Location = new System.Drawing.Point(5, 51);
91
+            label2.Name = "label2";
92
+            label2.Size = new System.Drawing.Size(50, 13);
93
+            label2.TabIndex = 5;
94
+            label2.Text = "EK-Preis:";
95
+            // 
96
+            // groupBox1
97
+            // 
98
+            groupBox1.Controls.Add(this.cb_ArticleInactiv);
99
+            groupBox1.Controls.Add(label5);
100
+            groupBox1.Controls.Add(label6);
101
+            groupBox1.Controls.Add(this.tb_PriceVK);
102
+            groupBox1.Controls.Add(label4);
103
+            groupBox1.Controls.Add(this.tb_InStock);
104
+            groupBox1.Controls.Add(label3);
105
+            groupBox1.Controls.Add(this.tb_Supplier);
106
+            groupBox1.Controls.Add(label2);
107
+            groupBox1.Controls.Add(label1);
108
+            groupBox1.Controls.Add(this.tb_ArticleNumber);
109
+            groupBox1.Controls.Add(this.tb_PriceEK);
110
+            groupBox1.Location = new System.Drawing.Point(5, 7);
111
+            groupBox1.Name = "groupBox1";
112
+            groupBox1.Size = new System.Drawing.Size(227, 182);
113
+            groupBox1.TabIndex = 8;
114
+            groupBox1.TabStop = false;
115
+            groupBox1.Text = "Artikel-Details";
116
+            // 
117
+            // cb_ArticleInactiv
118
+            // 
119
+            this.cb_ArticleInactiv.AutoCheck = false;
120
+            this.cb_ArticleInactiv.AutoSize = true;
121
+            this.cb_ArticleInactiv.Enabled = false;
122
+            this.cb_ArticleInactiv.Location = new System.Drawing.Point(99, 155);
123
+            this.cb_ArticleInactiv.Name = "cb_ArticleInactiv";
124
+            this.cb_ArticleInactiv.Size = new System.Drawing.Size(37, 17);
125
+            this.cb_ArticleInactiv.TabIndex = 25;
126
+            this.cb_ArticleInactiv.Text = "Ja";
127
+            this.cb_ArticleInactiv.UseVisualStyleBackColor = true;
128
+            // 
129
+            // label5
130
+            // 
131
+            label5.AutoSize = true;
132
+            label5.Location = new System.Drawing.Point(6, 155);
133
+            label5.Name = "label5";
134
+            label5.Size = new System.Drawing.Size(42, 13);
135
+            label5.TabIndex = 24;
136
+            label5.Text = "Inaktiv:";
137
+            // 
138
+            // label6
139
+            // 
140
+            label6.AutoSize = true;
141
+            label6.Location = new System.Drawing.Point(5, 77);
142
+            label6.Name = "label6";
143
+            label6.Size = new System.Drawing.Size(50, 13);
144
+            label6.TabIndex = 13;
145
+            label6.Text = "VK-Preis:";
146
+            // 
147
+            // tb_PriceVK
148
+            // 
149
+            this.tb_PriceVK.Location = new System.Drawing.Point(99, 74);
150
+            this.tb_PriceVK.MaxLength = 100;
151
+            this.tb_PriceVK.Name = "tb_PriceVK";
152
+            this.tb_PriceVK.ReadOnly = true;
153
+            this.tb_PriceVK.Size = new System.Drawing.Size(122, 20);
154
+            this.tb_PriceVK.TabIndex = 12;
155
+            // 
156
+            // label4
157
+            // 
158
+            label4.AutoSize = true;
159
+            label4.Location = new System.Drawing.Point(5, 129);
160
+            label4.Name = "label4";
161
+            label4.Size = new System.Drawing.Size(78, 13);
162
+            label4.TabIndex = 9;
163
+            label4.Text = "MeldeBestand:";
164
+            // 
165
+            // tb_InStock
166
+            // 
167
+            this.tb_InStock.Location = new System.Drawing.Point(99, 126);
168
+            this.tb_InStock.MaxLength = 100;
169
+            this.tb_InStock.Name = "tb_InStock";
170
+            this.tb_InStock.ReadOnly = true;
171
+            this.tb_InStock.Size = new System.Drawing.Size(122, 20);
172
+            this.tb_InStock.TabIndex = 8;
173
+            // 
174
+            // label3
175
+            // 
176
+            label3.AutoSize = true;
177
+            label3.Location = new System.Drawing.Point(5, 103);
178
+            label3.Name = "label3";
179
+            label3.Size = new System.Drawing.Size(51, 13);
180
+            label3.TabIndex = 7;
181
+            label3.Text = "Lieferant:";
182
+            // 
183
+            // tb_Supplier
184
+            // 
185
+            this.tb_Supplier.Location = new System.Drawing.Point(99, 100);
186
+            this.tb_Supplier.MaxLength = 100;
187
+            this.tb_Supplier.Name = "tb_Supplier";
188
+            this.tb_Supplier.ReadOnly = true;
189
+            this.tb_Supplier.Size = new System.Drawing.Size(122, 20);
190
+            this.tb_Supplier.TabIndex = 6;
191
+            // 
192
+            // tb_ArticleNumber
193
+            // 
194
+            this.tb_ArticleNumber.Location = new System.Drawing.Point(99, 22);
195
+            this.tb_ArticleNumber.MaxLength = 10;
196
+            this.tb_ArticleNumber.Name = "tb_ArticleNumber";
197
+            this.tb_ArticleNumber.ReadOnly = true;
198
+            this.tb_ArticleNumber.Size = new System.Drawing.Size(122, 20);
199
+            this.tb_ArticleNumber.TabIndex = 2;
200
+            // 
201
+            // tb_PriceEK
202
+            // 
203
+            this.tb_PriceEK.Location = new System.Drawing.Point(99, 48);
204
+            this.tb_PriceEK.MaxLength = 100;
205
+            this.tb_PriceEK.Name = "tb_PriceEK";
206
+            this.tb_PriceEK.ReadOnly = true;
207
+            this.tb_PriceEK.Size = new System.Drawing.Size(122, 20);
208
+            this.tb_PriceEK.TabIndex = 3;
209
+            // 
210
+            // label7
211
+            // 
212
+            label7.AutoSize = true;
213
+            label7.Location = new System.Drawing.Point(5, 22);
214
+            label7.Name = "label7";
215
+            label7.Size = new System.Drawing.Size(49, 13);
216
+            label7.TabIndex = 13;
217
+            label7.Text = "Bestand:";
218
+            // 
219
+            // groupBox3
220
+            // 
221
+            groupBox3.Controls.Add(this.clb_Articel2Branches);
222
+            groupBox3.Controls.Add(this.cb_BranchArticle);
223
+            groupBox3.Location = new System.Drawing.Point(4, 254);
224
+            groupBox3.Name = "groupBox3";
225
+            groupBox3.Size = new System.Drawing.Size(227, 188);
226
+            groupBox3.TabIndex = 10;
227
+            groupBox3.TabStop = false;
228
+            groupBox3.Text = "Filial-Artikel";
229
+            // 
230
+            // clb_Articel2Branches
231
+            // 
232
+            this.clb_Articel2Branches.CheckOnClick = true;
233
+            this.clb_Articel2Branches.FormattingEnabled = true;
234
+            this.clb_Articel2Branches.Location = new System.Drawing.Point(10, 18);
235
+            this.clb_Articel2Branches.Name = "clb_Articel2Branches";
236
+            this.clb_Articel2Branches.Size = new System.Drawing.Size(213, 139);
237
+            this.clb_Articel2Branches.TabIndex = 27;
238
+            // 
239
+            // cb_BranchArticle
240
+            // 
241
+            this.cb_BranchArticle.AutoSize = true;
242
+            this.cb_BranchArticle.Enabled = false;
243
+            this.cb_BranchArticle.Location = new System.Drawing.Point(10, 163);
244
+            this.cb_BranchArticle.Name = "cb_BranchArticle";
245
+            this.cb_BranchArticle.Size = new System.Drawing.Size(78, 17);
246
+            this.cb_BranchArticle.TabIndex = 26;
247
+            this.cb_BranchArticle.Text = "Filial-Artikel";
248
+            this.cb_BranchArticle.UseVisualStyleBackColor = true;
249
+            // 
250
+            // articlesList
251
+            // 
252
+            this.articlesList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
253
+            this.ch_Number,
254
+            this.ch_Name,
255
+            this.ch_Price});
256
+            this.articlesList.ContextMenuStrip = this.cms_ArticlesList;
257
+            this.articlesList.Dock = System.Windows.Forms.DockStyle.Fill;
258
+            this.articlesList.FullRowSelect = true;
259
+            this.articlesList.GridLines = true;
260
+            this.articlesList.HideSelection = false;
261
+            this.articlesList.Location = new System.Drawing.Point(0, 0);
262
+            this.articlesList.MultiSelect = false;
263
+            this.articlesList.Name = "articlesList";
264
+            this.articlesList.ShowGroups = false;
265
+            this.articlesList.Size = new System.Drawing.Size(544, 447);
266
+            this.articlesList.TabIndex = 0;
267
+            this.articlesList.UseCompatibleStateImageBehavior = false;
268
+            this.articlesList.View = System.Windows.Forms.View.Details;
269
+            this.articlesList.SelectedIndexChanged += new System.EventHandler(this.OnArticlesListSelectedIndexChanged);
270
+            this.articlesList.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.OnArticlesListColumnClick);
271
+            // 
272
+            // ch_Number
273
+            // 
274
+            this.ch_Number.Text = "Nr";
275
+            // 
276
+            // ch_Name
277
+            // 
278
+            this.ch_Name.Text = "Bezeichnung";
279
+            this.ch_Name.Width = 315;
280
+            // 
281
+            // ch_Price
282
+            // 
283
+            this.ch_Price.Text = "Preis";
284
+            this.ch_Price.Width = 93;
285
+            // 
286
+            // cms_ArticlesList
287
+            // 
288
+            this.cms_ArticlesList.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
289
+            this.newArticleToolStripMenuItem,
290
+            this.editArticleToolStripMenuItem,
291
+            this.deleteArticleToolStripMenuItem});
292
+            this.cms_ArticlesList.Name = "cms_BranchesList";
293
+            this.cms_ArticlesList.Size = new System.Drawing.Size(127, 70);
294
+            this.cms_ArticlesList.Opening += new System.ComponentModel.CancelEventHandler(this.OnCmsArticlesListOpening);
295
+            // 
296
+            // newArticleToolStripMenuItem
297
+            // 
298
+            this.newArticleToolStripMenuItem.Name = "newArticleToolStripMenuItem";
299
+            this.newArticleToolStripMenuItem.Size = new System.Drawing.Size(126, 22);
300
+            this.newArticleToolStripMenuItem.Text = "Neu";
301
+            this.newArticleToolStripMenuItem.Click += new System.EventHandler(this.OnNewArticleToolStripMenuItemClick);
302
+            // 
303
+            // editArticleToolStripMenuItem
304
+            // 
305
+            this.editArticleToolStripMenuItem.Name = "editArticleToolStripMenuItem";
306
+            this.editArticleToolStripMenuItem.Size = new System.Drawing.Size(126, 22);
307
+            this.editArticleToolStripMenuItem.Text = "Bearbeiten";
308
+            this.editArticleToolStripMenuItem.Click += new System.EventHandler(this.OnEditArticleToolStripMenuItemClick);
309
+            // 
310
+            // deleteArticleToolStripMenuItem
311
+            // 
312
+            this.deleteArticleToolStripMenuItem.Name = "deleteArticleToolStripMenuItem";
313
+            this.deleteArticleToolStripMenuItem.Size = new System.Drawing.Size(126, 22);
314
+            this.deleteArticleToolStripMenuItem.Text = "Löschen";
315
+            this.deleteArticleToolStripMenuItem.Click += new System.EventHandler(this.OnDeleteBranchToolStripMenuItemClick);
316
+            // 
317
+            // splitContainer1
318
+            // 
319
+            this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
320
+            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
321
+            this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
322
+            this.splitContainer1.IsSplitterFixed = true;
323
+            this.splitContainer1.Location = new System.Drawing.Point(0, 0);
324
+            this.splitContainer1.Name = "splitContainer1";
325
+            // 
326
+            // splitContainer1.Panel1
327
+            // 
328
+            this.splitContainer1.Panel1.Controls.Add(this.articlesList);
329
+            // 
330
+            // splitContainer1.Panel2
331
+            // 
332
+            this.splitContainer1.Panel2.Controls.Add(groupBox3);
333
+            this.splitContainer1.Panel2.Controls.Add(this.groupBox2);
334
+            this.splitContainer1.Panel2.Controls.Add(groupBox1);
335
+            this.splitContainer1.Size = new System.Drawing.Size(787, 449);
336
+            this.splitContainer1.SplitterDistance = 546;
337
+            this.splitContainer1.TabIndex = 7;
338
+            // 
339
+            // groupBox2
340
+            // 
341
+            this.groupBox2.Controls.Add(label7);
342
+            this.groupBox2.Controls.Add(this.tb_BranchStock);
343
+            this.groupBox2.Location = new System.Drawing.Point(6, 195);
344
+            this.groupBox2.Name = "groupBox2";
345
+            this.groupBox2.Size = new System.Drawing.Size(227, 53);
346
+            this.groupBox2.TabIndex = 9;
347
+            this.groupBox2.TabStop = false;
348
+            this.groupBox2.Text = "Filialen-Details";
349
+            // 
350
+            // tb_BranchStock
351
+            // 
352
+            this.tb_BranchStock.Location = new System.Drawing.Point(99, 19);
353
+            this.tb_BranchStock.MaxLength = 100;
354
+            this.tb_BranchStock.Name = "tb_BranchStock";
355
+            this.tb_BranchStock.ReadOnly = true;
356
+            this.tb_BranchStock.Size = new System.Drawing.Size(122, 20);
357
+            this.tb_BranchStock.TabIndex = 12;
358
+            // 
359
+            // ArticlesOverview
360
+            // 
361
+            this.Controls.Add(this.splitContainer1);
362
+            this.Name = "ArticlesOverview";
363
+            this.Size = new System.Drawing.Size(787, 449);
364
+            this.VisibleChanged += new System.EventHandler(this.OnBranchesOverviewVisibleChanged);
365
+            groupBox1.ResumeLayout(false);
366
+            groupBox1.PerformLayout();
367
+            groupBox3.ResumeLayout(false);
368
+            groupBox3.PerformLayout();
369
+            this.cms_ArticlesList.ResumeLayout(false);
370
+            this.splitContainer1.Panel1.ResumeLayout(false);
371
+            this.splitContainer1.Panel2.ResumeLayout(false);
372
+            this.splitContainer1.ResumeLayout(false);
373
+            this.groupBox2.ResumeLayout(false);
374
+            this.groupBox2.PerformLayout();
375
+            this.ResumeLayout(false);
376
+
377
+        }
378
+
379
+        #endregion
380
+
381
+        private System.Windows.Forms.ListView articlesList;
382
+        private System.Windows.Forms.ColumnHeader ch_Number;
383
+        private System.Windows.Forms.ColumnHeader ch_Name;
384
+        private System.Windows.Forms.TextBox tb_ArticleNumber;
385
+        private System.Windows.Forms.TextBox tb_PriceEK;
386
+        private System.Windows.Forms.SplitContainer splitContainer1;
387
+        private System.Windows.Forms.ContextMenuStrip cms_ArticlesList;
388
+        private System.Windows.Forms.ToolStripMenuItem deleteArticleToolStripMenuItem;
389
+        private System.Windows.Forms.ColumnHeader ch_Price;
390
+        private System.Windows.Forms.TextBox tb_InStock;
391
+        private System.Windows.Forms.TextBox tb_Supplier;
392
+        private System.Windows.Forms.ToolStripMenuItem newArticleToolStripMenuItem;
393
+        private System.Windows.Forms.ToolStripMenuItem editArticleToolStripMenuItem;
394
+        private System.Windows.Forms.TextBox tb_PriceVK;
395
+        private System.Windows.Forms.GroupBox groupBox2;
396
+        private System.Windows.Forms.TextBox tb_BranchStock;
397
+        private System.Windows.Forms.CheckBox cb_ArticleInactiv;
398
+        private System.Windows.Forms.CheckedListBox clb_Articel2Branches;
399
+        private System.Windows.Forms.CheckBox cb_BranchArticle;
400
+
401
+    }
402
+}

+ 236
- 0
LagerVerwaltung/Articles/ArticlesOverview.cs View File

@@ -0,0 +1,236 @@
1
+using System;
2
+using System.Collections;
3
+using System.Collections.Generic;
4
+using System.ComponentModel;
5
+using System.Data;
6
+using System.Drawing;
7
+using System.Text;
8
+using System.Windows.Forms;
9
+
10
+using LagerVerwaltung;
11
+using LagerVerwaltung.Articles.BO;
12
+using LagerVerwaltung.Articles.BLL;
13
+using LagerVerwaltung.Branches.BO;
14
+using LagerVerwaltung.Branches.BLL;
15
+using log4net;
16
+
17
+namespace LagerVerwaltung.Articles
18
+{
19
+    /// <summary>
20
+    /// Übersicht aller Artikel in der Datenbank
21
+    /// </summary>
22
+    public partial class ArticlesOverview : PanelPage
23
+    {
24
+        private Dictionary<int, ArticlesBO> m_Articles = new Dictionary<int, ArticlesBO>();
25
+        private ListViewColumnSorter m_ColumnSorter = new ListViewColumnSorter();
26
+
27
+        /// <summary>
28
+        /// Konstruktor
29
+        /// </summary>
30
+        public ArticlesOverview()
31
+        {
32
+            InitializeComponent();
33
+            this.Text = "Artikelübersicht";
34
+            this.Tag = "ArticlesOverview";
35
+            this.Dock = DockStyle.Fill;
36
+            this.Visible = false;
37
+
38
+            this.articlesList.ListViewItemSorter = m_ColumnSorter;
39
+        }
40
+
41
+        /// <summary>
42
+        /// Aktualisieren der Artikelliste
43
+        /// </summary>
44
+        public override void UpdateList() 
45
+        {
46
+            clb_Articel2Branches.SelectionMode = SelectionMode.None;
47
+
48
+            m_Articles = ArticlesBLL.GetArticles(true);
49
+
50
+            this.articlesList.Items.Clear();
51
+            ListViewItem listViewItem;
52
+            ListViewItem.ListViewSubItem listViewSubItem;
53
+
54
+            foreach (KeyValuePair<int, ArticlesBO> article in m_Articles)
55
+            {
56
+                listViewItem = new ListViewItem(article.Value.ArticleNr.ToString());
57
+                listViewItem.Name = article.Value.ID.ToString();
58
+
59
+                listViewSubItem = new ListViewItem.ListViewSubItem(listViewItem, article.Value.Name);
60
+                listViewItem.SubItems.Add(listViewSubItem);
61
+
62
+                listViewSubItem = new ListViewItem.ListViewSubItem(listViewItem, article.Value.PriceVK.ToString("C"));
63
+                listViewItem.SubItems.Add(listViewSubItem);
64
+
65
+                this.articlesList.Items.Add(listViewItem);
66
+            }
67
+
68
+            this.articlesList.SelectedItems.Clear();
69
+
70
+            List<BranchesBO> branches = BranchesBLL.GetBranches();
71
+            this.clb_Articel2Branches.Items.Clear();
72
+
73
+            foreach (BranchesBO branch in branches) {
74
+                this.clb_Articel2Branches.Items.Add(branch);
75
+            }
76
+
77
+            clb_Articel2Branches.Enabled = cb_BranchArticle.Checked; 
78
+        }
79
+
80
+        private bool DeleteArticle(int id, Boolean delete_with_flag)
81
+        {
82
+            ILog lg = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
83
+            ArticlesBO article = new ArticlesBO();
84
+            article.ID = id;
85
+
86
+            try
87
+            {
88
+                ArticlesBLL.Delete(article, delete_with_flag);
89
+            }
90
+            catch (CheckException e)
91
+            {
92
+                lg.Error(Pp.Basic.Func.GetExceptionText(e, true));
93
+                DialogResult diagRes = MessageBox.Show(e.Message, "Fehler beim löschen des Artikels", MessageBoxButtons.OK, MessageBoxIcon.Error);
94
+                return false;
95
+            }
96
+            catch (Exception e)
97
+            {
98
+                lg.Error(Pp.Basic.Func.GetExceptionText(e, true));
99
+                ExceptionHandler exHandler = new ExceptionHandler(e);
100
+                DialogResult diagRes = exHandler.ShowDialog();
101
+                return false;
102
+            }
103
+
104
+            return true;
105
+        }
106
+
107
+        private void OnDeleteBranchToolStripMenuItemClick(object sender, EventArgs e)
108
+        {
109
+            if (this.articlesList.SelectedItems.Count == 0)
110
+                return;
111
+
112
+            Boolean delete_with_flag = true;
113
+
114
+            DialogResult diagRes = MessageBox.Show("Möchten Sie diesen Artikel wirklich löschen?", "Sind Sie sicher?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
115
+            if (diagRes == DialogResult.No)
116
+                return;
117
+
118
+            int id = Int32.Parse(this.articlesList.SelectedItems[0].Name);
119
+
120
+            if (DeleteArticle(id, delete_with_flag))
121
+            {
122
+                this.UpdateList();
123
+            }
124
+        }
125
+
126
+        private void OnBranchesOverviewVisibleChanged(object sender, EventArgs e)
127
+        {
128
+            if (this.Visible)
129
+                this.UpdateList();
130
+        }
131
+
132
+        private void OnArticlesListSelectedIndexChanged(object sender, EventArgs e)
133
+        {
134
+            if (this.articlesList.SelectedItems.Count == 0)
135
+                return;
136
+
137
+            String number = this.articlesList.SelectedItems[0].Name;
138
+
139
+            foreach (KeyValuePair<int, ArticlesBO> article in m_Articles)
140
+            {
141
+                if (article.Key.Equals(Int32.Parse(number)))
142
+                {
143
+                    this.tb_ArticleNumber.Text = article.Value.ArticleNr.ToString();
144
+                    this.tb_InStock.Text = article.Value.InStock.ToString();
145
+                    this.tb_PriceEK.Text = article.Value.PriceEK.ToString("C");
146
+                    this.tb_PriceVK.Text = article.Value.PriceVK.ToString("C");
147
+                    this.tb_Supplier.Text = article.Value.Supplier;
148
+                    this.cb_ArticleInactiv.Checked = article.Value.InActive;
149
+                    this.cb_BranchArticle.Checked = article.Value.BranchArticle;
150
+
151
+                    for (int i = 0; i < clb_Articel2Branches.Items.Count; i++) {
152
+                        if (article.Value.Branches.ContainsKey(clb_Articel2Branches.Items[i].ToString())) {
153
+                            clb_Articel2Branches.SetItemChecked(i, true);
154
+                        } else {
155
+                            clb_Articel2Branches.SetItemChecked(i, false);
156
+                        }
157
+                    }
158
+
159
+                    this.tb_BranchStock.Text = ArticlesInventoryBLL.GetArticleQuantityOfBranch(Globals.CurrentBranch.ID, article.Value.ID).Quantity.ToString();
160
+                    break;
161
+                }
162
+            }
163
+
164
+            clb_Articel2Branches.Enabled = cb_BranchArticle.Checked; 
165
+        }
166
+
167
+        private void OnCmsArticlesListOpening(object sender, CancelEventArgs e)
168
+        {
169
+            if (this.articlesList.SelectedItems.Count == 0)
170
+            {
171
+                editArticleToolStripMenuItem.Enabled = false;
172
+                deleteArticleToolStripMenuItem.Enabled = false;
173
+            }
174
+            else
175
+            {
176
+                editArticleToolStripMenuItem.Enabled = true;
177
+                deleteArticleToolStripMenuItem.Enabled = true;
178
+            }
179
+        }
180
+
181
+        private void OnNewArticleToolStripMenuItemClick(object sender, EventArgs e)
182
+        {
183
+            EditArticle editArticleWindow = new EditArticle();
184
+            DialogResult diagRes = editArticleWindow.ShowDialog(this);
185
+            if (diagRes == DialogResult.OK)
186
+                UpdateList();
187
+        }
188
+
189
+        private void OnEditArticleToolStripMenuItemClick(object sender, EventArgs e)
190
+        {
191
+            String number = this.articlesList.SelectedItems[0].Name;
192
+            ArticlesBO article = null;
193
+
194
+            foreach (KeyValuePair<int, ArticlesBO> article1 in m_Articles)
195
+            {
196
+                if (article1.Value.ID.Equals(Int32.Parse(number)))
197
+                {
198
+                    article = article1.Value;
199
+                    break;
200
+                }
201
+            }
202
+
203
+            EditArticle editArticleWindow = new EditArticle();
204
+            editArticleWindow.Article = article;
205
+            DialogResult diagRes = editArticleWindow.ShowDialog(this);
206
+            if (diagRes == DialogResult.OK)
207
+                UpdateList();
208
+        }
209
+
210
+        private void OnArticlesListColumnClick(object sender, ColumnClickEventArgs e)
211
+        {
212
+            // Determine if clicked column is already the column that is being sorted.
213
+            if (e.Column == m_ColumnSorter.SortColumn)
214
+            {
215
+                // Reverse the current sort direction for this column.
216
+                if (m_ColumnSorter.Order == SortOrder.Ascending)
217
+                {
218
+                    m_ColumnSorter.Order = SortOrder.Descending;
219
+                }
220
+                else
221
+                {
222
+                    m_ColumnSorter.Order = SortOrder.Ascending;
223
+                }
224
+            }
225
+            else
226
+            {
227
+                // Set the column number that is to be sorted; default to ascending.
228
+                m_ColumnSorter.SortColumn = e.Column;
229
+                m_ColumnSorter.Order = SortOrder.Ascending;
230
+            }
231
+
232
+            // Perform the sort with these new sort options.
233
+            this.articlesList.Sort();
234
+        }
235
+    }
236
+}

+ 150
- 0
LagerVerwaltung/Articles/ArticlesOverview.resx View File

@@ -0,0 +1,150 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<root>
3
+  <!-- 
4
+    Microsoft ResX Schema 
5
+    
6
+    Version 2.0
7
+    
8
+    The primary goals of this format is to allow a simple XML format 
9
+    that is mostly human readable. The generation and parsing of the 
10
+    various data types are done through the TypeConverter classes 
11
+    associated with the data types.
12
+    
13
+    Example:
14
+    
15
+    ... ado.net/XML headers & schema ...
16
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+    <resheader name="version">2.0</resheader>
18
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+    </data>
25
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+        <comment>This is a comment</comment>
28
+    </data>
29
+                
30
+    There are any number of "resheader" rows that contain simple 
31
+    name/value pairs.
32
+    
33
+    Each data row contains a name, and value. The row also contains a 
34
+    type or mimetype. Type corresponds to a .NET class that support 
35
+    text/value conversion through the TypeConverter architecture. 
36
+    Classes that don't support this are serialized and stored with the 
37
+    mimetype set.
38
+    
39
+    The mimetype is used for serialized objects, and tells the 
40
+    ResXResourceReader how to depersist the object. This is currently not 
41
+    extensible. For a given mimetype the value must be set accordingly:
42
+    
43
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
+    that the ResXResourceWriter will generate, however the reader can 
45
+    read any of the formats listed below.
46
+    
47
+    mimetype: application/x-microsoft.net.object.binary.base64
48
+    value   : The object must be serialized with 
49
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+            : and then encoded with base64 encoding.
51
+    
52
+    mimetype: application/x-microsoft.net.object.soap.base64
53
+    value   : The object must be serialized with 
54
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+            : and then encoded with base64 encoding.
56
+
57
+    mimetype: application/x-microsoft.net.object.bytearray.base64
58
+    value   : The object must be serialized into a byte array 
59
+            : using a System.ComponentModel.TypeConverter
60
+            : and then encoded with base64 encoding.
61
+    -->
62
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+    <xsd:element name="root" msdata:IsDataSet="true">
65
+      <xsd:complexType>
66
+        <xsd:choice maxOccurs="unbounded">
67
+          <xsd:element name="metadata">
68
+            <xsd:complexType>
69
+              <xsd:sequence>
70
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+              </xsd:sequence>
72
+              <xsd:attribute name="name" use="required" type="xsd:string" />
73
+              <xsd:attribute name="type" type="xsd:string" />
74
+              <xsd:attribute name="mimetype" type="xsd:string" />
75
+              <xsd:attribute ref="xml:space" />
76
+            </xsd:complexType>
77
+          </xsd:element>
78
+          <xsd:element name="assembly">
79
+            <xsd:complexType>
80
+              <xsd:attribute name="alias" type="xsd:string" />
81
+              <xsd:attribute name="name" type="xsd:string" />
82
+            </xsd:complexType>
83
+          </xsd:element>
84
+          <xsd:element name="data">
85
+            <xsd:complexType>
86
+              <xsd:sequence>
87
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+              </xsd:sequence>
90
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+              <xsd:attribute ref="xml:space" />
94
+            </xsd:complexType>
95
+          </xsd:element>
96
+          <xsd:element name="resheader">
97
+            <xsd:complexType>
98
+              <xsd:sequence>
99
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+              </xsd:sequence>
101
+              <xsd:attribute name="name" type="xsd:string" use="required" />
102
+            </xsd:complexType>
103
+          </xsd:element>
104
+        </xsd:choice>
105
+      </xsd:complexType>
106
+    </xsd:element>
107
+  </xsd:schema>
108
+  <resheader name="resmimetype">
109
+    <value>text/microsoft-resx</value>
110
+  </resheader>
111
+  <resheader name="version">
112
+    <value>2.0</value>
113
+  </resheader>
114
+  <resheader name="reader">
115
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+  </resheader>
117
+  <resheader name="writer">
118
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+  </resheader>
120
+  <metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
121
+    <value>False</value>
122
+  </metadata>
123
+  <metadata name="label2.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
124
+    <value>False</value>
125
+  </metadata>
126
+  <metadata name="groupBox1.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
127
+    <value>False</value>
128
+  </metadata>
129
+  <metadata name="label5.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
130
+    <value>False</value>
131
+  </metadata>
132
+  <metadata name="label6.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
133
+    <value>False</value>
134
+  </metadata>
135
+  <metadata name="label4.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
136
+    <value>False</value>
137
+  </metadata>
138
+  <metadata name="label3.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
139
+    <value>False</value>
140
+  </metadata>
141
+  <metadata name="label7.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
142
+    <value>False</value>
143
+  </metadata>
144
+  <metadata name="groupBox3.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
145
+    <value>False</value>
146
+  </metadata>
147
+  <metadata name="cms_ArticlesList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
148
+    <value>17, 17</value>
149
+  </metadata>
150
+</root>

+ 84
- 0
LagerVerwaltung/Articles/BLL/ArticleToBranchesBLL.cs View File

@@ -0,0 +1,84 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Text;
4
+using LagerVerwaltung.Articles.BO;
5
+using LagerVerwaltung.Articles.DAL;
6
+using log4net;
7
+
8
+namespace LagerVerwaltung.Articles.BLL
9
+{
10
+    /// <summary>
11
+    /// BLL zur Bearbeitung der zugewiesenen Filialen eines Artikel"
12
+    /// </summary>
13
+    public class ArticelToBranchesBLL
14
+    {
15
+        static ILog lg = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
16
+        /// <summary>
17
+        /// Neue Filiale dem Artikel hinzufügem
18
+        /// </summary>
19
+        /// <param name="article2branch">ArticleToBranchesBO Objekt das die Daten enthält</param>
20
+        /// <returns>Anzahl der betroffenen Einträge</returns>
21
+        public static int Insert(ArticleToBranchesBO article2branch)
22
+        {
23
+            try
24
+            {
25
+                ArticelToBranchesBLL.CheckInsert(article2branch);
26
+
27
+                int ret = ArticleToBranchesDAL.Insert(article2branch);
28
+                return ret;
29
+            }
30
+            catch(Exception ex)
31
+            {
32
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
33
+                throw;
34
+            }
35
+        }
36
+
37
+        /// <summary>
38
+        /// Entfernen der Zuweisung einer Filiale zu einem Artikel
39
+        /// </summary>
40
+        /// <param name="article">ArticelToBranchesBLL Objekt das die Daten enthält</param>
41
+        /// <returns>Anzahl der betroffenen Einträge</returns>
42
+        public static int DeleteAllBranchesFromArticle(ArticlesBO article)
43
+        {
44
+            try
45
+            {
46
+                int ret = ArticleToBranchesDAL.DeleteAllBranchesFromArticle(article);
47
+                return ret;
48
+            }
49
+            catch(Exception ex)
50
+            {
51
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
52
+                throw;
53
+            }
54
+        }
55
+
56
+        /// <summary>
57
+        /// Überprüfen ob alle Angaben korrekt sind beim Einfügen eines neuen Datensatzes
58
+        /// </summary>
59
+        /// <param name="article2branch">ArticelToBranchesBO Objekt das die Daten enthält</param>
60
+        /// <returns>true wenn alles in Ordnung ist</returns>
61
+        public static bool CheckInsert(ArticleToBranchesBO article2branch)
62
+        {
63
+            return true;
64
+        }
65
+
66
+        /// <summary>
67
+        /// Gibt alle Artikel einer Filiale zurück
68
+        /// </summary>
69
+        /// <param name="id">ID der Filiale</param>
70
+        /// <returns>Die zugewiesenen Filialen zu einem Artikel</returns>
71
+        public static Dictionary<String, ArticleToBranchesBO> GetArticleByBranchID(int id)
72
+        {
73
+            try
74
+            {
75
+                return ArticleToBranchesDAL.GetBranchesByArticleID(id);
76
+            }
77
+            catch(Exception ex)
78
+            {
79
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
80
+                throw;
81
+            }
82
+        }
83
+    }
84
+}

+ 267
- 0
LagerVerwaltung/Articles/BLL/ArticlesBLL.cs View File

@@ -0,0 +1,267 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Text;
4
+using System.Collections;
5
+using LagerVerwaltung.Articles.BO;
6
+using LagerVerwaltung.Articles.DAL;
7
+using LagerVerwaltung.Branches.BO;
8
+using LagerVerwaltung.Branches.BLL;
9
+using log4net;
10
+
11
+namespace LagerVerwaltung.Articles.BLL
12
+{
13
+    /// <summary>
14
+    /// Suchen, Hinzufügen, Aktualisieren und Löschen von Artikeln
15
+    /// </summary>
16
+    public static class ArticlesBLL
17
+    {
18
+        static ILog lg = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
19
+        /// <summary>
20
+        /// Enum für die Events, gibt an ob der Artikel neu, aktualisiert oder gelöscht wurde
21
+        /// </summary>
22
+        public enum ChangeMode
23
+        {
24
+            /// <summary>
25
+            /// Neuer Artikel
26
+            /// </summary>
27
+            Add = 1, 
28
+            /// <summary>
29
+            /// Aktualisierung eines Artikels
30
+            /// </summary>
31
+            Update = 2, 
32
+            /// <summary>
33
+            /// Löschen eines Artikels
34
+            /// </summary>
35
+            Delete = 3
36
+        }
37
+
38
+        public delegate void ArticleChangeHandler(ArticlesBO article, ChangeMode mode);
39
+
40
+        /// <summary>
41
+        /// Event das ausgelöst wird wenn ein Artikel geändert wurde
42
+        /// </summary>
43
+        public static event ArticleChangeHandler ArticleChange;
44
+
45
+        /// <summary>
46
+        /// Wird aufgerufen wenn ein Artikel geändert wurde
47
+        /// </summary>
48
+        /// <param name="article">Artikelobjekt</param>
49
+        /// <param name="mode">Art der Änderung</param>
50
+        public static void OnArticleChange(ArticlesBO article, ChangeMode mode)
51
+        {
52
+            if (ArticleChange != null)
53
+            {
54
+                ArticleChange(article, mode);
55
+            }
56
+        }
57
+
58
+        /// <summary>
59
+        /// Neuen Artikel hinzufügen
60
+        /// </summary>
61
+        /// <param name="article">Artikelobjekt</param>
62
+        /// <returns>ID des neuen Artikels</returns>
63
+        public static int Insert(ArticlesBO article)
64
+        {
65
+            try
66
+            {
67
+                ArticlesBLL.CheckInsert(article);
68
+
69
+                int artID = ArticlesDAL.Insert(article);
70
+                article.ID = artID;
71
+                OnArticleChange(article, ChangeMode.Add);
72
+
73
+                ArticlesInventoryBO artInvBO = new ArticlesInventoryBO();
74
+                artInvBO.ArticleID = artID;
75
+                artInvBO.Quantity = 0;
76
+                List<BranchesBO> branches = BranchesBLL.GetBranches();
77
+                foreach (BranchesBO branch in branches)
78
+                {
79
+                    artInvBO.BranchID = branch.ID;
80
+                    ArticlesInventoryBLL.Insert(artInvBO);
81
+                }
82
+
83
+                return artID;
84
+            }
85
+            catch(Exception ex)
86
+            {
87
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
88
+                throw;
89
+            }
90
+        }
91
+
92
+        /// <summary>
93
+        /// Aktualisieren eines Artikels
94
+        /// </summary>
95
+        /// <param name="article">Artikelobjekt</param>
96
+        /// <returns>ID des aktualisierten Artikels</returns>
97
+        public static int Update(ArticlesBO article)
98
+        {
99
+            ILog lg = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
100
+            try
101
+            {
102
+                ArticlesBLL.CheckUpdate(article);
103
+
104
+                int ret = ArticlesDAL.Update(article);
105
+                OnArticleChange(article, ChangeMode.Update);
106
+                return ret;
107
+            }
108
+            catch(Exception ex)
109
+            {
110
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
111
+                throw;
112
+            }
113
+        }
114
+
115
+        /// <summary>
116
+        /// Löschen eines Artikels
117
+        /// </summary>
118
+        /// <param name="article">Artikelobjekt</param>
119
+        /// <returns>ID des gelöschten Artikels</returns>
120
+        public static int Delete(ArticlesBO article, Boolean delete_with_flag)
121
+        {
122
+            ILog lg = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
123
+
124
+            int ret = int.MinValue;
125
+
126
+            try
127
+            {
128
+                if (delete_with_flag) {
129
+                
130
+                    ret = ArticlesDAL.DeleteFlag(article);
131
+                    OnArticleChange(article, ChangeMode.Delete);
132
+                
133
+                } else {
134
+
135
+                    ret = ArticlesDAL.Delete(article);
136
+                    OnArticleChange(article, ChangeMode.Delete);
137
+
138
+                    ArticlesInventoryBO artInvBO = new ArticlesInventoryBO();
139
+                    artInvBO.ArticleID = article.ID;
140
+                    List<BranchesBO> branches = BranchesBLL.GetBranches();
141
+                    foreach (BranchesBO branch in branches) {
142
+                        artInvBO.BranchID = branch.ID;
143
+                        ArticlesInventoryBLL.Delete(artInvBO);
144
+                    }
145
+
146
+                }
147
+
148
+                return ret;
149
+            }
150
+            catch(Exception ex)
151
+            {
152
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
153
+                throw;
154
+            }
155
+        }
156
+
157
+        /// <summary>
158
+        /// Überprüfen ob der zu aktualisierende Artikel gültige Daten enthält
159
+        /// </summary>
160
+        /// <param name="article">Artikelobjekt</param>
161
+        /// <returns>true wenn in Ordnung</returns>
162
+        public static bool CheckUpdate(ArticlesBO article)
163
+        {
164
+            return true;
165
+        }
166
+
167
+        /// <summary>
168
+        /// Überprüfen ob der neue Artikel gültige Daten enthält
169
+        /// </summary>
170
+        /// <param name="article">Artikelobjekt</param>
171
+        /// <returns>true wenn in Ordnung</returns>
172
+        public static bool CheckInsert(ArticlesBO article)
173
+        {
174
+            return true;
175
+        }
176
+
177
+        /// <summary>
178
+        /// Gibt alle Artikel zurrück
179
+        /// </summary>
180
+        /// <returns>Liste aller eingepflegten Artikel</returns>
181
+        public static Dictionary<int, ArticlesBO> GetArticles()
182
+        {
183
+            ILog lg = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
184
+            try
185
+            {
186
+                return ArticlesDAL.GetArticles(false);
187
+            }
188
+            catch(Exception ex)
189
+            {
190
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
191
+                throw;
192
+            }
193
+        }
194
+
195
+        /// <summary>
196
+        /// Gibt alle Artikel zurrück
197
+        /// </summary>
198
+        /// <returns>Liste aller eingepflegten Artikel</returns>
199
+        public static Dictionary<int, ArticlesBO> GetArticles(bool showHiddenArticles)
200
+        {
201
+            ILog lg = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
202
+            try
203
+            {
204
+                return ArticlesDAL.GetArticles(showHiddenArticles);
205
+            }
206
+            catch(Exception ex)
207
+            {
208
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
209
+                throw;
210
+            }
211
+        }
212
+
213
+        /// <summary>
214
+        /// Gibt einen bestimmten Artikel zurück
215
+        /// </summary>
216
+        /// <param name="id">Die ID des Artikels</param>
217
+        /// <returns>Artikelobjekt</returns>
218
+        public static ArticlesBO GetArticleByID(int id)
219
+        {
220
+            try
221
+            {
222
+                return ArticlesDAL.GetArticleByID(id);
223
+            }
224
+            catch(Exception ex)
225
+            {
226
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
227
+                throw;
228
+            }
229
+        }
230
+
231
+        /// <summary>
232
+        /// Sucht Artikel anhand eines Namens
233
+        /// </summary>
234
+        /// <param name="name">Name des/der gesuchten Artikel</param>
235
+        /// <returns>Liste der passenden Artikel</returns>
236
+        public static List<ArticlesBO> SearchArticle(String name)
237
+        {
238
+            try
239
+            {
240
+                return ArticlesDAL.SearchArticle(name, false);
241
+            }
242
+            catch(Exception ex)
243
+            {
244
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
245
+                throw;
246
+            }
247
+        }
248
+
249
+        /// <summary>
250
+        /// Sucht Artikel anhand eines Namens
251
+        /// </summary>
252
+        /// <param name="name">Name des/der gesuchten Artikel</param>
253
+        /// <returns>Liste der passenden Artikel</returns>
254
+        public static List<ArticlesBO> SearchArticle(String name, bool showHiddenArticles)
255
+        {
256
+            try
257
+            {
258
+                return ArticlesDAL.SearchArticle(name, false);
259
+            }
260
+            catch(Exception ex)
261
+            {
262
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
263
+                throw;
264
+            }
265
+        }
266
+    }
267
+}

+ 163
- 0
LagerVerwaltung/Articles/BLL/ArticlesInventoryBLL.cs View File

@@ -0,0 +1,163 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Text;
4
+using LagerVerwaltung.Articles.BO;
5
+using LagerVerwaltung.Articles.DAL;
6
+using log4net;
7
+
8
+namespace LagerVerwaltung.Articles.BLL
9
+{
10
+    /// <summary>
11
+    /// Suchen, Hinzufügen, Aktualisieren und Löschen von Artikeln die einer Filiale zugeordnet sind
12
+    /// </summary>
13
+    public class ArticlesInventoryBLL
14
+    {
15
+        static ILog lg = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
16
+        /// <summary>
17
+        /// Enum für die Events, gibt an ob der ArtikelEintrag neu, aktualisiert oder gelöscht wurde
18
+        /// </summary>
19
+        public enum ChangeMode
20
+        {
21
+            /// <summary>
22
+            /// Neuer Artikel
23
+            /// </summary>
24
+            Add = 1, 
25
+            /// <summary>
26
+            /// Artikel aktualisieren
27
+            /// </summary>
28
+            Update = 2,
29
+            /// <summary>
30
+            /// Artikel löschen
31
+            /// </summary>
32
+            Delete = 3
33
+        }
34
+
35
+        /// <summary>
36
+        /// Funktionszeiger für das Event ArticlesInventoryChange
37
+        /// </summary>
38
+        /// <param name="article">Der geändert Artikel</param>
39
+        /// <param name="mode">Art der Änderung</param>
40
+        public delegate void ArticlesInventoryChangeHandler(ArticlesInventoryBO article, ChangeMode mode);
41
+
42
+        /// <summary>
43
+        /// Event das ausgelöst wird wenn ein Artikel im Inventar geändert wird
44
+        /// </summary>
45
+        public static event ArticlesInventoryChangeHandler ArticlesInventoryChange;
46
+
47
+        /// <summary>
48
+        /// Wird aufgerufen wenn ein Artikeleintrag geändert wurde
49
+        /// </summary>
50
+        /// <param name="article">Artikelobjekt</param>
51
+        /// <param name="mode">Art der Änderung</param>
52
+        public static void OnArticleChange(ArticlesInventoryBO article, ChangeMode mode)
53
+        {
54
+            if (ArticlesInventoryChange != null)
55
+            {
56
+                ArticlesInventoryChange(article, mode);
57
+            }
58
+        }
59
+
60
+        /// <summary>
61
+        /// Neuen Artikeleintrag hinzufügen
62
+        /// </summary>
63
+        /// <param name="article">Artikelobjekt</param>
64
+        /// <returns>ID des neuen Artikeleintrages</returns>
65
+        public static int Insert(ArticlesInventoryBO article)
66
+        {
67
+            try
68
+            {
69
+                ArticlesInventoryBLL.CheckInsert(article);
70
+
71
+                int ret = ArticlesInventoryDAL.Insert(article);
72
+                OnArticleChange(article, ChangeMode.Add);
73
+                return ret;
74
+            }
75
+            catch(Exception ex)
76
+            {
77
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
78
+                throw;
79
+            }
80
+        }
81
+
82
+        /// <summary>
83
+        /// Aktualisieren eines Artikeleintrags
84
+        /// </summary>
85
+        /// <param name="article">Artikelobjekt</param>
86
+        /// <returns>ID des aktualisierten Artikeleintrags</returns>
87
+        public static int Update(ArticlesInventoryBO article)
88
+        {
89
+            try
90
+            {
91
+                ArticlesInventoryBLL.CheckUpdate(article);
92
+
93
+                int ret = ArticlesInventoryDAL.Update(article);
94
+                OnArticleChange(article, ChangeMode.Update);
95
+                return ret;
96
+            }
97
+            catch(Exception ex)
98
+            {
99
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
100
+                throw;
101
+            }
102
+        }
103
+
104
+        /// <summary>
105
+        /// Löschen eines Artikeleintrags
106
+        /// </summary>
107
+        /// <param name="article">Artikelobjekt</param>
108
+        /// <returns>ID des gelöschten Artikeleintrags</returns>
109
+        public static int Delete(ArticlesInventoryBO article)
110
+        {
111
+            try
112
+            {
113
+                int ret = ArticlesInventoryDAL.Delete(article);
114
+                OnArticleChange(article, ChangeMode.Delete);
115
+                return ret;
116
+            }
117
+            catch(Exception ex)
118
+            {
119
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
120
+                throw;
121
+            }
122
+        }
123
+
124
+        /// <summary>
125
+        /// Überprüfen ob der zu aktualisierende Artikeleintrag gültige Daten enthält
126
+        /// </summary>
127
+        /// <param name="article">Artikelobjekt</param>
128
+        /// <returns>true wenn in Ordnung</returns>
129
+        public static bool CheckUpdate(ArticlesInventoryBO article)
130
+        {
131
+            return true;
132
+        }
133
+
134
+        /// <summary>
135
+        /// Überprüfen ob der neue Artikel gültige Daten enthält
136
+        /// </summary>
137
+        /// <param name="article">Artikelobjekt</param>
138
+        /// <returns>true wenn in Ordnung</returns>
139
+        public static bool CheckInsert(ArticlesInventoryBO article)
140
+        {
141
+            return true;
142
+        }
143
+
144
+        /// <summary>
145
+        /// Gibt die Anzahl der Artikel in einer Filiale zurück
146
+        /// </summary>
147
+        /// <param name="branch_id">ID der Filiale</param>
148
+        /// <param name="article_id">ID des Artikels</param>
149
+        /// <returns>Gibt ein Objekt zurück das Informationen zum gefunden Eintrag enthält</returns>
150
+        public static ArticlesInventoryBO GetArticleQuantityOfBranch(int branch_id, int article_id)
151
+        {
152
+            try
153
+            {
154
+                return ArticlesInventoryDAL.GetArticleQuantityOfBranch(branch_id, article_id);
155
+            }
156
+            catch(Exception ex)
157
+            {
158
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
159
+                throw;
160
+            }
161
+        }
162
+    }
163
+}

+ 61
- 0
LagerVerwaltung/Articles/BO/ArticleToBranchesBO.cs View File

@@ -0,0 +1,61 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Text;
4
+using LagerVerwaltung.Branches.BO;
5
+
6
+namespace LagerVerwaltung.Articles.BO
7
+{
8
+    /// <summary>
9
+    /// BO zur Zuweisung von Filialen zu einem Artikel
10
+    /// </summary>
11
+    public class ArticleToBranchesBO
12
+    {
13
+        private int m_ArticleId;
14
+        private int m_BranchId;
15
+        private BranchesBO m_Branch;
16
+
17
+        /// <summary>
18
+        /// Konstruktor
19
+        /// </summary>
20
+        public ArticleToBranchesBO() { }
21
+
22
+        /// <summary>
23
+        /// Lesen oder Setzen der ID des Artikels
24
+        /// </summary>
25
+        public int ArticleID
26
+        {
27
+            get { return this.m_ArticleId; }
28
+            set { this.m_ArticleId = value; }
29
+        }
30
+
31
+        /// <summary>
32
+        /// Lesen oder Setzen der ID der Filiale
33
+        /// </summary>
34
+        public int BranchID
35
+        {
36
+            get { return this.m_BranchId; }
37
+            set { this.m_BranchId = value; }
38
+        }
39
+
40
+        /// <summary>
41
+        /// Lesen oder Setzen des Filialen BO
42
+        /// </summary>
43
+        public BranchesBO Branch
44
+        {
45
+            get { return m_Branch; }
46
+            set { m_Branch = value; }
47
+        }
48
+
49
+        /// <summary>
50
+        /// Name der Filiale
51
+        /// </summary>
52
+        /// <returns>Name der Filiale</returns>
53
+        public override string ToString()
54
+        {
55
+            if (m_Branch != null)
56
+                return Branch.Name;
57
+            else
58
+                return base.ToString();
59
+        }
60
+    }
61
+}

+ 139
- 0
LagerVerwaltung/Articles/BO/ArticlesBO.cs View File

@@ -0,0 +1,139 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Text;
4
+using System.Drawing;
5
+
6
+namespace LagerVerwaltung.Articles.BO
7
+{
8
+    /// <summary>
9
+    /// Objekt das die Daten eines Artikels enthält
10
+    /// </summary>
11
+    public class ArticlesBO
12
+    {
13
+        private int m_Id;
14
+        private int m_ArticleNr;
15
+        private String m_Name;
16
+        private double m_PriceVK = 0;
17
+        private double m_PriceEK = 0;
18
+        private String m_Supplier;
19
+        private int m_InStock = 0;
20
+        private bool m_Inactive = false;
21
+        private bool m_Deleted = false;
22
+        private bool m_BranchArticle = false;
23
+        private Dictionary<String, ArticleToBranchesBO> m_Branches = new Dictionary<string,ArticleToBranchesBO>();
24
+
25
+
26
+        /// <summary>
27
+        /// Konstruktor der Klasse
28
+        /// </summary>
29
+        public ArticlesBO() { }
30
+
31
+        /// <summary>
32
+        /// Setzen oder Lesen der ID des Eintrags
33
+        /// </summary>
34
+        public int ID
35
+        {
36
+            get { return this.m_Id; }
37
+            set { this.m_Id = value; }
38
+        }
39
+
40
+        /// <summary>
41
+        /// Setzen oder Lesen vom Name des Artikels
42
+        /// </summary>
43
+        public String Name
44
+        {
45
+            get { return this.m_Name; }
46
+            set { this.m_Name = value; }
47
+        }
48
+
49
+        /// <summary>
50
+        /// Setzen oder Lesen der Nummer des Artikels
51
+        /// </summary>
52
+        public int ArticleNr
53
+        {
54
+            get { return m_ArticleNr; }
55
+            set { m_ArticleNr = value; }
56
+        }
57
+
58
+        /// <summary>
59
+        /// Setzen oder Lesen des Verkaufspreises
60
+        /// </summary>
61
+        public double PriceVK
62
+        {
63
+            get { return m_PriceVK; }
64
+            set { m_PriceVK = value; }
65
+        }
66
+
67
+        /// <summary>
68
+        /// Setzen oder Lesen des Einkaufspreises
69
+        /// </summary>
70
+        public double PriceEK
71
+        {
72
+            get { return m_PriceEK; }
73
+            set { m_PriceEK = value; }
74
+        }
75
+
76
+        /// <summary>
77
+        /// Setzen oder Lesen des Herstellers
78
+        /// </summary>
79
+        public String Supplier
80
+        {
81
+            get { return m_Supplier; }
82
+            set { m_Supplier = value; }
83
+        }
84
+
85
+        /// <summary>
86
+        /// Setzen oder Lesen des Meldebestandes
87
+        /// </summary>
88
+        public int InStock
89
+        {
90
+            get { return m_InStock; }
91
+            set { m_InStock = value; }
92
+        }
93
+
94
+        /// <summary>
95
+        /// Setzen oder Lesen ob der Artikel inaktiv ist
96
+        /// </summary>
97
+        public bool InActive
98
+        {
99
+            get { return m_Inactive; }
100
+            set { m_Inactive = value; }
101
+        }
102
+
103
+        /// <summary>
104
+        /// Löschflag
105
+        /// </summary>
106
+        public bool Deleted
107
+        {
108
+            get { return m_Deleted; }
109
+            set { m_Deleted = value; }
110
+        }
111
+
112
+        /// <summary>
113
+        /// Lesen oder Setzen ob der Artikel ein Filialartikel ist
114
+        /// </summary>
115
+        public bool BranchArticle
116
+        {
117
+            get { return m_BranchArticle; }
118
+            set { m_BranchArticle = value; }
119
+        }
120
+
121
+        /// <summary>
122
+        /// Lesen oder Setzen der zugeordneten Filialen
123
+        /// </summary>
124
+        public Dictionary<String, ArticleToBranchesBO> Branches
125
+        {
126
+            get { return m_Branches; }
127
+            set { m_Branches = value; }
128
+        }
129
+
130
+        /// <summary>
131
+        /// Überspreiben der toString Funktion, gibt den Namen des Artikels zurück
132
+        /// </summary>
133
+        /// <returns>Name des Artikels</returns>
134
+        public override string ToString()
135
+        {
136
+            return this.Name;
137
+        }
138
+    }
139
+}

+ 48
- 0
LagerVerwaltung/Articles/BO/ArticlesInventoryBO.cs View File

@@ -0,0 +1,48 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Text;
4
+
5
+namespace LagerVerwaltung.Articles.BO
6
+{
7
+    /// <summary>
8
+    /// Objekt das die Zuordnung eines Artikels zu einer Filiale enthält
9
+    /// </summary>
10
+    public class ArticlesInventoryBO
11
+    {
12
+        private int m_ArticleID;
13
+        private int m_BranchID;
14
+        private int m_Quantity;
15
+
16
+        /// <summary>
17
+        /// Konstruktor der Klasse
18
+        /// </summary>
19
+        public ArticlesInventoryBO() { }
20
+
21
+        /// <summary>
22
+        /// Lesen oder Setzen der ArtikelID
23
+        /// </summary>
24
+        public int ArticleID
25
+        {
26
+            get { return this.m_ArticleID; }
27
+            set { this.m_ArticleID = value; }
28
+        }
29
+
30
+        /// <summary>
31
+        /// Lesen oder Setzen der FilialID
32
+        /// </summary>
33
+        public int BranchID
34
+        {
35
+            get { return this.m_BranchID; }
36
+            set { this.m_BranchID = value; }
37
+        }
38
+
39
+        /// <summary>
40
+        /// Lesen oder Setzen der Anzahl der Artikel in dieser Filiale
41
+        /// </summary>
42
+        public int Quantity
43
+        {
44
+            get { return this.m_Quantity; }
45
+            set { this.m_Quantity = value; }
46
+        }
47
+    }
48
+}

+ 132
- 0
LagerVerwaltung/Articles/DAL/ArticleToBranchesDAL.cs View File

@@ -0,0 +1,132 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Text;
4
+using LagerVerwaltung.Articles.BO;
5
+using FirebirdSql.Data.FirebirdClient;
6
+using System.Data;
7
+using LagerVerwaltung.Branches.BLL;
8
+using log4net;
9
+
10
+namespace LagerVerwaltung.Articles.DAL
11
+{
12
+    internal class ArticleToBranchesDAL
13
+    {
14
+        static ILog lg = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
15
+        public static int Insert(ArticleToBranchesBO articlebranch)
16
+        {
17
+            FbConnection dbCon = DatabaseService.Connection;
18
+            FbCommand cmd = new FbCommand(ArticleToBranchesDAL.InsertCommand(), dbCon);
19
+
20
+            try
21
+            {
22
+                //dbCon.Open();
23
+                cmd.Parameters.AddWithValue("@id_branch", articlebranch.BranchID);
24
+                cmd.Parameters.AddWithValue("@id_article", articlebranch.ArticleID);
25
+                return cmd.ExecuteNonQuery();
26
+            }
27
+            catch(Exception ex)
28
+            {
29
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
30
+                throw;
31
+            }
32
+            finally
33
+            {
34
+                cmd.Dispose();
35
+                //dbcon.Close();
36
+                //dbcon.Dispose();
37
+            }
38
+        }
39
+
40
+        public static int DeleteAllBranchesFromArticle(ArticlesBO article)
41
+        {
42
+            FbConnection dbCon = DatabaseService.Connection;
43
+            FbCommand cmd = new FbCommand(ArticleToBranchesDAL.DeleteCommand(), dbCon);
44
+
45
+            try
46
+            {
47
+                //dbCon.Open();
48
+                cmd.Parameters.AddWithValue("@id_article", article.ID);
49
+                return cmd.ExecuteNonQuery();
50
+            }
51
+            catch(Exception ex)
52
+            {
53
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
54
+                throw;
55
+            }
56
+            finally
57
+            {
58
+                cmd.Dispose();
59
+                //dbcon.Close();
60
+                //dbcon.Dispose();
61
+            }
62
+        }
63
+
64
+        public static Dictionary<String, ArticleToBranchesBO> GetBranchesByArticleID(int id)
65
+        {
66
+            FbConnection dbCon = DatabaseService.Connection;
67
+
68
+            try
69
+            {
70
+                //dbCon.Open();
71
+
72
+                FbDataAdapter da = new FbDataAdapter(ArticleToBranchesDAL.SelectCommandByArticleID(), dbCon);
73
+                da.SelectCommand.Parameters.AddWithValue("@id_article", id);
74
+                DataSet data = new DataSet();
75
+                da.Fill(data);
76
+                DataTable dt = data.Tables[0];
77
+                DataRowCollection rows = dt.Rows;
78
+
79
+                if (rows.Count == 0)
80
+                    return new Dictionary<String, ArticleToBranchesBO>();
81
+
82
+                Dictionary<String, ArticleToBranchesBO> retData = new Dictionary<String, ArticleToBranchesBO>();
83
+                for (int i = 0; i < rows.Count; i++)
84
+                {
85
+                    try
86
+                    {
87
+                        if (!retData.ContainsKey(rows[i]["name"].ToString())) {
88
+
89
+                            ArticleToBranchesBO tmp = new ArticleToBranchesBO();
90
+                            tmp.ArticleID = int.Parse(rows[i]["id_article"].ToString());
91
+                            tmp.BranchID = int.Parse(rows[i]["id_branch"].ToString());
92
+                            tmp.Branch = BranchesBLL.GetBranchByID(tmp.BranchID);
93
+                            
94
+                            retData.Add(rows[i]["name"].ToString(), tmp);
95
+                        }
96
+                    }
97
+                    catch(Exception ex) {
98
+                        lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
99
+                    }
100
+                }
101
+
102
+                return retData;
103
+            }
104
+            catch(Exception ex)
105
+            {
106
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
107
+                throw;
108
+            }
109
+            finally
110
+            {
111
+                //dbcon.Close();
112
+                //dbcon.Dispose();
113
+            }
114
+        }
115
+
116
+        private static String SelectCommandByArticleID()
117
+        {
118
+            return "SELECT a2b.*, b.name FROM article2branch a2b LEFT JOIN branches b ON(a2b.id_branch = b.id) WHERE a2b.id_article = @id_article ORDER BY b.name";
119
+        }
120
+
121
+        public static String InsertCommand()
122
+        {
123
+            return "INSERT INTO article2branch (id_branch, id_article) " +
124
+                         " VALUES (@id_branch, @id_article)";
125
+        }
126
+
127
+        public static String DeleteCommand()
128
+        {
129
+            return "DELETE FROM article2branch WHERE id_article = @id_article";
130
+        }
131
+    }
132
+}

+ 425
- 0
LagerVerwaltung/Articles/DAL/ArticlesDAL.cs View File

@@ -0,0 +1,425 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Text;
4
+using FirebirdSql.Data.FirebirdClient;
5
+using System.Data;
6
+using System.Drawing;
7
+using LagerVerwaltung;
8
+using System.Collections;
9
+using System.Windows.Forms;
10
+using log4net;
11
+using LagerVerwaltung.Articles.BLL;
12
+using LagerVerwaltung.Articles.BO;
13
+
14
+namespace LagerVerwaltung.Articles.DAL
15
+{
16
+    /// <summary>
17
+    /// Suchen, Hinzufügen, Aktualisieren und Löschen von Artikeln in der Datenbank
18
+    /// </summary>
19
+    internal static class ArticlesDAL
20
+    {
21
+        static ILog lg = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
22
+        /// <summary>
23
+        /// Neuen Artikel hinzufügen
24
+        /// </summary>
25
+        /// <param name="article">Artikelobjekt</param>
26
+        /// <returns>ID des neuen Artikels</returns>
27
+        public static int Insert(ArticlesBO article)
28
+        {
29
+            FbConnection dbCon = DatabaseService.Connection;
30
+            FbCommand cmd = new FbCommand(ArticlesDAL.InsertCommand(), dbCon);
31
+
32
+            try
33
+            {
34
+                cmd.Parameters.AddWithValue("@name", article.Name);
35
+                cmd.Parameters.AddWithValue("@article_number", article.ArticleNr);
36
+                cmd.Parameters.Add("@price_vk", FbDbType.Double);
37
+                cmd.Parameters["@price_vk"].Value = article.PriceVK;
38
+                cmd.Parameters.Add("@price_ek", FbDbType.Double);
39
+                cmd.Parameters["@price_ek"].Value = article.PriceEK;
40
+                cmd.Parameters.AddWithValue("@supplier", article.Supplier);
41
+                cmd.Parameters.AddWithValue("@in_stock", article.InStock.ToString());
42
+                cmd.Parameters.Add("@inactive", FbDbType.SmallInt);
43
+                cmd.Parameters["@inactive"].Value = article.InActive ? 1 : 0;
44
+                cmd.Parameters.Add("@deleted", FbDbType.SmallInt);
45
+                cmd.Parameters["@deleted"].Value = article.Deleted ? 1 : 0;
46
+                cmd.Parameters.Add("@isbrancharticle", FbDbType.SmallInt);
47
+                cmd.Parameters["@isbrancharticle"].Value = article.BranchArticle ? 1 : 0;
48
+                cmd.ExecuteNonQuery();
49
+
50
+                FbDataAdapter da = new FbDataAdapter(ArticlesDAL.GetLastInsertID(), dbCon);
51
+
52
+                DataSet data = new DataSet();
53
+                da.Fill(data);
54
+                DataTable dt = data.Tables[0];
55
+                DataRowCollection rows = dt.Rows;
56
+
57
+                foreach (KeyValuePair<String, ArticleToBranchesBO> tmp in article.Branches) {
58
+                    ArticleToBranchesBO obj = tmp.Value;
59
+                    obj.ArticleID = article.ID;
60
+                    ArticelToBranchesBLL.Insert(obj);
61
+                }
62
+
63
+                return int.Parse(rows[0]["id"].ToString());
64
+            }
65
+            catch(Exception ex)
66
+            {
67
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
68
+                throw;
69
+            }
70
+            finally
71
+            {
72
+                cmd.Dispose();
73
+            }
74
+        }
75
+
76
+        /// <summary>
77
+        /// Aktualisieren eines Artikels
78
+        /// </summary>
79
+        /// <param name="article">Artikelobjekt</param>
80
+        /// <returns>ID des aktualisierten Artikels</returns>
81
+        public static int Update(ArticlesBO article)
82
+        {
83
+            FbConnection dbCon = DatabaseService.Connection;
84
+            FbCommand cmd = new FbCommand(ArticlesDAL.UpdateCommand(), dbCon);
85
+
86
+            try
87
+            {
88
+                cmd.Parameters.AddWithValue("@id", article.ID);
89
+                cmd.Parameters.AddWithValue("@name", article.Name);
90
+                cmd.Parameters.AddWithValue("@article_number", article.ArticleNr);
91
+                cmd.Parameters.Add("@price_vk", FbDbType.Double);
92
+                cmd.Parameters["@price_vk"].Value = article.PriceVK;
93
+                cmd.Parameters.Add("@price_ek", FbDbType.Double);
94
+                cmd.Parameters["@price_ek"].Value = article.PriceEK;
95
+                cmd.Parameters.AddWithValue("@supplier", article.Supplier);
96
+                cmd.Parameters.AddWithValue("@in_stock", article.InStock.ToString());
97
+
98
+                cmd.Parameters.Add("@inactive", FbDbType.SmallInt);
99
+                cmd.Parameters["@inactive"].Value = article.InActive ? 1 : 0;
100
+                cmd.Parameters.Add("@deleted", FbDbType.SmallInt);
101
+                cmd.Parameters["@deleted"].Value = article.Deleted ? 1 : 0;
102
+                cmd.Parameters.Add("@isbrancharticle", FbDbType.SmallInt);
103
+                cmd.Parameters["@isbrancharticle"].Value = article.BranchArticle ? 1 : 0;
104
+
105
+                ArticelToBranchesBLL.DeleteAllBranchesFromArticle(article);
106
+
107
+                foreach (KeyValuePair<String, ArticleToBranchesBO> tmp in article.Branches)
108
+                {
109
+                    ArticleToBranchesBO obj = tmp.Value;
110
+                    obj.ArticleID = article.ID;
111
+                    ArticelToBranchesBLL.Insert(obj);
112
+                }
113
+
114
+                return cmd.ExecuteNonQuery();
115
+            }
116
+            catch(Exception ex)
117
+            {
118
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
119
+                throw;
120
+            }
121
+            finally
122
+            {
123
+                cmd.Dispose();
124
+            }
125
+        }
126
+
127
+        /// <summary>
128
+        /// Löschen eines Artikels
129
+        /// </summary>
130
+        /// <param name="article">Artikelobjekt</param>
131
+        /// <returns>ID des gelöschten Artikels</returns>
132
+        public static int Delete(ArticlesBO article)
133
+        {
134
+            FbConnection dbcon = DatabaseService.Connection;
135
+            FbCommand cmd = new FbCommand(ArticlesDAL.DeleteCommand(), dbcon);
136
+
137
+            try
138
+            {
139
+                cmd.Parameters.AddWithValue("@id", article.ID);
140
+                return cmd.ExecuteNonQuery();
141
+            }
142
+            catch(Exception ex)
143
+            {
144
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
145
+                throw;
146
+            }
147
+            finally
148
+            {
149
+                cmd.Dispose();
150
+            }
151
+        }
152
+
153
+        /// <summary>
154
+        /// Setzen des Artikel-Löschflags
155
+        /// </summary>
156
+        /// <param name="article">Artikelobjekt</param>
157
+        /// <returns>ID des gelöschten Artikels</returns>
158
+        public static int DeleteFlag(ArticlesBO article)
159
+        {
160
+            FbConnection dbcon = DatabaseService.Connection;
161
+            FbCommand cmd = new FbCommand(ArticlesDAL.DeleteFlagCommand(), dbcon);
162
+
163
+            try {
164
+                cmd.Parameters.AddWithValue("@id", article.ID);
165
+                cmd.Parameters.AddWithValue("@deleted", true);
166
+                return cmd.ExecuteNonQuery();
167
+            } catch (Exception ex) {
168
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
169
+                throw;
170
+            }
171
+            finally {
172
+                cmd.Dispose();
173
+            }
174
+        }
175
+
176
+        /// <summary>
177
+        /// Gibt einen bestimmten Artikel zurück
178
+        /// </summary>
179
+        /// <param name="id">Die ID des Artikels</param>
180
+        /// <returns>Artikelobjekt</returns>
181
+        public static ArticlesBO GetArticleByID(int id)
182
+        {
183
+            FbConnection dbcon = DatabaseService.Connection;
184
+
185
+            try
186
+            {
187
+                FbDataAdapter da = new FbDataAdapter(ArticlesDAL.SelectCommandByID(), dbcon);
188
+                da.SelectCommand.Parameters.AddWithValue("@id", id);
189
+                DataSet data = new DataSet();
190
+                da.Fill(data);
191
+                DataTable dt = data.Tables[0];
192
+                DataRowCollection rows = dt.Rows;
193
+
194
+                if (rows.Count == 0)
195
+                    return null;
196
+
197
+                ArticlesBO tmp = new ArticlesBO();
198
+
199
+                try
200
+                {
201
+                    tmp.ID = (int)rows[0]["id"];
202
+                    tmp.Name = (string)rows[0]["name"];
203
+                    tmp.ArticleNr = int.Parse(rows[0]["article_number"].ToString());
204
+                    tmp.PriceEK = (double)Convert.ToDouble(rows[0]["price_ek"].ToString());
205
+                    tmp.PriceVK = (double)Convert.ToDouble(rows[0]["price_vk"].ToString());
206
+                    tmp.Supplier = (string)rows[0]["supplier"];
207
+                    tmp.InStock = (int)rows[0]["in_stock"];
208
+                    //tmp.InActive = rows[0]["inactive"].ToString() == "1" ? true : false;
209
+                    //tmp.Deleted = rows[0]["deleted"].ToString() == "1" ? true : false;
210
+                    tmp.InActive = rows[0]["inactive"].ToString() == "1";
211
+                    tmp.Deleted = rows[0]["deleted"].ToString() == "1";
212
+                    tmp.BranchArticle = rows[0]["isbrancharticle"].ToString() == "1";
213
+                    tmp.Branches = ArticleToBranchesDAL.GetBranchesByArticleID(tmp.ID);
214
+
215
+                }
216
+                catch (Exception ex)
217
+                {
218
+                    lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
219
+                    ExceptionHandler handler = new ExceptionHandler(ex, "An Error occured processing the return value");
220
+                    DialogResult res = handler.ShowDialog();
221
+                }
222
+
223
+                return tmp;
224
+            }
225
+            catch(Exception ex)
226
+            {
227
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
228
+                throw;
229
+            }
230
+        }
231
+
232
+        /// <summary>
233
+        /// Gibt alle Artikel zurrück
234
+        /// </summary>
235
+        /// <returns>Liste aller eingepflegten Artikel</returns>
236
+        public static Dictionary<int, ArticlesBO> GetArticles(bool showHiddenArticles)
237
+        {
238
+            FbConnection dbcon = DatabaseService.Connection;
239
+
240
+            try
241
+            {
242
+                FbDataAdapter da = new FbDataAdapter(ArticlesDAL.SelectCommand(showHiddenArticles), dbcon);
243
+                DataSet data = new DataSet();
244
+                da.Fill(data);
245
+                DataTable dt = data.Tables[0];
246
+                DataRowCollection rows = dt.Rows;
247
+
248
+                Dictionary<int, ArticlesBO> articles = new Dictionary<int, ArticlesBO>();
249
+
250
+                if (rows.Count == 0)
251
+                    return articles;
252
+
253
+                try
254
+                {
255
+                    for (int i = 0; i < rows.Count; i++)
256
+                    {
257
+                        ArticlesBO tmp = new ArticlesBO();
258
+                        tmp.ID = (int)rows[i]["id"];
259
+                        tmp.Name = (string)rows[i]["name"];
260
+                        tmp.ArticleNr = int.Parse(rows[i]["article_number"].ToString());
261
+                        tmp.PriceEK = (double)Convert.ToDouble(rows[i]["price_ek"].ToString());
262
+                        tmp.PriceVK = (double)Convert.ToDouble(rows[i]["price_vk"].ToString());
263
+                        tmp.Supplier = (string)rows[i]["supplier"];
264
+                        tmp.InStock = (int)rows[i]["in_stock"];
265
+                        // tmp.InActive = rows[i]["inactive"].ToString() == "1" ? true : false;
266
+                        tmp.InActive = rows[i]["inactive"].ToString() == "1";
267
+                        tmp.Deleted = rows[i]["deleted"].ToString() == "1";
268
+                        tmp.BranchArticle = rows[i]["isbrancharticle"].ToString() == "1";
269
+                        tmp.Branches = ArticleToBranchesDAL.GetBranchesByArticleID(tmp.ID);
270
+
271
+                        articles.Add(tmp.ID, tmp);
272
+                        tmp = null;
273
+                    }
274
+                }
275
+                catch (Exception ex)
276
+                {
277
+                    lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
278
+                    ExceptionHandler handler = new ExceptionHandler(ex, "An Error occured processing the return value");
279
+                    DialogResult res = handler.ShowDialog();
280
+                }
281
+
282
+                return articles;
283
+            }
284
+            catch(Exception ex)
285
+            {
286
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
287
+                throw;
288
+            }
289
+        }
290
+
291
+        /// <summary>
292
+        /// Sucht Artikel anhand eines Namens
293
+        /// </summary>
294
+        /// <param name="name">Name des/der gesuchten Artikel</param>
295
+        /// <returns>Liste der passenden Artikel</returns>
296
+        public static List<ArticlesBO> SearchArticle(String name, bool showHiddenArticles)
297
+        {
298
+            FbConnection dbcon = DatabaseService.Connection;
299
+
300
+            try
301
+            {
302
+                FbDataAdapter da = new FbDataAdapter(ArticlesDAL.SearchCommand(showHiddenArticles), dbcon);
303
+                da.SelectCommand.Parameters.AddWithValue("@name", name);
304
+                DataSet data = new DataSet();
305
+                da.Fill(data);
306
+                DataTable dt = data.Tables[0];
307
+                DataRowCollection rows = dt.Rows;
308
+
309
+                List<ArticlesBO> articles = new List<ArticlesBO>();
310
+                if (rows.Count == 0)
311
+                    return articles;
312
+
313
+                for (int i = 0; i < rows.Count; i++)
314
+                {
315
+                    ArticlesBO tmp = new ArticlesBO();
316
+                    tmp.ID = int.Parse(rows[i]["id"].ToString());
317
+                    tmp.Name = rows[i]["name"].ToString();
318
+                    tmp.ArticleNr = int.Parse(rows[i]["article_number"].ToString());
319
+                    tmp.PriceEK = (double)Convert.ToDouble(rows[i]["price_ek"].ToString());
320
+                    tmp.PriceVK = (double)Convert.ToDouble(rows[i]["price_vk"].ToString());
321
+                    tmp.Supplier = rows[i]["supplier"].ToString();
322
+                    tmp.InStock = int.Parse(rows[i]["in_stock"].ToString());
323
+                    //tmp.InActive = rows[i]["inactive"].ToString() == "1" ? true : false;
324
+                    //tmp.BranchArticle = rows[i]["isbrancharticle"].ToString() == "1" ? true : false;
325
+                    tmp.InActive = rows[i]["inactive"].ToString() == "1";
326
+                    tmp.BranchArticle = rows[i]["isbrancharticle"].ToString() == "1";
327
+
328
+                    articles.Add(tmp);
329
+                    tmp = null;
330
+                }
331
+
332
+                return articles;
333
+            }
334
+            catch(Exception ex)
335
+            {
336
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
337
+                throw;
338
+            }
339
+        }
340
+
341
+        /// <summary>
342
+        /// SQL-Statement um alle Artikel auszuwählen
343
+        /// </summary>
344
+        /// <returns>SQL-Statement</returns>
345
+        private static String SelectCommand(bool showHiddenArticles)
346
+        {
347
+            // Artikel mit gesetztem Lösch-Flag werden nie ausgegeben
348
+            if(showHiddenArticles)
349
+                return "SELECT a.* FROM articles a WHERE a.deleted = 0 ORDER BY a.name";
350
+            else
351
+                return "SELECT a.* FROM articles a WHERE a.deleted = 0 AND \"INACTIVE\" = 0 ORDER BY a.name";
352
+        }
353
+
354
+        /// <summary>
355
+        /// SQL-Statement um einen Artikel auszuwählen
356
+        /// </summary>
357
+        /// <returns>SQL-Statement</returns>
358
+        private static String SelectCommandByID()
359
+        {
360
+            // hier kann auch ein Artikel mit gesetztem Lösch-Flag zurückgegeben werden 
361
+            //  (z.B. wenn mal über das Programmm eine Löschung rückgängig gemacht werden soll)
362
+            return "SELECT FIRST 1 a.* FROM articles a WHERE a.id = @id";
363
+        }
364
+
365
+        /// <summary>
366
+        /// SQL-Statement um die zuletzt eingefügte ID zu ermitteln
367
+        /// </summary>
368
+        /// <returns>SQL-Statement</returns>
369
+        private static String GetLastInsertID()
370
+        {
371
+            return "select gen_id(GEN_ARTICLE_ID, 0) as id from rdb$database";
372
+        }
373
+
374
+        /// <summary>
375
+        /// SQL-Statement um nach Artikeln anhand des Namens zu suchen
376
+        /// </summary>
377
+        /// <returns>SQL-Statement</returns>
378
+        private static String SearchCommand(bool showHiddenArticles)
379
+        {
380
+            // Artikel mit gesetztem Lösch-Flag werden nie ausgegeben
381
+            if (showHiddenArticles)
382
+                return "SELECT a.* FROM articles a WHERE a.deleted = 0 AND a.name CONTAINING @name ORDER BY a.name";
383
+            else
384
+                return "SELECT a.* FROM articles a WHERE a.deleted = 0 AND a.name CONTAINING @name AND \"INACTIVE\" = 0 ORDER BY a.name";
385
+        }
386
+
387
+        /// <summary>
388
+        /// SQL-Statement um einen neuen Artikel einzufügen
389
+        /// </summary>
390
+        /// <returns>SQL-Statement</returns>
391
+        private static String InsertCommand()
392
+        {
393
+            return "INSERT INTO articles (article_number, name, price_vk, price_ek, supplier, in_stock, \"INACTIVE\", isbrancharticle, deleted ) " +
394
+                         " VALUES (@article_number, @name, @price_vk, @price_ek, @supplier, @in_stock, @inactive, @isbrancharticle, @deleted )";
395
+        }
396
+
397
+        /// <summary>
398
+        /// SQL-Statement um einen Artikel zu löschen
399
+        /// </summary>
400
+        /// <returns>SQL-Statement</returns>
401
+        private static String DeleteCommand()
402
+        {
403
+            return "DELETE FROM articles WHERE id = @id";
404
+        }
405
+
406
+        /// <summary>
407
+        /// SQL-Statement um das deleted-Flag in einen Artikel zu setzen
408
+        /// </summary>
409
+        /// <returns>SQL-Statement</returns>
410
+        private static String DeleteFlagCommand()
411
+        {
412
+            return "UPDATE articles SET deleted = @deleted WHERE id = @id";
413
+        }
414
+
415
+        /// <summary>
416
+        /// SQL-Statement um einen Artikel zu aktualisieren
417
+        /// </summary>
418
+        /// <returns>SQL-Statement</returns>
419
+        private static String UpdateCommand()
420
+        {
421
+            return "UPDATE articles SET article_number = @article_number, name = @name, price_vk = @price_vk, price_ek = @price_ek, supplier = @supplier, in_stock = @in_stock, \"INACTIVE\" = @inactive, isbrancharticle = @isbrancharticle, deleted = @deleted WHERE id = @id";
422
+        }
423
+
424
+    }
425
+}

+ 190
- 0
LagerVerwaltung/Articles/DAL/ArticlesInventoryDAL.cs View File

@@ -0,0 +1,190 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using System.Text;
4
+using LagerVerwaltung.Articles.BO;
5
+using FirebirdSql.Data.FirebirdClient;
6
+using System.Data;
7
+using log4net;
8
+
9
+namespace LagerVerwaltung.Articles.DAL
10
+{
11
+    /// <summary>
12
+    /// Suchen, Hinzufügen, Aktualisieren und Löschen von Artikeln die einer Filiale zugeordnet sind
13
+    /// </summary>
14
+    internal class ArticlesInventoryDAL
15
+    {
16
+        static ILog lg = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
17
+        /// <summary>
18
+        /// Neuen Artikeleintrag hinzufügen
19
+        /// </summary>
20
+        /// <param name="articleEntry">Artikelobjekt</param>
21
+        /// <returns>ID des neuen Artikeleintrages</returns>
22
+        public static int Insert(ArticlesInventoryBO articleEntry)
23
+        {
24
+            FbConnection dbCon = DatabaseService.Connection;
25
+            FbCommand cmd = new FbCommand(ArticlesInventoryDAL.InsertCommand(), dbCon);
26
+
27
+            try {
28
+                //dbCon.Open();
29
+                cmd.Parameters.AddWithValue("@id_branch", articleEntry.BranchID.ToString());
30
+                cmd.Parameters.AddWithValue("@id_article", articleEntry.ArticleID.ToString());
31
+                cmd.Parameters.AddWithValue("@quantity", articleEntry.Quantity.ToString());
32
+
33
+                return cmd.ExecuteNonQuery();
34
+            } catch (Exception ex) {
35
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
36
+                throw;
37
+            }
38
+            finally {
39
+                cmd.Dispose();
40
+                //dbcon.Close();
41
+                //dbcon.Dispose();
42
+            }
43
+        }
44
+
45
+        /// <summary>
46
+        /// Aktualisieren eines Artikeleintrags
47
+        /// </summary>
48
+        /// <param name="articleEntry">Artikelobjekt</param>
49
+        /// <returns>ID des aktualisierten Artikeleintrags</returns>
50
+        public static int Update(ArticlesInventoryBO articleEntry)
51
+        {
52
+            FbConnection dbCon = DatabaseService.Connection;
53
+            FbCommand cmd = new FbCommand(ArticlesInventoryDAL.UpdateCommand(), dbCon);
54
+
55
+            try {
56
+                //dbCon.Open();
57
+                cmd.Parameters.AddWithValue("@id_branch", articleEntry.BranchID.ToString());
58
+                cmd.Parameters.AddWithValue("@id_article", articleEntry.ArticleID.ToString());
59
+                cmd.Parameters.AddWithValue("@quantity", articleEntry.Quantity.ToString());
60
+
61
+                return cmd.ExecuteNonQuery();
62
+            } catch (Exception ex) {
63
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
64
+                throw;
65
+            }
66
+            finally {
67
+                cmd.Dispose();
68
+                //dbcon.Close();
69
+                //dbcon.Dispose();
70
+            }
71
+        }
72
+
73
+        /// <summary>
74
+        /// Löschen eines Artikeleintrags
75
+        /// </summary>
76
+        /// <param name="articleEntry">Artikelobjekt</param>
77
+        /// <returns>ID des gelöschten Artikeleintrags</returns>
78
+        public static int Delete(ArticlesInventoryBO articleEntry)
79
+        {
80
+            FbConnection dbCon = DatabaseService.Connection;
81
+            FbCommand cmd = new FbCommand(ArticlesInventoryDAL.DeleteCommand(), dbCon);
82
+
83
+            try {
84
+                //dbCon.Open();
85
+                cmd.Parameters.AddWithValue("@id_branch", articleEntry.BranchID.ToString());
86
+                cmd.Parameters.AddWithValue("@id_article", articleEntry.ArticleID.ToString());
87
+                return cmd.ExecuteNonQuery();
88
+            } catch (Exception ex) {
89
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
90
+                throw;
91
+            }
92
+            finally {
93
+                cmd.Dispose();
94
+                //dbcon.Close();
95
+                //dbcon.Dispose();
96
+            }
97
+        }
98
+
99
+        /// <summary>
100
+        /// Gibt die Anzahl der Artikel in einer Filiale zurück
101
+        /// </summary>
102
+        /// <param name="branch_id">ID der Filiale</param>
103
+        /// <param name="article_id">ID des Artikels</param>
104
+        /// <returns>Gibt ein Objekt zurück das Informationen zum gefunden Eintrag enthält</returns>
105
+        public static ArticlesInventoryBO GetArticleQuantityOfBranch(int branch_id, int article_id)
106
+        {
107
+            FbConnection dbCon = DatabaseService.Connection;
108
+
109
+            try {
110
+                //dbCon.Open();
111
+
112
+                DataTable dt;
113
+                DataRowCollection rows;
114
+                int cnt = 0;
115
+                do {
116
+                    FbDataAdapter da = new FbDataAdapter(ArticlesInventoryDAL.SelectCommandArticleQuantity(), dbCon);
117
+                    da.SelectCommand.Parameters.AddWithValue("@id_branch", branch_id);
118
+                    da.SelectCommand.Parameters.AddWithValue("@id_article", article_id);
119
+
120
+                    DataSet data = new DataSet();
121
+                    da.Fill(data);
122
+                    dt = data.Tables[0];
123
+                    rows = dt.Rows;
124
+
125
+                    // Eintrag muss existieren, ggf hier mit Bestand 0 neu anlegen
126
+                    if (rows.Count == 0) {
127
+                        Insert(new ArticlesInventoryBO() { ArticleID = article_id, BranchID = branch_id, Quantity = 0 });
128
+                    }
129
+                } while (rows.Count == 0 && cnt++ < 3);
130
+
131
+                if (rows.Count == 0) throw new Exception("Artikel-Bestand konnte nicht initialisiert werden.");
132
+
133
+                // HE 11.11.15: ab jetzt mit Initialisierung in Schleife: null darf nicht zurückgegeben werden, ein Eintrag im Inventory wird erwartet!
134
+                //if (rows.Count == 0)
135
+                //    return null;
136
+
137
+                ArticlesInventoryBO tmp = new ArticlesInventoryBO();
138
+                tmp.BranchID = int.Parse(rows[0]["id_branch"].ToString());
139
+                tmp.ArticleID = int.Parse(rows[0]["id_article"].ToString());
140
+                tmp.Quantity = int.Parse(rows[0]["quantity"].ToString());
141
+
142
+                return tmp;
143
+            } catch (Exception ex) {
144
+                lg.Error(Pp.Basic.Func.GetExceptionText(ex, true));
145
+                throw;
146
+            }
147
+            finally {
148
+                //dbcon.Close();
149
+                //dbcon.Dispose();
150
+            }
151
+        }
152
+
153
+        /// <summary>
154
+        /// SQL-Statement um die Anzahl der Artikel einer Filiale zu erhalten
155
+        /// </summary>
156
+        /// <returns>SQL-Statement</returns>
157
+        private static String SelectCommandArticleQuantity()
158
+        {
159
+            return "SELECT a.* FROM article_inventory a WHERE id_branch = @id_branch AND id_article = @id_article";
160
+        }
161
+
162
+        /// <summary>
163
+        /// SQL-Statement um einen neuen ArtikelEintrag einzufügen
164
+        /// </summary>
165
+        /// <returns>SQL-Statement</returns>
166
+        private static String InsertCommand()
167
+        {
168
+            return "INSERT INTO article_inventory (id_branch, id_article, quantity) " +
169
+                         " VALUES (@id_branch, @id_article, @quantity)";
170
+        }
171
+
172
+        /// <summary>
173
+        /// SQL-Statement um einen ArtikelEintrag zu löschen
174
+        /// </summary>
175
+        /// <returns>SQL-Statement</returns>
176
+        private static String DeleteCommand()
177
+        {
178
+            return "DELETE FROM article_inventory WHERE id_branch = @id_branch AND id_article = @id_article";
179
+        }
180
+
181
+        /// <summary>
182
+        /// SQL-Statement um einen ArtikelEintrag zu aktualisieren
183
+        /// </summary>
184
+        /// <returns>SQL-Statement</returns>
185
+        private static String UpdateCommand()
186
+        {
187
+            return "UPDATE article_inventory SET quantity = @quantity WHERE id_branch = @id_branch AND id_article = @id_article";
188
+        }
189
+    }
190
+}

+ 274
- 0
LagerVerwaltung/Articles/EditArticle.Designer.cs View File

@@ -0,0 +1,274 @@
1
+namespace LagerVerwaltung.Articles
2
+{
3
+    partial class EditArticle
4
+    {
5
+        /// <summary>
6
+        /// Erforderliche Designervariable.
7
+        /// </summary>
8
+        private System.ComponentModel.IContainer components = null;
9
+
10
+        /// <summary>
11
+        /// Verwendete Ressourcen bereinigen.
12
+        /// </summary>
13
+        /// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
14
+        protected override void Dispose(bool disposing)
15
+        {
16
+            if (disposing && (components != null))
17
+            {
18
+                components.Dispose();
19
+            }
20
+            base.Dispose(disposing);
21
+        }
22
+
23
+        #region Vom Windows Form-Designer generierter Code
24
+
25
+        /// <summary>
26
+        /// Erforderliche Methode für die Designerunterstützung.
27
+        /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
28
+        /// </summary>
29
+        private void InitializeComponent()
30
+        {
31
+            this.components = new System.ComponentModel.Container();
32
+            System.Windows.Forms.Label label1;
33
+            System.Windows.Forms.Label label2;
34
+            System.Windows.Forms.Label label3;
35
+            System.Windows.Forms.Label label4;
36
+            System.Windows.Forms.Label label5;
37
+            System.Windows.Forms.Label label6;
38
+            System.Windows.Forms.Label label7;
39
+            this.btn_Save = new System.Windows.Forms.Button();
40
+            this.btn_Cancel = new System.Windows.Forms.Button();
41
+            this.tb_Number = new System.Windows.Forms.TextBox();
42
+            this.tb_Name = new System.Windows.Forms.TextBox();
43
+            this.tb_PriceVK = new System.Windows.Forms.TextBox();
44
+            this.tb_PriceEK = new System.Windows.Forms.TextBox();
45
+            this.tb_Supplier = new System.Windows.Forms.TextBox();
46
+            this.tb_InStock = new System.Windows.Forms.TextBox();
47
+            this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
48
+            this.cb_ArticleInactiv = new System.Windows.Forms.CheckBox();
49
+            this.cb_BranchArticle = new System.Windows.Forms.CheckBox();
50
+            this.clb_Articel2Branches = new System.Windows.Forms.CheckedListBox();
51
+            label1 = new System.Windows.Forms.Label();
52
+            label2 = new System.Windows.Forms.Label();
53
+            label3 = new System.Windows.Forms.Label();
54
+            label4 = new System.Windows.Forms.Label();
55
+            label5 = new System.Windows.Forms.Label();
56
+            label6 = new System.Windows.Forms.Label();
57
+            label7 = new System.Windows.Forms.Label();
58
+            ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
59
+            this.SuspendLayout();
60
+            // 
61
+            // label1
62
+            // 
63
+            label1.AutoSize = true;
64
+            label1.Location = new System.Drawing.Point(12, 12);
65
+            label1.Name = "label1";
66
+            label1.Size = new System.Drawing.Size(49, 13);
67
+            label1.TabIndex = 2;
68
+            label1.Text = "Nummer:";
69
+            //