質問編集履歴
15
関連するタグの追加
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
14
{}の閉じがうまくできていなかったため修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -312,44 +312,40 @@
|
|
312
312
|
|
313
313
|
++i_c;
|
314
314
|
|
315
|
+
|
316
|
+
|
317
|
+
foreach (var his in col)
|
318
|
+
|
319
|
+
{
|
320
|
+
|
321
|
+
var hist = new History(target);
|
322
|
+
|
323
|
+
hist.Name = target.name;
|
324
|
+
|
325
|
+
hist.Team = his.team;
|
326
|
+
|
327
|
+
hist.Project = his.project;
|
328
|
+
|
329
|
+
hist.Start = his.start;
|
330
|
+
|
331
|
+
hist.End = his.end;
|
332
|
+
|
333
|
+
target.Histories.Add(hist);
|
334
|
+
|
335
|
+
}
|
336
|
+
|
337
|
+
target.ColStartPos = cols;
|
338
|
+
|
339
|
+
cols += target.OutputWidth() + 1;
|
340
|
+
|
315
341
|
}
|
316
342
|
|
317
|
-
|
318
|
-
|
319
|
-
foreach (var his in addcol)
|
320
|
-
|
321
|
-
{
|
322
|
-
|
323
|
-
var hist = new History(target);
|
324
|
-
|
325
|
-
hist.Name = target.name;
|
326
|
-
|
327
|
-
hist.Team = his.team;
|
328
|
-
|
329
|
-
hist.Project = his.project;
|
330
|
-
|
331
|
-
hist.Start = his.start;
|
332
|
-
|
333
|
-
hist.End = his.end;
|
334
|
-
|
335
|
-
target.Histories.Add(hist);
|
336
|
-
|
337
|
-
}
|
338
|
-
|
339
|
-
target.ColStartPos = cols;
|
340
|
-
|
341
|
-
cols += target.OutputWidth() + 1;
|
342
|
-
|
343
|
-
|
344
|
-
|
345
343
|
}
|
346
344
|
|
347
345
|
}
|
348
346
|
|
349
347
|
}
|
350
348
|
|
351
|
-
|
352
|
-
|
353
349
|
```
|
354
350
|
|
355
351
|
|
13
{}の閉じがうまくできていなかったため修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -312,11 +312,13 @@
|
|
312
312
|
|
313
313
|
++i_c;
|
314
314
|
|
315
|
-
|
315
|
+
}
|
316
|
-
|
316
|
+
|
317
|
+
|
318
|
+
|
317
|
-
|
319
|
+
foreach (var his in addcol)
|
318
|
-
|
320
|
+
|
319
|
-
|
321
|
+
{
|
320
322
|
|
321
323
|
var hist = new History(target);
|
322
324
|
|
@@ -332,20 +334,22 @@
|
|
332
334
|
|
333
335
|
target.Histories.Add(hist);
|
334
336
|
|
335
|
-
}
|
336
|
-
|
337
|
-
target.ColStartPos = cols;
|
338
|
-
|
339
|
-
cols += target.OutputWidth() + 1;
|
340
|
-
|
341
337
|
}
|
342
338
|
|
339
|
+
target.ColStartPos = cols;
|
340
|
+
|
341
|
+
cols += target.OutputWidth() + 1;
|
342
|
+
|
343
|
+
|
344
|
+
|
343
345
|
}
|
344
346
|
|
345
347
|
}
|
346
348
|
|
347
349
|
}
|
348
350
|
|
351
|
+
|
352
|
+
|
349
353
|
```
|
350
354
|
|
351
355
|
|
12
コメントを変更途中で更新してしまったため追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -398,7 +398,7 @@
|
|
398
398
|
|
399
399
|
};
|
400
400
|
|
401
|
-
// 2回目(addcolは上書きする
|
401
|
+
// 2回目(addcolは毎回上書きする)
|
402
402
|
|
403
403
|
addcol =
|
404
404
|
|
@@ -420,7 +420,7 @@
|
|
420
420
|
|
421
421
|
};
|
422
422
|
|
423
|
-
// 合算後
|
423
|
+
// 合算後(addcolを3回目まで足しこむ)
|
424
424
|
|
425
425
|
col =
|
426
426
|
|
11
今更ですが個人履歴のLINQが間違っていたため修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -294,13 +294,11 @@
|
|
294
294
|
|
295
295
|
var addcol = from a in DbContext.TEAM_HIS
|
296
296
|
|
297
|
-
where
|
297
|
+
where a.team == forlist.team
|
298
|
-
|
298
|
+
|
299
|
-
&& a.start < next
|
299
|
+
&& a.start < next
|
300
|
-
|
301
|
-
|
300
|
+
|
302
|
-
|
303
|
-
&& a.start >=
|
301
|
+
&& a.start >= start
|
304
302
|
|
305
303
|
&& a.start < loss
|
306
304
|
|
@@ -386,7 +384,7 @@
|
|
386
384
|
|
387
385
|
```C#
|
388
386
|
|
389
|
-
// 1回目
|
387
|
+
// 1回目(本当はこれはaddcolではなく、colの形が望ましい)
|
390
388
|
|
391
389
|
addcol =
|
392
390
|
|
@@ -400,7 +398,7 @@
|
|
400
398
|
|
401
399
|
};
|
402
400
|
|
403
|
-
// 2回目
|
401
|
+
// 2回目(addcolは上書きするため、colの内容を
|
404
402
|
|
405
403
|
addcol =
|
406
404
|
|
@@ -434,7 +432,7 @@
|
|
434
432
|
|
435
433
|
{T1, P03, 2014-1-11, 2014-3-30},
|
436
434
|
|
437
|
-
{T2, P0
|
435
|
+
{T2, P04, 2014-5-1, 2014-8-10},
|
438
436
|
|
439
437
|
{T2, P08, 2014-8-21, 2015-3-30},
|
440
438
|
|
10
,漏れを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -406,13 +406,13 @@
|
|
406
406
|
|
407
407
|
{
|
408
408
|
|
409
|
-
{T2, P01, 2014-5-1, 2014-8-10}
|
409
|
+
{T2, P01, 2014-5-1, 2014-8-10},
|
410
410
|
|
411
411
|
{T2, P08, 2014-8-21, 2015-3-30}
|
412
412
|
|
413
413
|
};
|
414
414
|
|
415
|
-
|
415
|
+
// 3回目
|
416
416
|
|
417
417
|
addcol =
|
418
418
|
|
@@ -428,15 +428,15 @@
|
|
428
428
|
|
429
429
|
{
|
430
430
|
|
431
|
-
{T1, P01, 2013-5-1, 2013-8-10}
|
431
|
+
{T1, P01, 2013-5-1, 2013-8-10},
|
432
|
-
|
432
|
+
|
433
|
-
{T1, P02, 2013-8-21, 2013-12-20}
|
433
|
+
{T1, P02, 2013-8-21, 2013-12-20},
|
434
|
-
|
434
|
+
|
435
|
-
{T1, P03, 2014-1-11, 2014-3-30}
|
435
|
+
{T1, P03, 2014-1-11, 2014-3-30},
|
436
|
-
|
436
|
+
|
437
|
-
{T2, P01, 2014-5-1, 2014-8-10}
|
437
|
+
{T2, P01, 2014-5-1, 2014-8-10},
|
438
|
-
|
438
|
+
|
439
|
-
{T2, P08, 2014-8-21, 2015-3-30}
|
439
|
+
{T2, P08, 2014-8-21, 2015-3-30},
|
440
440
|
|
441
441
|
{T3, P09, 2015-4-11, 2015-12-30}
|
442
442
|
|
9
コメントを調整
test
CHANGED
File without changes
|
test
CHANGED
@@ -386,7 +386,9 @@
|
|
386
386
|
|
387
387
|
```C#
|
388
388
|
|
389
|
-
|
389
|
+
// 1回目
|
390
|
+
|
391
|
+
addcol =
|
390
392
|
|
391
393
|
{
|
392
394
|
|
@@ -398,9 +400,9 @@
|
|
398
400
|
|
399
401
|
};
|
400
402
|
|
401
|
-
|
402
|
-
|
403
|
-
|
403
|
+
// 2回目
|
404
|
+
|
405
|
+
addcol =
|
404
406
|
|
405
407
|
{
|
406
408
|
|
@@ -410,9 +412,9 @@
|
|
410
412
|
|
411
413
|
};
|
412
414
|
|
413
|
-
|
414
|
-
|
415
|
-
|
415
|
+
// 3回目
|
416
|
+
|
417
|
+
addcol =
|
416
418
|
|
417
419
|
{
|
418
420
|
|
@@ -420,9 +422,9 @@
|
|
420
422
|
|
421
423
|
};
|
422
424
|
|
423
|
-
|
424
|
-
|
425
|
-
|
425
|
+
// 合算後
|
426
|
+
|
427
|
+
col =
|
426
428
|
|
427
429
|
{
|
428
430
|
|
8
記入漏れを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -418,7 +418,7 @@
|
|
418
418
|
|
419
419
|
{T3, P09, 2015-4-11, 2015-12-30}
|
420
420
|
|
421
|
-
}
|
421
|
+
};
|
422
422
|
|
423
423
|
|
424
424
|
|
@@ -438,7 +438,7 @@
|
|
438
438
|
|
439
439
|
{T3, P09, 2015-4-11, 2015-12-30}
|
440
440
|
|
441
|
-
}
|
441
|
+
};
|
442
442
|
|
443
443
|
|
444
444
|
|
7
AddRangeをどう利用したいか
test
CHANGED
File without changes
|
test
CHANGED
@@ -378,6 +378,76 @@
|
|
378
378
|
|
379
379
|
|
380
380
|
|
381
|
+
###補足2
|
382
|
+
|
383
|
+
AddRangeをどう利用したいかですが、
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
```C#
|
388
|
+
|
389
|
+
addcol = // 1回目
|
390
|
+
|
391
|
+
{
|
392
|
+
|
393
|
+
{T1, P01, 2013-5-1, 2013-8-10},
|
394
|
+
|
395
|
+
{T1, P02, 2013-8-21, 2013-12-20},
|
396
|
+
|
397
|
+
{T1, P03, 2014-1-11, 2014-3-30}
|
398
|
+
|
399
|
+
};
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
addcol = // 2回目
|
404
|
+
|
405
|
+
{
|
406
|
+
|
407
|
+
{T2, P01, 2014-5-1, 2014-8-10}
|
408
|
+
|
409
|
+
{T2, P08, 2014-8-21, 2015-3-30}
|
410
|
+
|
411
|
+
};
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
addcol = // 2回目
|
416
|
+
|
417
|
+
{
|
418
|
+
|
419
|
+
{T3, P09, 2015-4-11, 2015-12-30}
|
420
|
+
|
421
|
+
}
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
col = // 合算後
|
426
|
+
|
427
|
+
{
|
428
|
+
|
429
|
+
{T1, P01, 2013-5-1, 2013-8-10}
|
430
|
+
|
431
|
+
{T1, P02, 2013-8-21, 2013-12-20}
|
432
|
+
|
433
|
+
{T1, P03, 2014-1-11, 2014-3-30}
|
434
|
+
|
435
|
+
{T2, P01, 2014-5-1, 2014-8-10}
|
436
|
+
|
437
|
+
{T2, P08, 2014-8-21, 2015-3-30}
|
438
|
+
|
439
|
+
{T3, P09, 2015-4-11, 2015-12-30}
|
440
|
+
|
441
|
+
}
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
```
|
446
|
+
|
447
|
+
上記のような2次元配列を足しこんでいくようにしていきたいです。
|
448
|
+
|
449
|
+
|
450
|
+
|
381
451
|
※2つのテーブルと出力結果をアップローダーにあげておきます。
|
382
452
|
|
383
453
|
[リンク内容](http://www.dotup.org/uploda/www.dotup.org771351.xlsx.html)
|
6
スペルミスを調整
test
CHANGED
File without changes
|
test
CHANGED
@@ -336,9 +336,9 @@
|
|
336
336
|
|
337
337
|
}
|
338
338
|
|
339
|
-
target.ColStartPos = col;
|
339
|
+
target.ColStartPos = cols;
|
340
|
-
|
340
|
+
|
341
|
-
col += target.OutputWidth() + 1;
|
341
|
+
cols += target.OutputWidth() + 1;
|
342
342
|
|
343
343
|
}
|
344
344
|
|
5
カラム位置に関係する出力用のデータのコレクションをソースに追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -316,6 +316,30 @@
|
|
316
316
|
|
317
317
|
|
318
318
|
|
319
|
+
foreach (var his in addcol)
|
320
|
+
|
321
|
+
{
|
322
|
+
|
323
|
+
var hist = new History(target);
|
324
|
+
|
325
|
+
hist.Name = target.name;
|
326
|
+
|
327
|
+
hist.Team = his.team;
|
328
|
+
|
329
|
+
hist.Project = his.project;
|
330
|
+
|
331
|
+
hist.Start = his.start;
|
332
|
+
|
333
|
+
hist.End = his.end;
|
334
|
+
|
335
|
+
target.Histories.Add(hist);
|
336
|
+
|
337
|
+
}
|
338
|
+
|
339
|
+
target.ColStartPos = col;
|
340
|
+
|
341
|
+
col += target.OutputWidth() + 1;
|
342
|
+
|
319
343
|
}
|
320
344
|
|
321
345
|
}
|
4
TEAM_HISのDbSetを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,14 +24,60 @@
|
|
24
24
|
|
25
25
|
```C#
|
26
26
|
|
27
|
-
|
28
|
-
|
29
27
|
namespace A.Models
|
30
28
|
|
31
29
|
{
|
32
30
|
|
33
31
|
using System;
|
34
32
|
|
33
|
+
using System.Data.Entity;
|
34
|
+
|
35
|
+
using System.ComponentModel.DataAnnotations.Schema;
|
36
|
+
|
37
|
+
using System.Linq;
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
public partial class DefaultContext : DbContext
|
42
|
+
|
43
|
+
{
|
44
|
+
|
45
|
+
public DefaultContext()
|
46
|
+
|
47
|
+
: base("name=DefaultContext")
|
48
|
+
|
49
|
+
{
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
/// <summary>
|
54
|
+
|
55
|
+
/// プロジェクト経歴
|
56
|
+
|
57
|
+
/// </summary>
|
58
|
+
|
59
|
+
public virtual DbSet<TEAM_HIS> TEAM_HIS { get; set; }
|
60
|
+
|
61
|
+
/// <summary>
|
62
|
+
|
63
|
+
/// 変更履歴
|
64
|
+
|
65
|
+
/// </summary>
|
66
|
+
|
67
|
+
public virtual DbSet<CHANGE_HIS> CHANGE_HIS { get; set; }
|
68
|
+
|
69
|
+
}
|
70
|
+
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
namespace A.Models
|
76
|
+
|
77
|
+
{
|
78
|
+
|
79
|
+
using System;
|
80
|
+
|
35
81
|
using System.Collections.Generic;
|
36
82
|
|
37
83
|
using System.ComponentModel;
|
3
質問の文言を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -302,7 +302,7 @@
|
|
302
302
|
|
303
303
|
ところが、AddRangeを使用すると、表記のエラーが出てしまい解決できませんでした。
|
304
304
|
|
305
|
-
エラー自体の意味が理解できていな
|
305
|
+
エラー自体の意味が理解できていなく、可能でありましたらエラーの意味と解決方法を教えていただけますでしょうか。
|
306
306
|
|
307
307
|
よろしくお願いいたします。
|
308
308
|
|
2
内容を微調整
test
CHANGED
File without changes
|
test
CHANGED
@@ -50,7 +50,7 @@
|
|
50
50
|
|
51
51
|
[Column(Order = 0)]
|
52
52
|
|
53
|
-
[StringLength(1
|
53
|
+
[StringLength(10)]
|
54
54
|
|
55
55
|
[DisplayName("team名")]
|
56
56
|
|
@@ -62,7 +62,7 @@
|
|
62
62
|
|
63
63
|
[Column(Order = 1)]
|
64
64
|
|
65
|
-
[StringLength(
|
65
|
+
[StringLength(10)]
|
66
66
|
|
67
67
|
[DisplayName("プロジェクト")]
|
68
68
|
|
1
team_HISのソースコードを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,6 +24,80 @@
|
|
24
24
|
|
25
25
|
```C#
|
26
26
|
|
27
|
+
|
28
|
+
|
29
|
+
namespace A.Models
|
30
|
+
|
31
|
+
{
|
32
|
+
|
33
|
+
using System;
|
34
|
+
|
35
|
+
using System.Collections.Generic;
|
36
|
+
|
37
|
+
using System.ComponentModel;
|
38
|
+
|
39
|
+
using System.ComponentModel.DataAnnotations;
|
40
|
+
|
41
|
+
using System.ComponentModel.DataAnnotations.Schema;
|
42
|
+
|
43
|
+
using System.Data.Entity.Spatial;
|
44
|
+
|
45
|
+
public partial class TEAM_HIS
|
46
|
+
|
47
|
+
{
|
48
|
+
|
49
|
+
[Key]
|
50
|
+
|
51
|
+
[Column(Order = 0)]
|
52
|
+
|
53
|
+
[StringLength(14)]
|
54
|
+
|
55
|
+
[DisplayName("team名")]
|
56
|
+
|
57
|
+
public string team { get; set; }
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
[Key]
|
62
|
+
|
63
|
+
[Column(Order = 1)]
|
64
|
+
|
65
|
+
[StringLength(2)]
|
66
|
+
|
67
|
+
[DisplayName("プロジェクト")]
|
68
|
+
|
69
|
+
public string project { get; set; }
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
[Key]
|
74
|
+
|
75
|
+
[Column(Order = 2)]
|
76
|
+
|
77
|
+
[DisplayName("開始日時")]
|
78
|
+
|
79
|
+
public DateTime start { get; set; }
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
[Key]
|
84
|
+
|
85
|
+
[Column(Order = 3)]
|
86
|
+
|
87
|
+
[DisplayName("終了日時")]
|
88
|
+
|
89
|
+
public DateTime end { get; set; }
|
90
|
+
|
91
|
+
}
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
27
101
|
using System;
|
28
102
|
|
29
103
|
using System.Collections.Generic;
|