!提交代码
This commit is contained in:
59
WCS.BLL/Manager/ShelfManager.cs
Normal file
59
WCS.BLL/Manager/ShelfManager.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.BLL.HardWare;
|
||||
using WCS.DAL.Db;
|
||||
using WCS.DAL.DbModels;
|
||||
|
||||
namespace WCS.BLL.Manager
|
||||
{
|
||||
public static class ShelfManager
|
||||
{
|
||||
public static List<IShelfBase> Shelves { get; set; } = new List<IShelfBase>();
|
||||
static ShelfManager()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static void InitShelves()
|
||||
{
|
||||
DbHelp.db.CodeFirst.InitTables(typeof(ModuleInfo), typeof(ShelfInfo), typeof(StoreInfo)
|
||||
, typeof(InventoryDetail), typeof(OutOrder), typeof(OutOrderDetail), typeof(OutOrderMatDetail)
|
||||
, typeof(ShelfTypeInfo), typeof(MatBaseInfo), typeof(MatInfo)
|
||||
);
|
||||
|
||||
DbHelp.dbLog.CodeFirst.InitTables(typeof(SystemApiLogRecord));
|
||||
|
||||
var shelvesInDb = DbHelp.db.Queryable<ShelfInfo>().ToList();
|
||||
foreach (var shelfInDb in shelvesInDb)
|
||||
{
|
||||
Shelves.Add(InitShelf(shelfInDb));
|
||||
}
|
||||
}
|
||||
|
||||
public static IShelfBase InitShelf(ShelfInfo shelfInDb)
|
||||
{
|
||||
switch (shelfInDb.ShelfTypeId)
|
||||
{
|
||||
case 1:
|
||||
return new SmartShelf(shelfInDb)
|
||||
{
|
||||
ShelfId = shelfInDb.Id,
|
||||
ShelfCode = shelfInDb.ShelfCode,
|
||||
GroupName = shelfInDb.GroupName,
|
||||
};
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void GoInInstore()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user