This commit is contained in:
2025-09-15 10:59:51 +08:00
parent 62654a7aea
commit a1b669a75a
7 changed files with 58 additions and 9 deletions
@@ -5,7 +5,7 @@ using System.Text;
namespace BLL
{
public static class UnitStoreService
public static class UnitStoreService
{
/// <summary>
/// 根据主键获取单位仓库
@@ -19,7 +19,7 @@ namespace BLL
public static List<Model.Weld_UnitStore> GetUnitStoreByUnitId(string unitId)
{
return Funs.DB.Weld_UnitStore.Where(e => e.UnitId==unitId).ToList();
return Funs.DB.Weld_UnitStore.Where(e => e.UnitId == unitId).ToList();
}
/// <summary>
@@ -35,6 +35,7 @@ namespace BLL
newUnitStore.UnitStoreCode = unitStore.UnitStoreCode;
newUnitStore.UnitStoreName = unitStore.UnitStoreName;
newUnitStore.StorePosition = unitStore.StorePosition;
newUnitStore.IsUsed = unitStore.IsUsed;
db.Weld_UnitStore.InsertOnSubmit(newUnitStore);
db.SubmitChanges();
}
@@ -53,6 +54,7 @@ namespace BLL
newUnitStore.UnitStoreCode = unitStore.UnitStoreCode;
newUnitStore.UnitStoreName = unitStore.UnitStoreName;
newUnitStore.StorePosition = unitStore.StorePosition;
newUnitStore.IsUsed = unitStore.IsUsed;
db.SubmitChanges();
}
}
@@ -118,6 +120,7 @@ namespace BLL
{
var store = from x in Funs.DB.Weld_UnitStore
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.IsUsed == true
orderby y.UnitName, x.UnitStoreCode
select new { x.UnitStoreId, UnitStoreName = x.UnitStoreName, y.UnitName, x.UnitId };
if (!string.IsNullOrEmpty(unitId))
@@ -146,7 +149,7 @@ namespace BLL
string name = string.Empty;
var store = from x in Funs.DB.Weld_UnitStore
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.UnitStoreId== unitStoreId
where x.UnitStoreId == unitStoreId
orderby y.UnitName, x.UnitStoreCode
select new { x.UnitStoreId, UnitStoreName = (y.UnitName + "(" + x.UnitStoreName + ")"), y.UnitName, x.UnitId };
if (store.Count() > 0)