コード例 #1
0
        public InternalPriceSetInfo GetInternalPriceSetInfoList(int goodstype, Guid hostingFilialeId)
        {
            InternalPriceSetInfo internalPriceSetInfoList = new InternalPriceSetInfo();
            var sql = @"SELECT [GoodsType] ,[HostingFilialeId] ,[ReserveProfitRatio] FROM [InternalPriceSet]";

            if (goodstype != 0)
            {
                sql = sql + " WHERE GoodsType=" + goodstype + " AND HostingFilialeId = '" + hostingFilialeId + "'";
            }
            using (var rdr = SqlHelper.ExecuteReader(GlobalConfig.ERP_DB_NAME, true, sql))
            {
                while (rdr.Read())
                {
                    internalPriceSetInfoList.GoodsType = rdr["GoodsType"] == DBNull.Value
                        ? 0
                        : Convert.ToInt32(rdr["GoodsType"].ToString());
                    internalPriceSetInfoList.HostingFilialeId = rdr["HostingFilialeId"] == DBNull.Value
                        ? Guid.Empty
                        : new Guid(rdr["HostingFilialeId"].ToString());
                    internalPriceSetInfoList.ReserveProfitRatio = rdr["ReserveProfitRatio"] == DBNull.Value
                        ? "0.00"
                        : rdr["ReserveProfitRatio"].ToString();
                }
            }
            return(internalPriceSetInfoList);
        }
コード例 #2
0
        /// <summary> 获取StorageRecordInfo表信息
        /// </summary>
        /// <param name="dr">IDataReader</param>
        /// <returns></returns>
        private static InternalPriceSetInfo ReaderInternalPriceSetInfo(IDataReader dr)
        {
            var internalPriceSetInfo = new InternalPriceSetInfo
            {
                GoodsType          = dr["GoodsType"] == DBNull.Value ? 0 : Convert.ToInt32(dr["GoodsType"].ToString()),
                HostingFilialeId   = dr["HostingFilialeId"] == DBNull.Value ? Guid.Empty : new Guid(dr["HostingFilialeId"].ToString()),
                ReserveProfitRatio = dr["ReserveProfitRatio"] == DBNull.Value ? "0.00" : dr["ReserveProfitRatio"].ToString()
            };

            return(internalPriceSetInfo);
        }