add tomam

This commit is contained in:
2025-05-30 23:34:08 +03:30
parent 394d65db31
commit 24982e11d3

View File

@@ -46,6 +46,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
}
public IActionResult OnPostShiftDate()
{
//var startRollCall = new DateTime(2025, 2, 19);
@@ -79,6 +80,33 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
ViewData["message"] = "تومام یک";
return Page();
}
public async Task<IActionResult> OnPostShiftDateNew2()
{
//var startRollCall = new DateTime(2025, 3, 21);
//var rollCalls = _context.RollCalls.Where(x => x.StartDate >= startRollCall && x.EndDate != null ).ToList();
//var r1 = rollCalls.Skip(10000).Take(10000).ToList();
//Console.ForegroundColor = ConsoleColor.DarkRed;
//Console.WriteLine("endStep 1 ============");
//SetRollCall(r1);
await SetWorkshopRoleSubAccount();
ViewData["message"] = "تومام دو";
return Page();
}
private async System.Threading.Tasks.Task SetWorkshopRoleSubAccount()
{
var subAccountRoles = _accountContext.SubAccountRoles.Include(x=>x.SubAccounts).ToList();
subAccountRoles.ForEach(role =>
{
var subAccount = role.SubAccounts.First().id;
var workshopIds = _context.WorkshopSubAccounts.Where(x=>x.SubAccountId == subAccount).Select(x=>x.WorkshopId).ToList();
role.Edit(role.Title,role.RolePermissions.Select(x=>x.PermissionCode).ToList(),workshopIds);
});
await _accountContext.SaveChangesAsync();
}
private void SetEntityIdForCheckoutValuesTemp()
@@ -214,20 +242,6 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
}
}
public async Task<IActionResult> OnPostShiftDateNew2()
{
//var startRollCall = new DateTime(2025, 3, 21);
//var rollCalls = _context.RollCalls.Where(x => x.StartDate >= startRollCall && x.EndDate != null ).ToList();
//var r1 = rollCalls.Skip(10000).Take(10000).ToList();
//Console.ForegroundColor = ConsoleColor.DarkRed;
//Console.WriteLine("endStep 1 ============");
//SetRollCall(r1);
await SetCalculationDateInSalaryAid();
ViewData["message"] = "تومام دو";
return Page();
}
private async System.Threading.Tasks.Task SetCalculationDateInSalaryAid()
{