diff --git a/ProgramManager/src/Domain/GozareshgirProgramManager.Domain/SalaryPaymentSettingAgg/Entities/WorkingHours.cs b/ProgramManager/src/Domain/GozareshgirProgramManager.Domain/SalaryPaymentSettingAgg/Entities/WorkingHours.cs index 0522364f..f3d06472 100644 --- a/ProgramManager/src/Domain/GozareshgirProgramManager.Domain/SalaryPaymentSettingAgg/Entities/WorkingHours.cs +++ b/ProgramManager/src/Domain/GozareshgirProgramManager.Domain/SalaryPaymentSettingAgg/Entities/WorkingHours.cs @@ -22,7 +22,9 @@ public class WorkingHours PersianDayOfWeek = persianDayOfWeek; IsActiveDay = isActiveDay; - ComputeShiftDuration(startShiftOne, endShiftOne, startShiftTwo, endShiftTwo, restTime, hasShiftOne, hasShiftTwo,hasRestTime); + var computeResult = ComputeShiftDuration(startShiftOne, endShiftOne, startShiftTwo, endShiftTwo, restTime, hasShiftOne, hasShiftTwo,hasRestTime); + ShiftDuration = computeResult.shiftDuration; + } @@ -109,10 +111,11 @@ public class WorkingHours /// /// /// - private void ComputeShiftDuration(TimeSpan startShift, TimeSpan endShift, TimeSpan startShiftTwo, TimeSpan endShiftTwo, TimeSpan restTime, bool hasShiftOne, bool hasShiftTwo, bool hasRestTime) + public static (TimeSpan shiftDuration, int shiftDurationInMinutes) ComputeShiftDuration(TimeSpan startShift, TimeSpan endShift, TimeSpan startShiftTwo, TimeSpan endShiftTwo, TimeSpan restTime, bool hasShiftOne, bool hasShiftTwo, bool hasRestTime) { var now = DateTime.Now.Date; - + TimeSpan shiftDurationResult = new TimeSpan(); + int shiftDurationInMinutesResult = 0; if (hasShiftOne && !hasShiftTwo) { DateTime startOne = new DateTime(now.Year, now.Month, now.Day, startShift.Hours, startShift.Minutes,0); @@ -123,7 +126,8 @@ public class WorkingHours endOne = endOne.AddDays(1); var shiftDuration = (endOne - startOne); - ShiftDuration = hasRestTime ? (shiftDuration - restTime) : shiftDuration; + shiftDurationResult = hasRestTime ? (shiftDuration - restTime) : shiftDuration; + shiftDurationInMinutesResult = (int)shiftDurationResult.TotalMinutes; } else if (!hasShiftOne && hasShiftTwo) { @@ -134,7 +138,8 @@ public class WorkingHours endTow = endTow.AddDays(1); - ShiftDuration = (endTow - startTow); + shiftDurationResult = (endTow - startTow); + shiftDurationInMinutesResult = (int)shiftDurationResult.TotalMinutes; } else if (hasShiftOne && hasShiftTwo) { @@ -152,13 +157,12 @@ public class WorkingHours endTow = endTow.AddDays(1); var shiftDurationTow = (endTow - startTow); - ShiftDuration = shiftOneDuration.Add(shiftDurationTow); - } - else - { - ShiftDurationInMinutes = 0; + shiftDurationResult = shiftOneDuration.Add(shiftDurationTow); + shiftDurationInMinutesResult = (int)shiftDurationResult.TotalMinutes; } + + return (shiftDurationResult, shiftDurationInMinutesResult); } } \ No newline at end of file diff --git a/ServiceHost/Areas/Admin/Pages/Company/SmsResult/SmsSettings.cshtml b/ServiceHost/Areas/Admin/Pages/Company/SmsResult/SmsSettings.cshtml index 279d822f..130baf85 100644 --- a/ServiceHost/Areas/Admin/Pages/Company/SmsResult/SmsSettings.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Company/SmsResult/SmsSettings.cshtml @@ -3,10 +3,15 @@ @Html.AntiForgeryToken() @{ - string adminVersion = _0_Framework.Application.Version.AdminVersion; - - - + var adminVersion = _0_Framework.Application.Version.AdminVersion; + + @section Styles { + + + } + + + }
@@ -46,7 +51,7 @@ پیامک مسدودی - +
  • @@ -58,7 +63,7 @@ پیامک هشدار برای اقدام قضائی
  • - +
  • - - + +
    @@ -96,7 +101,115 @@ var urlAjaxToRemove = '@Url.Page("/Company/SmsResult/SmsSettings", "RemoveSetting")'; var antiforgeryToken = $('@Html.AntiForgeryToken()').val(); + + + // $(document).ready(function () { + + // $('.time-input').mask('00:00', { + // translation: { + // '0': { pattern: /[0-9]/ }, + // // برای اولین رقم ساعت فقط 0-2 + // 'H': { pattern: /[0-2]/ }, + // // اگر اولین رقم 2 باشد دومین رقم فقط 0-3 + // 'h': { pattern: /[0-3]/ }, + // // برای دقیقه + // 'M': { pattern: /[0-5]/ }, + // 'm': { pattern: /[0-9]/ }, + // } + // }); + + + + // // پیش‌فرض: لود تب اول با workshopId + // loadPartial("/Admin/Company/SmsResult/SmsSettings?handler=InstitutionContractDebtReminderTab"); + // $("#institutionContractDebtReminderTab").addClass("active"); + + // // کلیک روی تب‌ها + // $("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").click(function (e) { + // e.preventDefault(); + + + + // let url = $(this).data("url"); + + + + // switch (this.id) { + // case "institutionContractDebtReminderTab": + + // loadPartial(url); + + // $("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").removeClass("active"); + // $(this).addClass("active"); + // break; + // case "blockContractingPartyTab": + + // loadPartial(url); + // $("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").removeClass("active"); + // $(this).addClass("active"); + + // break; + // case "legalActionTab": + // loadPartial(url); + // $("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").removeClass("active"); + // $(this).addClass("active"); + // break; + // case "warningTab": + // loadPartial(url); + // $("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").removeClass("active"); + // $(this).addClass("active"); + // break; + + // } + + // }); + + // function loadPartial(url) { + // $.get(url, function (data) { + // $("#partialContainer").html(data); + // }); + // } + + + + + // }); + + + // function remove(id) { + + + + // $.ajax({ + // dataType: 'json', + // type: 'GET', + // url: urlAjaxToRemove, + // headers: { "RequestVerificationToken": antiforgeryToken }, + // data: { id: id }, + + // success: function (response) { + // if (response.isSuccess) { + // $.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message); + + + // setTimeout(function () { + // $(".li-wizard.step.active").trigger("click"); + + + + // }, 500); + // } else { + // $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message); + // } + + // }, + // failure: function (response) { + // //console.log(5, response); + // } + // }); + // } + } \ No newline at end of file diff --git a/ServiceHost/ServiceHost.csproj b/ServiceHost/ServiceHost.csproj index 0e662c03..6b5cbcc6 100644 --- a/ServiceHost/ServiceHost.csproj +++ b/ServiceHost/ServiceHost.csproj @@ -59,10 +59,6 @@ - - - - @@ -110,7 +106,11 @@ + + + +