コード例 #1
0
        public IList <Keede.Ecsoft.Model.WaitCheckGoodsInfo> GetWaitCheckGoodsInfo(Guid warehouseId, WaitCheckGoodsState state, string goodsName)
        {
            const string SQL = "SELECT [GoodsId],[GoodsName],[State],[WarehouseId] FROM lmshop_WaitCheckGoods WHERE [WarehouseId]=@warehouseId AND [State]=@state AND CHARINDEX(@goodsname,GoodsName)>0";

            var sqlparams = new[] {
                new SqlParameter("@state", (int)state),
                new SqlParameter("@warehouseId", warehouseId),
                new SqlParameter("@goodsname", goodsName)
            };
            IList <Keede.Ecsoft.Model.WaitCheckGoodsInfo> list = new List <Keede.Ecsoft.Model.WaitCheckGoodsInfo>();

            using (var dr = SqlHelper.ExecuteReader(GlobalConfig.ERP_DB_NAME, true, SQL, sqlparams))
            {
                while (dr.Read())
                {
                    var entity = new Keede.Ecsoft.Model.WaitCheckGoodsInfo
                    {
                        GoodsId     = dr.GetGuid(0),
                        GoodsName   = dr.GetString(1),
                        State       = dr.GetInt32(2),
                        WarehouseId = dr.GetGuid(3)
                    };
                    list.Add(entity);
                }
            }

            return(list);
        }
コード例 #2
0
        public Keede.Ecsoft.Model.WaitCheckGoodsInfo GetCheckGoodsInfo(Guid goodsId, Guid warehouseId)
        {
            const string SQL = "SELECT [GoodsId],[GoodsName],[State],[WarehouseId] FROM lmshop_WaitCheckGoods WHERE [WarehouseId]=@warehouseId AND [GoodsId]=@goodsId";

            var sqlparams = new[] {
                new SqlParameter("@warehouseId", warehouseId),
                new SqlParameter("@goodsId", goodsId)
            };

            Keede.Ecsoft.Model.WaitCheckGoodsInfo entity = null;

            using (var dr = SqlHelper.ExecuteReader(GlobalConfig.ERP_DB_NAME, true, SQL, sqlparams))
            {
                if (dr.Read())
                {
                    entity = new Keede.Ecsoft.Model.WaitCheckGoodsInfo
                    {
                        GoodsId     = dr.GetGuid(0),
                        GoodsName   = dr.GetString(1),
                        State       = dr.GetInt32(2),
                        WarehouseId = dr.GetGuid(3)
                    };
                }
            }
            return(entity);
        }
コード例 #3
0
        public int InsertWaitCheckGoodsInfo(Keede.Ecsoft.Model.WaitCheckGoodsInfo info)
        {
            const string SQL       = "INSERT lmshop_WaitCheckGoods([GoodsId],[GoodsName],[State],[WarehouseId]) VALUES(@goodsId,@goodsName,@state,@warehouseId)";
            var          sqlparams = new[] {
                new SqlParameter("@goodsId", info.GoodsId),
                new SqlParameter("@goodsName", info.GoodsName),
                new SqlParameter("@state", info.State),
                new SqlParameter("@warehouseId", info.WarehouseId)
            };

            return(SqlHelper.ExecuteNonQuery(GlobalConfig.ERP_DB_NAME, false, SQL, sqlparams));
        }