diff --git a/ServiceHost/Areas/Client/Controllers/EmployeeBankInfoController.cs b/ServiceHost/Areas/Client/Controllers/EmployeeBankInfoController.cs index ade64458..1af0e2e9 100644 --- a/ServiceHost/Areas/Client/Controllers/EmployeeBankInfoController.cs +++ b/ServiceHost/Areas/Client/Controllers/EmployeeBankInfoController.cs @@ -43,13 +43,25 @@ public class EmployeeBankInfoController : ClientBaseController command.WorkshopId = _workshopId; return _employeeBankInformationApplication.Edit(command); } - [HttpDelete] - public ActionResult Remove([FromQuery]long id) + [HttpDelete("delete-by-employee/{employeeId:long}")] + public ActionResult Remove(long employeeId) { - return _employeeBankInformationApplication.Remove(id); + return _employeeBankInformationApplication.RemoveByEmployeeId(_workshopId, employeeId); + + } + + [HttpDelete("delete-one/{id:long}")] + public IActionResult OnPostDelete(long id) + { + var result = _employeeBankInformationApplication.Remove(id); + return new JsonResult(new + { + success = result.IsSuccedded, + message = result.Message, + }); } - [HttpPost] + [HttpPost("excel")] public ActionResult DownloadExcel([FromBody]DownloadExcelRequest request) { @@ -74,6 +86,19 @@ public class EmployeeBankInfoController : ClientBaseController "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $"اطلاعات بانکی پرسنل.xlsx"); } + + [HttpPost("set-default/{bankId:long}")] + public IActionResult SetDefault(long bankId) + { + var result = _employeeBankInformationApplication.SetDefault(_workshopId, bankId); + return new JsonResult(new + { + success = result.IsSuccedded, + message = result.Message, + id = result.SendId + }); + } + } public class DownloadExcelRequest {