Ejemplo n.º 1
0
        /// <summary>
        /// 向GoodsPriceChange表插入一条数据,返回自增列数值,插入不成功则返回-1
        /// </summary>
        /// <param name="goodsPriceChange">GoodsPriceChange</param>
        /// <returns></returns>
        public bool AddGoodsPriceChange(GoodsPriceChange goodsPriceChange)
        {
            string sql = "insert into [GoodsPriceChange]([Id],[Name],[Datetime],[GoodsId],[GoodsName],[GoodsCode],[SaleFilialeId],[SaleFilialeName],[SalePlatformId],[SalePlatformName],[OldPrice],[NewPrice],[Quota],[Type])values(@Id,@Name,@Datetime,@GoodsId,@GoodsName,@GoodsCode,@SaleFilialeId,@SaleFilialeName,@SalePlatformId,@SalePlatformName,@OldPrice,@NewPrice,@Quota,@Type)";

            SqlParameter[] paras = PrepareCommandParameters(goodsPriceChange);
            return(SqlHelper.ExecuteNonQuery(GlobalConfig.ERP_DB_NAME, false, sql, paras) > 0);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据GoodsPriceChange表的Id字段更新数据
        /// </summary>
        /// <param name="goodsPriceChange">goodsPriceChange</param>
        /// <returns></returns>
        public bool UpdateGoodsPriceChangeById(GoodsPriceChange goodsPriceChange)
        {
            string sql = "update [GoodsPriceChange] set [Name] = @Name,[Datetime] = @Datetime,[GoodsId]=@GoodsId,[GoodsName] = @GoodsName,[GoodsCode] = @GoodsCode,[SaleFilialeId] = @SaleFilialeId,[SaleFilialeName] = @SaleFilialeName,[SalePlatformId] = @SalePlatformId,[SalePlatformName] = @SalePlatformName,[OldPrice] = @OldPrice,[NewPrice] = @NewPrice,[Quota] = @Quota,[Type] = @Type where [Id] = @Id";

            SqlParameter[] paras = PrepareCommandParameters(goodsPriceChange);
            return(SqlHelper.ExecuteNonQuery(GlobalConfig.ERP_DB_NAME, false, sql, paras) > 0);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 返回GoodsPriceChange表的所有数据
        /// </summary>
        /// <returns></returns>
        public List <GoodsPriceChange> GetAllGoodsPriceChange()
        {
            List <GoodsPriceChange> goodsPriceChangeList = new List <GoodsPriceChange>();

            string sql    = SQL_SELECT;
            var    reader = SqlHelper.ExecuteReader(GlobalConfig.ERP_DB_NAME, true, sql, null);

            while (reader.Read())
            {
                GoodsPriceChange goodsPriceChange = new GoodsPriceChange(reader);
                goodsPriceChangeList.Add(goodsPriceChange);
            }
            reader.Close();
            return(goodsPriceChangeList);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 根据GoodsPriceChange表的Id字段返回数据
        /// </summary>
        /// <param name="id">Id</param>
        /// <returns></returns>
        public GoodsPriceChange GetGoodsPriceChangeById(Guid id)
        {
            GoodsPriceChange goodsPriceChange = null;
            IDataReader      reader           = null;

            const string SQL = SQL_SELECT + "where [Id] = @Id";

            SqlParameter[] paras =
            {
                new SqlParameter("@Id", id)
            };
            reader = SqlHelper.ExecuteReader(GlobalConfig.ERP_DB_NAME, true, SQL, paras);
            if (reader.Read())
            {
                goodsPriceChange = new GoodsPriceChange(reader);
            }
            reader.Close();
            return(goodsPriceChange);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// prepare parameters
 /// </summary>
 public SqlParameter[] PrepareCommandParameters(GoodsPriceChange goodsPriceChange)
 {
     SqlParameter[] paras = new SqlParameter[] {
         new SqlParameter("@Id", goodsPriceChange.Id),
         new SqlParameter("@Name", goodsPriceChange.Name),
         new SqlParameter("@Datetime", goodsPriceChange.Datetime),
         new SqlParameter("@GoodsId", goodsPriceChange.GoodsId),
         new SqlParameter("@GoodsName", goodsPriceChange.GoodsName),
         new SqlParameter("@GoodsCode", goodsPriceChange.GoodsCode),
         new SqlParameter("@SaleFilialeId", goodsPriceChange.SaleFilialeId),
         new SqlParameter("@SaleFilialeName", goodsPriceChange.SaleFilialeName),
         new SqlParameter("@SalePlatformId", goodsPriceChange.SalePlatformId),
         new SqlParameter("@SalePlatformName", goodsPriceChange.SalePlatformName),
         new SqlParameter("@OldPrice", goodsPriceChange.OldPrice),
         new SqlParameter("@NewPrice", goodsPriceChange.NewPrice),
         new SqlParameter("@Quota", goodsPriceChange.Quota),
         new SqlParameter("@Type", goodsPriceChange.Type)
     };
     return(paras);
 }
 /// <summary>
 /// 根据GoodsPriceChange表的Id字段更新数据
 /// </summary>
 /// <param name="goodsPriceChange">goodsPriceChange</param>
 /// <returns>返回受影响的行数</returns>
 public bool UpdateGoodsPriceChangeById(GoodsPriceChange goodsPriceChange)
 {
     return(_goodsPriceChange.UpdateGoodsPriceChangeById(goodsPriceChange));
 }
 /// <summary>
 /// 向GoodsPriceChange表插入一条数据,插入成功则返回自增列数值,插入不成功则返回-1
 /// </summary>
 /// <param name="goodsPriceChange">GoodsPriceChange</param>
 /// <returns></returns>
 public bool AddGoodsPriceChange(GoodsPriceChange goodsPriceChange)
 {
     return(_goodsPriceChange.AddGoodsPriceChange(goodsPriceChange));
 }