From 3dace574ffaca65caa555b995bc6d1fde0d6597e Mon Sep 17 00:00:00 2001 From: mahan Date: Mon, 2 Feb 2026 19:08:25 +0330 Subject: [PATCH] refactor date parsing method in RollCallCaseHistoryController --- .../RollCall/RollCallCaseHistoryController.cs | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/ServiceHost/Areas/Client/Controllers/RollCall/RollCallCaseHistoryController.cs b/ServiceHost/Areas/Client/Controllers/RollCall/RollCallCaseHistoryController.cs index fc22ec04..ec8d347d 100644 --- a/ServiceHost/Areas/Client/Controllers/RollCall/RollCallCaseHistoryController.cs +++ b/ServiceHost/Areas/Client/Controllers/RollCall/RollCallCaseHistoryController.cs @@ -78,28 +78,12 @@ public class RollCallCaseHistoryController : ClientBaseController return op.Succcedded(duration); } - private static bool TryParseDateTime(string date, string time, out DateTime result) - { - result = default; - - try - { - var dateTime = date.ToGeorgianDateTime(); - var timeOnly = TimeOnly.Parse(time); - result = dateTime.AddTicks(timeOnly.Ticks); - return true; - } - catch - { - return false; - } - } + [HttpGet("excel")] public async Task GetDownload(string titleId, RollCallCaseHistorySearchModel searchModel) { var res =await _rollCallApplication.DownloadCaseHistoryExcel(_workshopId, titleId, searchModel); - return File(res.Bytes, res.MimeType, @@ -127,4 +111,22 @@ public class RollCallCaseHistoryController : ClientBaseController // TotalRollCallsDuration = total.ToFarsiHoursAndMinutes("-") // }; // } + + + private static bool TryParseDateTime(string date, string time, out DateTime result) + { + result = default; + + try + { + var dateTime = date.ToGeorgianDateTime(); + var timeOnly = TimeOnly.Parse(time); + result = dateTime.AddTicks(timeOnly.Ticks); + return true; + } + catch + { + return false; + } + } } \ No newline at end of file