From 2d47e18d457db5eb4321d8432fa6fb6a535d9917 Mon Sep 17 00:00:00 2001 From: "yang.lee" Date: Fri, 1 Dec 2023 22:42:28 +0800 Subject: [PATCH] 1 --- WarehouseMgr/Tnb.WarehouseMgr/WmsInternalTempTestService.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsInternalTempTestService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsInternalTempTestService.cs index a8b91d9f..a509541d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsInternalTempTestService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsInternalTempTestService.cs @@ -30,9 +30,8 @@ namespace Tnb.WarehouseMgr List list = await _db.Queryable().Where(it => it.location_code.StartsWith("CP-A", StringComparison.OrdinalIgnoreCase)).OrderBy(i => i.location_code).ToListAsync(); foreach (var loc in list) { - ReadOnlySpan inputSpan = loc.location_code.AsSpan(); - ReadOnlySpan lastTwoCharacters = inputSpan.Slice(inputSpan.Length - 2); - int num = lastTwoCharacters.ToString().Match(@"\d+").ParseToInt(); + var input = loc.location_code.Substring(loc.location_code.Length - 2); + int num = input.Match(@"\d+").ParseToInt(); await _db.Updateable().SetColumns(it => it.loc_column == num).Where(it => it.id == loc.id).ExecuteCommandAsync(); }