PSI.DAL/StoreDAL.cs
(开头部分) 11KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using PSI.Common;
using PSI.DbUtility;
using PSI.Models.DModels;
using PSI.Models.VModels;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PSI.DAL
{
public class StoreDAL:BaseDAL<StoreInfoModel>
{
StoreGoodsStockDAL sgsDAL = new StoreGoodsStockDAL();
/// <summary>
/// 获取指定类别的仓库列表
/// </summary>
/// <param name="typeId"></param>
/// <returns></returns>
public List<StoreInfoModel> GetStoresByTypeId(int typeId)
{
List<StoreInfoModel> list = GetModelList($"IsDeleted=0 and STypeId={typeId}", "StoreId,StoreName,StoreNo");
return list;
}
/// <summary>
/// 获取所有的仓库列表(用于绑定下拉框)
/// </summary>
/// <returns></returns>
public List<StoreInfoModel> GetAllStores()
{
return GetModelList("IsDeleted=0", "StoreId,StoreName");
}
/// <summary>
/// 获取所有的仓库编号集合
/// </summary>
/// <returns></returns>
public List<int> GetAllStoreIds()
{
List<StoreInfoModel> stores = GetModelList("IsDeleted=0", "StoreId");
List<int> ids = new List<int>();
if (stores.Count > 0)
ids = stores.Select(s => s.StoreId).ToList();
return ids;
}
/// <summary>
/// 检查仓库是否在使用中
/// </summary>
/// <param name="storeId"></param>
/// <returns></returns>
public bool CheckStoreUse(int storeId)
{
string sql1 = $"select count(1) from PerchaseInStoreInfos where StoreId={storeId} and IsDeleted=0";
string sql2 = $"select count(1) from SaleOutStoreInfos where StoreId={storeId} and IsDeleted=0";
string sql3 = $"select count(1) from StoreGoodsStockInfos where StoreId={storeId} and (CurCount>0 or StCount>0) and IsDeleted=0";
string sql4 = $"select count(1) from StockStoreInfos where StoreId={storeId} and IsDeleted=0";
后面还有 154 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。