質問編集履歴
2
内容修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -90,6 +90,8 @@
|
|
90
90
|
|
91
91
|
```
|
92
92
|
|
93
|
+
Sample_main.cshtml
|
94
|
+
|
93
95
|
```HTML
|
94
96
|
|
95
97
|
@model IEnumerable <Sample.Models.Samplemodel>
|
1
内容修正・追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -34,6 +34,8 @@
|
|
34
34
|
|
35
35
|
```C#
|
36
36
|
|
37
|
+
public class Samplemodel
|
38
|
+
|
37
39
|
{
|
38
40
|
|
39
41
|
[Required]
|
@@ -64,9 +66,9 @@
|
|
64
66
|
|
65
67
|
{
|
66
68
|
|
67
|
-
var getCsvCnt = new getCsvCnt();
|
69
|
+
var getCsvCnt = new getCsvCnt(); //CSVの内容を解析、Modelへ格納等の処理をするクラス
|
68
70
|
|
69
|
-
Samplemodel model = getCsvCnt.GetCnt(csv_name);
|
71
|
+
Samplemodel model = getCsvCnt.GetCnt(csv_name); //引数にcsv_nameを渡すことで↑の処理をするメソッド
|
70
72
|
|
71
73
|
|
72
74
|
|
@@ -88,13 +90,27 @@
|
|
88
90
|
|
89
91
|
```
|
90
92
|
|
91
|
-
```
|
93
|
+
```HTML
|
92
94
|
|
93
95
|
@model IEnumerable <Sample.Models.Samplemodel>
|
94
96
|
|
95
97
|
|
96
98
|
|
97
99
|
<body>
|
100
|
+
|
101
|
+
<form action="Sample_main" method="post">
|
102
|
+
|
103
|
+
<div>
|
104
|
+
|
105
|
+
<input type="text" name="csv_name" /> //CSVファイルのフルパスを入力して
|
106
|
+
|
107
|
+
<input type="submit"/> //Controllerにcsv_nameを渡す
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
<form>
|
112
|
+
|
113
|
+
|
98
114
|
|
99
115
|
@if (Model != null)
|
100
116
|
|