diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/Grouping.cshtml.cs b/ServiceHost/Areas/Client/Pages/Company/RollCall/Grouping.cshtml.cs index 25a4917d..2b8be490 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/Grouping.cshtml.cs +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/Grouping.cshtml.cs @@ -38,7 +38,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall public CustomizeWorkshopSettingsViewModel RollCallWorkshopSettings; public List RollCallEmployeeList; - public GroupingModel(IPasswordHasher passwordHasher, IWorkshopApplication workshopApplication, ICustomizeWorkshopSettingsApplication rollCallWorkshopSettingsApplication, IEmployeeApplication employeeApplication, IHttpContextAccessor contextAccessor, IAuthHelper authHelper, IRollCallEmployeeApplication rollCallEmployeeApplication, IRollCallApplication rollCallApplication) + public GroupingModel(IPasswordHasher passwordHasher, IWorkshopApplication workshopApplication, ICustomizeWorkshopSettingsApplication rollCallWorkshopSettingsApplication, IEmployeeApplication employeeApplication, IHttpContextAccessor contextAccessor, IAuthHelper authHelper, IRollCallEmployeeApplication rollCallEmployeeApplication, IRollCallApplication rollCallApplication) { _passwordHasher = passwordHasher; _workshopApplication = workshopApplication; @@ -249,19 +249,19 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall public IActionResult OnGetEmployeesHaveToChange(long groupId, bool isChange) { - var result = _customizeWorkshopSettingsApplication.GetEmployeeSettingsByGroupSettingsId(groupId) - .Where(x => x.IsSettingChanged = isChange).ToList(); - return new JsonResult(new - { - success = true, - data = result - }); + var result = _customizeWorkshopSettingsApplication.GetEmployeeSettingsByGroupSettingsId(groupId) + .Where(x => x.IsSettingChanged = isChange).ToList(); + return new JsonResult(new + { + success = true, + data = result + }); } public IActionResult OnPostChangeEditEmployee(EditCustomizeEmployeeSettings command, List reCalculateCommand) { - command.WorkshopId = _workshopId; - OperationResult result = _customizeWorkshopSettingsApplication.EditSimpleRollCallEmployeeSetting(command, reCalculateCommand); + command.WorkshopId = _workshopId; + OperationResult result = _customizeWorkshopSettingsApplication.EditSimpleRollCallEmployeeSetting(command, reCalculateCommand); return new JsonResult(new { success = result.IsSuccedded, @@ -280,14 +280,14 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall public IActionResult OnPostReCalculateValues(List command) { - var result = _rollCallApplication.RecalculateValues(_workshopId, command); + var result = _rollCallApplication.RecalculateValues(_workshopId, command); - return new JsonResult(new - { - success = result.IsSuccedded, - message = result.Message - }); - } + return new JsonResult(new + { + success = result.IsSuccedded, + message = result.Message + }); + } public IActionResult OnGetDownloadExcel() { @@ -359,6 +359,17 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall $"اطلاعات گروهبندی.xlsx"); } + public IActionResult OnPostValidateGroupEdit(List command) + { + var result = _customizeWorkshopSettingsApplication.ValidateReCalculateValueForGroupEdit(command, _workshopId); + return new JsonResult(new + { + success = result.IsSuccedded, + message = result.Message, + data = result.Data + }); + } + // public IActionResult OnGetGroupingSetting(long groupId) // { // var command = _customizeWorkshopSettingsApplication.GetCustomizeWorkshopGroupSettingsDetails(groupId);