-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed72bc2
commit 7de7817
Showing
5 changed files
with
295 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,119 @@ | ||
|
||
|
||
@{ | ||
ViewBag.Title = "Index"; | ||
ViewBag.Title = "DNA Extract Excel Upload"; | ||
} | ||
|
||
@model System.Data.DataTable | ||
@using System.Data; | ||
|
||
|
||
|
||
|
||
<script src="~/Scripts/jquery-3.3.1.js"></script> | ||
|
||
<script> | ||
function bs_input_file() { | ||
$(".input-file").before( | ||
function () { | ||
if (!$(this).prev().hasClass('input-ghost')) { | ||
var element = $("<input type='file' id='dataFile' name='upload' class='input-ghost' style='visibility:visible; height:20;'>"); | ||
element.attr("name", $(this).attr("name")); | ||
element.change(function () { | ||
element.next(element).find('input').val((element.val()).split('\\').pop()); | ||
}); | ||
$(this).find("button.btn-choose").click(function () { | ||
element.click(); | ||
}); | ||
$(this).find("button.btn-reset").click(function () { | ||
element.val(null); | ||
$(this).parents(".input-file").find('input').val(''); | ||
}); | ||
$(this).find('input').css("cursor", "pointer"); | ||
$(this).find('input').mousedown(function () { | ||
$(this).parents('.input-file').prev().click(); | ||
return false; | ||
}); | ||
return element; | ||
} | ||
} | ||
); | ||
} | ||
function clear() { | ||
var input = $("#dataFile").val(''); | ||
}; | ||
$(function () { | ||
clear(); | ||
bs_input_file(); | ||
}); | ||
</script> | ||
|
||
@using (Html.BeginForm("Index", "DnaExtractExcel", null, FormMethod.Post, new { enctype = "multipart/form-data" })) | ||
{ | ||
<div class="info2"> | ||
<h2>DnaExtract Excel File Upload</h2> | ||
@Html.AntiForgeryToken() | ||
|
||
<div class="form-group" name="Fichier1"> | ||
<!-- COMPONENT START --> | ||
<div class="form-group"> | ||
<div class="input-group input-file"> | ||
<span class="input-group-btn"> | ||
@*<button class="btn btn-default btn-choose" type="button">Choose</button>*@ | ||
</span> | ||
@*<input type="text" class="form-control" placeholder='Choose a file...' />*@ | ||
|
||
</div> | ||
</div> | ||
@*<input type="file" id="dataFile" name="upload"/>*@ | ||
|
||
</div> | ||
|
||
<div class="form-group"> | ||
<input type="submit" value="Import from Excel" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm" /> | ||
@*<button class="btn btn-default" style="background-color:Highlight" >Save</button>*@ | ||
</div> | ||
|
||
|
||
<div class="alert alert-danger"> | ||
@Html.ValidationSummary() | ||
@*<strong></strong> asdasd*@ | ||
</div> | ||
|
||
|
||
|
||
</div> | ||
if (Model != null) | ||
{ | ||
<table id="table1" class="table table-bordered table-hover"> | ||
<thead> | ||
<tr> | ||
@foreach (DataColumn col in Model.Columns) | ||
{ | ||
<th>@col.ColumnName</th> | ||
} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach (DataRow row in Model.Rows) | ||
{ | ||
<tr> | ||
@foreach (DataColumn col in Model.Columns) | ||
{ | ||
<td>@row[col.ColumnName]</td> | ||
} | ||
</tr> | ||
} | ||
</tbody> | ||
</table> | ||
} | ||
} | ||
|
||
<h2>Index</h2> | ||
<script> | ||
$(document).ready(function () { | ||
$("table1").DataTable(); | ||
}); | ||
</script> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.