fix task schedule bug
This commit is contained in:
@@ -95,6 +95,10 @@ public class TaskScheduleApplication : ITaskScheduleApplication
|
||||
{
|
||||
return operation.Failed("تعداد وارد شده باید بیشتر از 2 باشد");
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(command.ScheduleUnitNumber))
|
||||
{
|
||||
return operation.Failed("لطفا تعداد بازه خود را مشخص کنید");
|
||||
}
|
||||
|
||||
switch (command.ScheduleUnitType)
|
||||
{
|
||||
@@ -105,10 +109,16 @@ public class TaskScheduleApplication : ITaskScheduleApplication
|
||||
}
|
||||
break;
|
||||
case TaskScheduleUnitType.Month:
|
||||
if (Convert.ToInt32(command.ScheduleCount) > 60)
|
||||
|
||||
if (Convert.ToInt32(command.ScheduleUnitNumber) is > 12 or < 1)
|
||||
{
|
||||
return operation.Failed("بازه وارد شده نا معتبر است");
|
||||
}
|
||||
|
||||
if (Convert.ToInt32(command.ScheduleCount) is > 60 or < 1)
|
||||
{
|
||||
return operation.Failed("تعداد دفعات وارد شده نامعتبر است");
|
||||
}
|
||||
break;
|
||||
case TaskScheduleUnitType.Week:
|
||||
if (command.ScheduleUnitNumber != "first" && command.ScheduleUnitNumber != "last")
|
||||
@@ -117,7 +127,7 @@ public class TaskScheduleApplication : ITaskScheduleApplication
|
||||
}
|
||||
break;
|
||||
case TaskScheduleUnitType.Day:
|
||||
if (Convert.ToInt32(command.ScheduleUnitNumber) > 29)
|
||||
if (Convert.ToInt32(command.ScheduleUnitNumber) is > 29 or < 1)
|
||||
{
|
||||
return operation.Failed("بازه وارد شده نا معتبر است");
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
<div class="d-flex schedulePartHodler">
|
||||
<div class="from-group schedulePart" id="scheduleTypeSelector">
|
||||
<select class="form-select select2ScheduleTypeSelector scheduleTypeSelector" id="scheduleType">
|
||||
<option id="type0" value="0" selected="selected" disabled="disabled">انتخاب...</option>
|
||||
<option id="type0" value="0" selected="selected">انتخاب...</option>
|
||||
<option id="type1" value="day">روزانه</option>
|
||||
<option id="type2" value="week">هفتگی</option>
|
||||
<option id="type3" value="month">ماهانه</option>
|
||||
@@ -127,14 +127,14 @@
|
||||
</div>
|
||||
|
||||
<div class="from-group schedulePart selectType default" id="scheduleTypeDefault">
|
||||
<select class="form-select select2Period ">
|
||||
<option id ="default0" value=0 selected="selected" disabled="disabled">انتخاب...</option>
|
||||
<select class="form-select select2Period" id="scheduleTypeDefaultSelect">
|
||||
<option id="default0" value=0 selected="selected" disabled="disabled">انتخاب...</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="from-group schedulePart selectType" id="scheduleTypeDay" style="display: none;">
|
||||
<select class="form-select select2Period ">
|
||||
<option id ="day0" value=0 selected="selected" disabled="disabled">انتخاب...</option>
|
||||
<select class="form-select select2Period" id="scheduleTypeDaySelect">
|
||||
<option id ="day0" value=0>انتخاب...</option>
|
||||
<option id="d1" value="1">1</option>
|
||||
<option id="d2" value="2">2</option>
|
||||
<option id="d3" value="3">3</option>
|
||||
@@ -168,16 +168,16 @@
|
||||
</div>
|
||||
|
||||
<div class="from-group schedulePart selectType" id="scheduleTypeWeek" style="display: none;">
|
||||
<select class="form-select select2Period ">
|
||||
<option value=0 selected="selected" disabled="disabled">انتخاب...</option>
|
||||
<select class="form-select select2Period" id="scheduleTypeWeekSelect">
|
||||
<option value=0>انتخاب...</option>
|
||||
<option value="first">اول هفته</option>
|
||||
<option value="last">آخر هفته</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="from-group schedulePart selectType" id="scheduleTypeMonth" style="display: none;">
|
||||
<select class="form-select select2Period ">
|
||||
<option id="m0" value=0 selected="selected" disabled="disabled">انتخاب...</option>
|
||||
<select class="form-select select2Period" id="scheduleTypeMonthSelect">
|
||||
<option id="m0" value=0>انتخاب...</option>
|
||||
<option id="m1" value="1">1</option>
|
||||
<option id="m2" value="2">2</option>
|
||||
<option id="m3" value="3">3</option>
|
||||
@@ -438,8 +438,6 @@
|
||||
var uploadFileModalAjax = '@Url.Page("/Company/Task/Create", "UploadFile")';
|
||||
var deleteFileModalAjax = '@Url.Page("./Create", "DeleteFile")';
|
||||
var deleteAllFilesModalAjax = '@Url.Page("./Create", "RemoveAllTempFiles")';
|
||||
|
||||
console.log(uploadFileModalAjax);
|
||||
</script>
|
||||
|
||||
<script src="~/assetsadminnew/tasks/js/Createschedulemodal.js?ver=@adminVersion"></script>
|
||||
@@ -74,14 +74,40 @@ $(document).ready(function () {
|
||||
});
|
||||
}
|
||||
|
||||
$('.select2Group,.select2ScheduleTypeSelector,.select2Period').select2({
|
||||
$('.select2Group,.select2ScheduleTypeSelector').select2({
|
||||
placeholder: {
|
||||
id: '-1', // the value of the option
|
||||
text: "انتخاب گروهی ..."
|
||||
}
|
||||
});
|
||||
|
||||
$('#scheduleTypeMonthSelect').select2({
|
||||
placeholder: {
|
||||
id: '-1', // the value of the option
|
||||
text: "انتخاب گروهی ..."
|
||||
}
|
||||
});
|
||||
|
||||
$('#scheduleTypeDaySelect').select2({
|
||||
placeholder: {
|
||||
id: '-1', // the value of the option
|
||||
text: "انتخاب گروهی ..."
|
||||
}
|
||||
});
|
||||
|
||||
$('#scheduleTypeWeekSelect').select2({
|
||||
placeholder: {
|
||||
id: '-1', // the value of the option
|
||||
text: "انتخاب گروهی ..."
|
||||
}
|
||||
});
|
||||
|
||||
$('#scheduleTypeDefaultSelect').select2({
|
||||
placeholder: {
|
||||
id: '-1', // the value of the option
|
||||
text: "انتخاب گروهی ..."
|
||||
}
|
||||
});
|
||||
|
||||
//for refreshing the select
|
||||
$(document).on('change', '.selectRadioBox', function () {
|
||||
|
||||
Reference in New Issue
Block a user