Bläddra i källkod

Add BulkReExport permission.

Andrew Klopper 8 år sedan
förälder
incheckning
b770e1d789

+ 297 - 0
BulkPrintingAPI/Migrations/20170928093801_AddBulkReExport.Designer.cs

@@ -0,0 +1,297 @@
1
+using System;
2
+using Microsoft.EntityFrameworkCore;
3
+using Microsoft.EntityFrameworkCore.Infrastructure;
4
+using Microsoft.EntityFrameworkCore.Metadata;
5
+using Microsoft.EntityFrameworkCore.Migrations;
6
+using MAX.Models;
7
+
8
+namespace BulkPrintingAPI.Migrations
9
+{
10
+    [DbContext(typeof(MAXContext))]
11
+    [Migration("20170928093801_AddBulkReExport")]
12
+    partial class AddBulkReExport
13
+    {
14
+        protected override void BuildTargetModel(ModelBuilder modelBuilder)
15
+        {
16
+            modelBuilder
17
+                .HasAnnotation("ProductVersion", "1.1.2")
18
+                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
19
+
20
+            modelBuilder.Entity("MAX.Models.Account", b =>
21
+                {
22
+                    b.Property<int>("Id");
23
+
24
+                    b.Property<decimal>("Balance");
25
+
26
+                    b.Property<string>("Name")
27
+                        .IsRequired()
28
+                        .HasMaxLength(50);
29
+
30
+                    b.Property<string>("Reference")
31
+                        .IsRequired()
32
+                        .HasMaxLength(50);
33
+
34
+                    b.Property<int>("Status");
35
+
36
+                    b.Property<int>("WarehouseId");
37
+
38
+                    b.HasKey("Id");
39
+
40
+                    b.HasIndex("WarehouseId");
41
+
42
+                    b.ToTable("Accounts");
43
+                });
44
+
45
+            modelBuilder.Entity("MAX.Models.Batch", b =>
46
+                {
47
+                    b.Property<int>("Id");
48
+
49
+                    b.Property<int>("AccountId");
50
+
51
+                    b.Property<decimal>("Cost");
52
+
53
+                    b.Property<int>("DeliveredQuantity");
54
+
55
+                    b.Property<decimal>("DiscountPercentage");
56
+
57
+                    b.Property<decimal>("FaceValue");
58
+
59
+                    b.Property<int>("NetworkId");
60
+
61
+                    b.Property<string>("NetworkName")
62
+                        .IsRequired()
63
+                        .HasMaxLength(20);
64
+
65
+                    b.Property<DateTimeOffset>("OrderDate");
66
+
67
+                    b.Property<Guid?>("OrderGuid");
68
+
69
+                    b.Property<string>("OrderReference")
70
+                        .IsRequired()
71
+                        .HasMaxLength(20);
72
+
73
+                    b.Property<int>("OrderedById");
74
+
75
+                    b.Property<string>("ProductDescription")
76
+                        .IsRequired()
77
+                        .HasMaxLength(50);
78
+
79
+                    b.Property<int>("ProductId");
80
+
81
+                    b.Property<bool>("ReadyForDownload");
82
+
83
+                    b.Property<int>("RequestedQuantity");
84
+
85
+                    b.Property<int>("VendorId");
86
+
87
+                    b.Property<int>("VoucherType");
88
+
89
+                    b.HasKey("Id");
90
+
91
+                    b.HasIndex("AccountId");
92
+
93
+                    b.HasIndex("OrderGuid")
94
+                        .IsUnique();
95
+
96
+                    b.HasIndex("ReadyForDownload", "OrderDate");
97
+
98
+                    b.ToTable("Batches");
99
+                });
100
+
101
+            modelBuilder.Entity("MAX.Models.User", b =>
102
+                {
103
+                    b.Property<int>("Id");
104
+
105
+                    b.Property<int>("AccountId");
106
+
107
+                    b.Property<bool>("BulkExport");
108
+
109
+                    b.Property<decimal>("BulkExportMaxValue");
110
+
111
+                    b.Property<bool>("BulkOrder");
112
+
113
+                    b.Property<decimal>("BulkOrderMaxValue");
114
+
115
+                    b.Property<bool>("BulkReExport");
116
+
117
+                    b.Property<bool>("BulkViewPins");
118
+
119
+                    b.Property<bool>("CanPrintOffline");
120
+
121
+                    b.Property<bool>("CanPrintOnline");
122
+
123
+                    b.Property<bool>("CanReprintOffline");
124
+
125
+                    b.Property<bool>("CanReprintOnline");
126
+
127
+                    b.Property<bool>("Enabled");
128
+
129
+                    b.Property<string>("FirstName")
130
+                        .IsRequired()
131
+                        .HasMaxLength(50);
132
+
133
+                    b.Property<DateTimeOffset>("LastLogin");
134
+
135
+                    b.Property<int>("Level");
136
+
137
+                    b.Property<decimal>("OfflinePrintValue");
138
+
139
+                    b.Property<decimal>("OfflineReprintValue");
140
+
141
+                    b.Property<decimal>("OnlinePrintValue");
142
+
143
+                    b.Property<decimal>("OnlineReprintValue");
144
+
145
+                    b.Property<string>("Surname")
146
+                        .IsRequired()
147
+                        .HasMaxLength(50);
148
+
149
+                    b.Property<int>("System");
150
+
151
+                    b.Property<string>("Username")
152
+                        .IsRequired()
153
+                        .HasMaxLength(50);
154
+
155
+                    b.HasKey("Id");
156
+
157
+                    b.HasIndex("AccountId");
158
+
159
+                    b.ToTable("Users");
160
+                });
161
+
162
+            modelBuilder.Entity("MAX.Models.Vendor", b =>
163
+                {
164
+                    b.Property<int>("Id");
165
+
166
+                    b.Property<int>("AccountId");
167
+
168
+                    b.Property<byte[]>("EncryptedDatabasePassword")
169
+                        .IsRequired()
170
+                        .HasMaxLength(32);
171
+
172
+                    b.Property<byte[]>("EncryptedVoucherKey")
173
+                        .IsRequired()
174
+                        .HasMaxLength(32);
175
+
176
+                    b.Property<int?>("LastVendorEventRemoteId");
177
+
178
+                    b.Property<string>("SerialNumber")
179
+                        .IsRequired()
180
+                        .HasMaxLength(50);
181
+
182
+                    b.HasKey("Id");
183
+
184
+                    b.HasIndex("AccountId");
185
+
186
+                    b.ToTable("Vendors");
187
+                });
188
+
189
+            modelBuilder.Entity("MAX.Models.VendorEvent", b =>
190
+                {
191
+                    b.Property<int>("Id")
192
+                        .ValueGeneratedOnAdd();
193
+
194
+                    b.Property<DateTimeOffset>("EventDate");
195
+
196
+                    b.Property<int>("EventType");
197
+
198
+                    b.Property<int?>("RemoteId");
199
+
200
+                    b.Property<bool>("Retry");
201
+
202
+                    b.Property<int>("UserId");
203
+
204
+                    b.Property<int>("VendorId");
205
+
206
+                    b.Property<int?>("VoucherId");
207
+
208
+                    b.HasKey("Id");
209
+
210
+                    b.HasIndex("VendorId", "RemoteId")
211
+                        .IsUnique();
212
+
213
+                    b.ToTable("VendorEvents");
214
+                });
215
+
216
+            modelBuilder.Entity("MAX.Models.Voucher", b =>
217
+                {
218
+                    b.Property<int>("Id");
219
+
220
+                    b.Property<int>("BatchId");
221
+
222
+                    b.Property<string>("EncryptedPIN")
223
+                        .IsRequired()
224
+                        .HasMaxLength(50);
225
+
226
+                    b.Property<DateTime>("ExpiryDate")
227
+                        .HasColumnType("Date");
228
+
229
+                    b.Property<int>("SequenceNumber");
230
+
231
+                    b.Property<string>("Serial")
232
+                        .IsRequired()
233
+                        .HasMaxLength(50);
234
+
235
+                    b.HasKey("Id");
236
+
237
+                    b.HasIndex("BatchId", "SequenceNumber")
238
+                        .IsUnique();
239
+
240
+                    b.ToTable("Vouchers");
241
+                });
242
+
243
+            modelBuilder.Entity("MAX.Models.Warehouse", b =>
244
+                {
245
+                    b.Property<int>("Id");
246
+
247
+                    b.Property<string>("Name")
248
+                        .IsRequired()
249
+                        .HasMaxLength(50);
250
+
251
+                    b.HasKey("Id");
252
+
253
+                    b.ToTable("Warehouses");
254
+                });
255
+
256
+            modelBuilder.Entity("MAX.Models.Account", b =>
257
+                {
258
+                    b.HasOne("MAX.Models.Warehouse", "Warehouse")
259
+                        .WithMany("Accounts")
260
+                        .HasForeignKey("WarehouseId")
261
+                        .OnDelete(DeleteBehavior.Cascade);
262
+                });
263
+
264
+            modelBuilder.Entity("MAX.Models.Batch", b =>
265
+                {
266
+                    b.HasOne("MAX.Models.Account", "Account")
267
+                        .WithMany()
268
+                        .HasForeignKey("AccountId")
269
+                        .OnDelete(DeleteBehavior.Cascade);
270
+                });
271
+
272
+            modelBuilder.Entity("MAX.Models.User", b =>
273
+                {
274
+                    b.HasOne("MAX.Models.Account", "Account")
275
+                        .WithMany("Users")
276
+                        .HasForeignKey("AccountId")
277
+                        .OnDelete(DeleteBehavior.Cascade);
278
+                });
279
+
280
+            modelBuilder.Entity("MAX.Models.Vendor", b =>
281
+                {
282
+                    b.HasOne("MAX.Models.Account", "Account")
283
+                        .WithMany("Vendors")
284
+                        .HasForeignKey("AccountId")
285
+                        .OnDelete(DeleteBehavior.Cascade);
286
+                });
287
+
288
+            modelBuilder.Entity("MAX.Models.Voucher", b =>
289
+                {
290
+                    b.HasOne("MAX.Models.Batch", "Batch")
291
+                        .WithMany("Vouchers")
292
+                        .HasForeignKey("BatchId")
293
+                        .OnDelete(DeleteBehavior.Cascade);
294
+                });
295
+        }
296
+    }
297
+}

