60 lines
2.0 KiB
C#
60 lines
2.0 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Data;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Threading.Tasks;
|
|||
|
|
using WMS.IData;
|
|||
|
|
using WMS.Model.Base;
|
|||
|
|
|
|||
|
|
namespace WMS.SqlServerData.BaseData
|
|||
|
|
{
|
|||
|
|
public class AreaGoodsData
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 新增物料库区
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="areaGoods"></param>
|
|||
|
|
public void InsertAreaGoods(AreaGoodsModel areaGoods)
|
|||
|
|
{
|
|||
|
|
string sqlStr = " insert into T_BASE_AREA_GOODS(AREA_ID,Storage_id,GOODS_ID)valus('"+ areaGoods.AREA_ID+ "','"+ areaGoods .Storage_id+ "','"+ areaGoods .Goods_ID+ "') ";
|
|||
|
|
|
|||
|
|
|
|||
|
|
SystemDataObject.Instance.ExecuteSql(sqlStr);
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 删除库区物料信息
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="areaGoods"></param>
|
|||
|
|
public void DelAreaGoods(AreaGoodsModel areaGoods)
|
|||
|
|
{
|
|||
|
|
string sqlStr = "delete T_BASE_AREA_GOODS where AREA_ID='" + areaGoods.AREA_ID + "'and GOODS_ID= '" + areaGoods.Goods_ID + "'";
|
|||
|
|
|
|||
|
|
SystemDataObject.Instance.ExecuteSql(sqlStr);
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 查询库区物料信息
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="areaGoods"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public DataTable GetAreaGoods(AreaGoodsModel areaGoods)
|
|||
|
|
{
|
|||
|
|
string sqlStr = @" select t.*,a.GOODS_NAME,b.STORAGE_AREA_NAME from T_BASE_AREA_GOODS t
|
|||
|
|
left join[dbo].[T_BASE_GOODS] a on t.GOODS_ID=a.GOODS_ID
|
|||
|
|
left join[dbo].[T_BASE_STORAGE_AREA] b on t.AREA_ID =b.STORAGE_AREA_ID where 1=1";
|
|||
|
|
if(areaGoods.Goods_ID.Trim().Length>0)
|
|||
|
|
{
|
|||
|
|
sqlStr = sqlStr + " and t.GOODS_ID='" + areaGoods.Goods_ID + "'";
|
|||
|
|
}
|
|||
|
|
if(areaGoods.AREA_ID.Trim().Length>0)
|
|||
|
|
{
|
|||
|
|
sqlStr = sqlStr + " and t.AREA_ID='" + areaGoods.AREA_ID + "'";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return SystemDataObject.Instance.GetDataTable(sqlStr);
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|