113 lines
4.2 KiB
Plaintext
113 lines
4.2 KiB
Plaintext
@page
|
|
@model ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk.IndexModel
|
|
@{
|
|
ViewData["Title"] = "File Upload";
|
|
}
|
|
|
|
<h1>Upload APK File</h1>
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<form asp-page-handler="Upload" id="1" method="post" enctype="multipart/form-data">
|
|
<div class="form-group">
|
|
<label asp-for="File" class="form-label">Choose APK file:</label>
|
|
<input asp-for="File" type="file" class="form-control" required accept=".apk">
|
|
<small class="form-text text-muted">Please select a valid APK file.</small>
|
|
<span asp-validation-for="File" class="text-danger"></span>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label asp-for="VersionName" class="form-label">Version Name:</label>
|
|
<input asp-for="VersionName" type="text" class="form-control" placeholder="e.g. 1.0.0" required>
|
|
<small class="form-text text-muted">Enter the version name (e.g. 1.0.0, 2.1.3).</small>
|
|
<span asp-validation-for="VersionName" class="text-danger"></span>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label asp-for="VersionCode" class="form-label">Version Code:</label>
|
|
<input asp-for="VersionCode" type="text" class="form-control" placeholder="e.g. 100" required>
|
|
<small class="form-text text-muted">Enter the version code (numeric value).</small>
|
|
<span asp-validation-for="VersionCode" class="text-danger"></span>
|
|
</div>
|
|
<div style="margin-top:12px;">
|
|
<label asp-for="SelectedApkType">نوع اپلیکیشن:</label>
|
|
<select asp-for="SelectedApkType" asp-items="Html.GetEnumSelectList<CompanyManagment.App.Contracts.AndroidApkVersion.ApkType>()"></select>
|
|
</div>
|
|
<div style="margin-top:12px;">
|
|
<label asp-for="IsForce">
|
|
<input asp-for="IsForce" type="checkbox">
|
|
آپدیت اجباری (Force Update)
|
|
</label>
|
|
</div>
|
|
<div class="form-group">
|
|
<button type="submit" class="btn btn-primary">Upload APK</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<form asp-page-handler="ShiftDate" id="8" method="post">
|
|
|
|
<button type="submit">افزودن شیفت دیت</button>
|
|
</form>
|
|
|
|
<form asp-page-handler="ShiftDateNew" id="9" method="post">
|
|
|
|
<button type="submit">ست شیفت 1 </button>
|
|
</form>
|
|
<form asp-page-handler="ShiftDateNew2" id="10" method="post">
|
|
|
|
<button type="submit">ست شیفت 2 </button>
|
|
</form>
|
|
|
|
|
|
<form style="margin:50px" asp-page-handler="PaymentGateWay" id="11" method="post">
|
|
|
|
<button type="submit">درگاه پرداخت تستی </button>
|
|
</form>
|
|
|
|
|
|
@if (ViewData["message"] != null)
|
|
{
|
|
<p>@ViewData["message"]</p>
|
|
}
|
|
|
|
@* <script>
|
|
|
|
$(document).ready(function () {
|
|
$('#fileUploadForm').submit(function(e) {
|
|
e.preventDefault(); // Prevent the default form submission
|
|
|
|
// Create FormData object
|
|
var formData = new FormData();
|
|
var fileInput = $('#FormFile')[0]; // Use the first element of the jQuery object
|
|
|
|
// Check if a file was selected
|
|
if (fileInput.files.length === 0) {
|
|
alert("Please select a file!");
|
|
return;
|
|
}
|
|
|
|
// Append the file to the FormData object
|
|
formData.append('file', fileInput.files[0]);
|
|
|
|
$.ajax({
|
|
dataType: 'json',
|
|
type: 'POST',
|
|
processData: false, // Prevent jQuery from automatically transforming the data into a query string
|
|
contentType: false, // Tell jQuery not to set the content type
|
|
url: `@Url.Page("./index", "Upload")`,
|
|
headers: {
|
|
"RequestVerificationToken": `@Html.AntiForgeryToken()`
|
|
},
|
|
data: formData,
|
|
success: function(response) {
|
|
alert("File uploaded successfully!");
|
|
},
|
|
error: function(err) {
|
|
console.log(err);
|
|
}
|
|
});
|
|
});
|
|
});
|
|
|
|
</script> *@ |