+ 25 - 0
BulkPrintingAPI/Migrations/20170928093801_AddBulkReExport.cs

@@ -0,0 +1,25 @@
1
+using System;
2
+using System.Collections.Generic;
3
+using Microsoft.EntityFrameworkCore.Migrations;
4
+
5
+namespace BulkPrintingAPI.Migrations
6
+{
7
+    public partial class AddBulkReExport : Migration
8
+    {
9
+        protected override void Up(MigrationBuilder migrationBuilder)
10
+        {
11
+            migrationBuilder.AddColumn<bool>(
12
+                name: "BulkReExport",
13
+                table: "Users",
14
+                nullable: false,
15
+                defaultValue: false);
16
+        }
17
+
18
+        protected override void Down(MigrationBuilder migrationBuilder)
19
+        {
20
+            migrationBuilder.DropColumn(
21
+                name: "BulkReExport",
22
+                table: "Users");
23
+        }
24
+    }
25
+}

+ 2 - 0
BulkPrintingAPI/Migrations/MAXContextModelSnapshot.cs

@@ -111,6 +111,8 @@ namespace BulkPrintingAPI.Migrations
111 111
 
112 112
                     b.Property<decimal>("BulkOrderMaxValue");
113 113
 
114
+                    b.Property<bool>("BulkReExport");
115
+
114 116
                     b.Property<bool>("BulkViewPins");
115 117
 
116 118
                     b.Property<bool>("CanPrintOffline");

+ 1 - 0
MAXClient/Client.cs

@@ -151,6 +151,7 @@ namespace MAX
151 151
                     user.BulkOrder = bool.Parse(parts[17]);
152 152
                     user.BulkOrderMaxValue = decimal.Parse(parts[18]);
153 153
                     user.BulkViewPins = bool.Parse(parts[19]);
154
+                    user.BulkReExport = bool.Parse(parts[20]);
154 155
                 }
155 156
 
156 157
                 return user;

+ 2 - 0
MAXData/Models/User.cs

@@ -64,5 +64,7 @@ namespace MAX.Models
64 64
         public decimal BulkOrderMaxValue { get; set; }
65 65
 
66 66
         public bool BulkViewPins { get; set; }
67
+
68
+        public bool BulkReExport { get; set; }
67 69
     }
68 70
 }