diff --git a/ServiceHost/Areas/Client/Controllers/RollCall/CaseHistoryController.cs b/ServiceHost/Areas/Client/Controllers/RollCall/CaseHistoryController.cs index df1f1b9d..6ecead24 100644 --- a/ServiceHost/Areas/Client/Controllers/RollCall/CaseHistoryController.cs +++ b/ServiceHost/Areas/Client/Controllers/RollCall/CaseHistoryController.cs @@ -5,10 +5,10 @@ using ServiceHost.BaseControllers; namespace ServiceHost.Areas.Client.Controllers.RollCall; -public class CaseHistoryController:ClientBaseController +public class CaseHistoryController : ClientBaseController { private readonly IRollCallApplication _rollCallApplication; - private long _workshopId; + private readonly long _workshopId; public CaseHistoryController(IRollCallApplication rollCallApplication, IAuthHelper authHelper) @@ -18,14 +18,29 @@ public class CaseHistoryController:ClientBaseController } [HttpGet] - public async Task>> GetTitles(RollCallCaseHistorySearchModel searchModel) + public async Task>> GetTitles( + RollCallCaseHistorySearchModel searchModel) { return await _rollCallApplication.GetCaseHistoryTitles(_workshopId, searchModel); } [HttpGet("details")] - public async Task>> GetDetails(string titleId, RollCallCaseHistorySearchModel searchModel) + public async Task>> GetDetails(string titleId, + RollCallCaseHistorySearchModel searchModel) { return await _rollCallApplication.GetCaseHistoryDetails(_workshopId, titleId, searchModel); } + + /// + /// ایجاد و ویرایش + /// + /// + /// + [HttpPost] + public ActionResult Upsert(CreateOrEditEmployeeRollCall command) + { + command.WorkshopId = _workshopId; + return _rollCallApplication.ManualEdit(command); + } + } \ No newline at end of file diff --git a/ServiceHost/BaseControllers/AdminBaseController.cs b/ServiceHost/BaseControllers/AdminBaseController.cs index 2ba56a71..059774bf 100644 --- a/ServiceHost/BaseControllers/AdminBaseController.cs +++ b/ServiceHost/BaseControllers/AdminBaseController.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; + namespace ServiceHost.BaseControllers; [Authorize(Policy = "AdminArea")]