add new ajax metod

This commit is contained in:
SamSys
2025-05-14 19:31:56 +03:30
parent 8aa8ffe8c8
commit f7f44b98fb

View File

@@ -167,6 +167,39 @@ public class AutoExtensionModel : PageModel
//Correction();
}
public IActionResult GetEmployeesStartedWorkInSelectedPeriod(long workshopId, string startDate)
{
var start = startDate.ToGeorgianDateTime();
var end = ($"{startDate.FindeEndOfMonth()}").ToGeorgianDateTime();
var LeftWorkSerchModel = new LeftWorkSearchModel
{
WorkshopId = workshopId
};
var leftWorkList = _leftWorkApplication.search(LeftWorkSerchModel);
if (leftWorkList.Count > 0)
{
var res = leftWorkList.Where(x => x.StartWorkDateGr <= end && x.StartWorkDateGr > start).ToList();
if (res.Count > 0)
{
return new JsonResult(new
{
founded = true,
leftWorkList = res,
});
}
}
return new JsonResult(new
{
founded = false,
});
}
public IActionResult OnGetContractStatus(long employeeId, long workshopId, string employeeName, string workshopname)
{
var command = new ContractStatusViewModel();