Commit ac2fe36d authored by Vinodkumar Chindam's avatar Vinodkumar Chindam

Added validation and resize the image.

parent d0c1760b
Pipeline #47574 passed with stages
in 40 seconds
......@@ -506,7 +506,7 @@ namespace PharmaStoreReport.Controllers
///System.IO.Directory.Delete(filepath);
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(filepath);
di.Delete(true);
return Json(new { status = true, message = "Report removed successfully." });
return Json(new { status = true, message = "Report Deleted Successfully." });
}
catch(Exception ex)
{
......
......@@ -14,7 +14,7 @@
<section class="sms_report_dashboard">
<aside class="left_side">
<div class="brand_logo">
<img src="images/ams.png" class="img-fluid" alt="AM Solutions ">
<img src="~/images/Ams_1.png" class="img-fluid" alt="AM Solutions ">
</div>
<div class="sms_report">
<h1>SMS Reports</h1>
......@@ -91,7 +91,7 @@
<div class="form-group mb-lg-0 row">
<label class="form-label col-md-3">Year:</label>
<div class="col-md-9">
<select id="ddlYears" class="form-control year-drop">
<select id="ddlYears" class="form-control">
@foreach (var item in Model.Years)
{
<option value="@item.Value">@item.Text</option>
......@@ -104,7 +104,7 @@
<div class="form-group mb-lg-0 row">
<label class="form-label col-md-3">Month:</label>
<div class="col-md-9">
<select id="ddlMonths" name="ddlMonths" class="form-control months-drop">
<select id="ddlMonths" name="ddlMonths" class="form-control">
@foreach (var item in Model.Months)
{
if (Model.CurrentMonth == item.Value)
......@@ -159,7 +159,7 @@
</button>
<div class="modal-body">
<h2>Delete Report</h2>
Are you sure you want to delete this report?
<p>Are you sure you want to delete <span id="dateandmonth"></span> report?</p>
</div>
<div class="modal-footer">
<button type="button" id="btnDeleteReport" onclick="DeleteReport();" class="btn btn-gray mr-2">Confirm</button>
......
PharmaStoreReport/wwwroot/images/Ams_1.png

21.1 KB

......@@ -141,32 +141,32 @@ $(function () {
return false;
}
else if (filesList.length == 0) {
$.bootstrapGrowl("Please upload ams_healthnotes,script_figures and storereportnumbersresults files.", { type: 'danger', color: 'red', delay: 18000 })
$.bootstrapGrowl("Please upload AMS_HealthNotes,Script_Figures and StoreReportNumbersResults files.", { type: 'danger', color: 'red', delay: 18000 })
}
else if (filesList.length != 3) {
ValidateFileNames();
if (unmachedfiles.length == 1) {
$.bootstrapGrowl("Please select " + unmachedfiles[0] + " file", { type: 'danger', color: 'red', delay: 18000 })
$.bootstrapGrowl("Please upload " + unmachedfiles[0] + " file", { type: 'danger', color: 'red', delay: 18000 })
}
else if (unmachedfiles.length == 2) {
$.bootstrapGrowl("Please select " + unmachedfiles[0] + "," + unmachedfiles[1] + " files", { type: 'danger', color: 'red', delay: 18000 })
$.bootstrapGrowl("Please upload " + unmachedfiles[0] + "," + unmachedfiles[1] + " files", { type: 'danger', color: 'red', delay: 18000 })
}
else if (unmachedfiles.length == 3) {
$.bootstrapGrowl("Please upload ams_healthnotes,script_figures and storereportnumbersresults files", { type: 'danger', color: 'red', delay: 18000 })
$.bootstrapGrowl("Please upload AMS_HealthNotes,Script_Figures and StoreReportNumbersResults files", { type: 'danger', color: 'red', delay: 18000 })
}
}
else {
ValidateFileNames();
if (unmachedfiles.length == 1) {
$.bootstrapGrowl("Please select " + unmachedfiles[0] + " file", { type: 'danger', color: 'red', delay: 18000 });
$.bootstrapGrowl("Please upload " + unmachedfiles[0] + " file", { type: 'danger', color: 'red', delay: 18000 });
}
else if (unmachedfiles.length == 2) {
$.bootstrapGrowl("Please select " + unmachedfiles[0] + "," + unmachedfiles[1] + " files", { type: 'danger', color: 'red', delay: 18000 });
$.bootstrapGrowl("Please upload " + unmachedfiles[0] + "," + unmachedfiles[1] + " files", { type: 'danger', color: 'red', delay: 18000 });
}
else if (unmachedfiles.length == 3) {
$.bootstrapGrowl("Please upload ams_healthnotes,script_figures and storereportnumbersresults files", { type: 'danger', color: 'red', delay: 18000 });
$.bootstrapGrowl("Please upload AMS_HealthNotes,Script_Figures and StoreReportNumbersResults files", { type: 'danger', color: 'red', delay: 18000 });
}
else {
ajaxLoading();
......@@ -259,10 +259,12 @@ function ajaxLoading() {
<param name="Month"></param>
<returns></returns> */
function ConfirmDeleteReport() {
$(".close").trigger("click");
let year = $('#ddlYears option:selected').val();
let month = $('#ddlMonths option:selected').val();
if (year == 0) { $.bootstrapGrowl("Please select year.", { type: 'danger', color: 'red', delay: 18000 }); return false; }
if (month == 0) { $.bootstrapGrowl("Please select month.", { type: 'danger', color: 'red', delay: 18000 }); return false; }
$('#dateandmonth').text(year + " " + $('#ddlMonths option:selected').text());
$("#DeleteReport").modal('show');
}
/* <summary>
......@@ -272,12 +274,14 @@ function ConfirmDeleteReport() {
<param name="Month"></param>
<returns></returns> */
function DeleteReport() {
$(".close").trigger("click");
ajaxLoading();
let year = $('#ddlYears option:selected').val();
let month = $('#ddlMonths option:selected').text();
$.get("Home/DeleteReport?Year=" + year + "&Month=" + month, function (data) {
let type = 'danger';
if (data.status == "True") { type = "success"; }
let color = 'red';
if (data.status) { type = "success"; color= "blue" }
$.bootstrapGrowl(data.message, { type: type, color: 'red', delay: 18000 });
$("#DeleteReport").modal('hide');
});
......
......@@ -525,10 +525,10 @@
_cancelHandler: function (e) {
e.preventDefault();
if (confirm("Are you sure you want to delete this file?")) {
var template = $(e.currentTarget)
.closest('.template-upload,.template-download'),
data = template.data('data') || {};
var template = $(e.currentTarget)
.closest('.template-upload,.template-download'),
data = template.data('data') || {};
if (confirm("Are you sure you want to delete " + data.files[0].name+ " file?")) {
data.context = data.context || template;
if (data.abort) {
data.abort();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment