示例#1
0
 private void map(VirtualInfo oParam, DataRow tempdr)
 {
     oParam.SysNo           = Util.TrimIntNull(tempdr["SysNo"]);
     oParam.ProductSysNo    = Util.TrimIntNull(tempdr["ProductSysNo"]);
     oParam.VirtualQty      = Util.TrimIntNull(tempdr["VirtualQty"]);
     oParam.CreateTime      = Util.TrimDateNull(tempdr["CreateTime"]);
     oParam.CreateUserSysNo = Util.TrimIntNull(tempdr["CreateUserSysNo"]);
 }
示例#2
0
 public ZFGood(ZFGood goodInfo)
 {
     this.ID           = goodInfo.ID;
     this.name         = goodInfo.name;
     this.description  = goodInfo.description;
     this.typePurchase = goodInfo.typePurchase;
     this.marketInfo   = new MarketInfo(goodInfo.marketInfo);
     this.virtualInfo  = new VirtualInfo(goodInfo.virtualInfo);
     this.goodType     = goodInfo.goodType;
 }
示例#3
0
        public void Create(VirtualInfo oParam)
        {
            TransactionOptions options = new TransactionOptions();

            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout        = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                //½¨Á¢¼Ç¼
                int rowsAffected = new VirtualDac().Insert(oParam);
                if (rowsAffected != 1)
                {
                    throw new BizException("insert virtual error");
                }

                InventoryManager.GetInstance().SetVirtualQty(oParam.ProductSysNo, oParam.VirtualQty);

                scope.Complete();
            }
        }
	public ZFGood(ZFGood goodInfo)
	{
		this.ID = goodInfo.ID;
		this.name = goodInfo.name;
		this.description = goodInfo.description;
		this.typePurchase = goodInfo.typePurchase;
		this.marketInfo = new MarketInfo(goodInfo.marketInfo);
		this.virtualInfo = new VirtualInfo(goodInfo.virtualInfo);
		this.goodType = goodInfo.goodType;
	}
	public ZFGood()
	{
		this.ID = "item_";
		this.marketInfo = new MarketInfo();
		this.virtualInfo = new VirtualInfo();
	}
	public VirtualInfo(VirtualInfo virtualInfo)
	{
		this.pvi_itemId = virtualInfo.pvi_itemId;
		this.pvi_amount = virtualInfo.pvi_amount;
	}
示例#7
0
        public int Insert(VirtualInfo oParam)
        {
            string     sql = @"INSERT INTO St_Virtual
                            (
                            ProductSysNo, VirtualQty, CreateTime, 
                            CreateUserSysNo
                            )
                            VALUES (
                            @ProductSysNo, @VirtualQty, @CreateTime, 
                            @CreateUserSysNo
                            );set @SysNo = SCOPE_IDENTITY();";
            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramSysNo           = new SqlParameter("@SysNo", SqlDbType.Int, 4);
            SqlParameter paramProductSysNo    = new SqlParameter("@ProductSysNo", SqlDbType.Int, 4);
            SqlParameter paramVirtualQty      = new SqlParameter("@VirtualQty", SqlDbType.Int, 4);
            SqlParameter paramCreateTime      = new SqlParameter("@CreateTime", SqlDbType.DateTime);
            SqlParameter paramCreateUserSysNo = new SqlParameter("@CreateUserSysNo", SqlDbType.Int, 4);

            paramSysNo.Direction = ParameterDirection.Output;

            if (oParam.ProductSysNo != AppConst.IntNull)
            {
                paramProductSysNo.Value = oParam.ProductSysNo;
            }
            else
            {
                paramProductSysNo.Value = System.DBNull.Value;
            }
            if (oParam.VirtualQty != AppConst.IntNull)
            {
                paramVirtualQty.Value = oParam.VirtualQty;
            }
            else
            {
                paramVirtualQty.Value = System.DBNull.Value;
            }
            if (oParam.CreateTime != AppConst.DateTimeNull)
            {
                paramCreateTime.Value = oParam.CreateTime;
            }
            else
            {
                paramCreateTime.Value = System.DBNull.Value;
            }
            if (oParam.CreateUserSysNo != AppConst.IntNull)
            {
                paramCreateUserSysNo.Value = oParam.CreateUserSysNo;
            }
            else
            {
                paramCreateUserSysNo.Value = System.DBNull.Value;
            }

            cmd.Parameters.Add(paramSysNo);
            cmd.Parameters.Add(paramProductSysNo);
            cmd.Parameters.Add(paramVirtualQty);
            cmd.Parameters.Add(paramCreateTime);
            cmd.Parameters.Add(paramCreateUserSysNo);

            return(SqlHelper.ExecuteNonQuery(cmd, out oParam.SysNo));
        }
示例#8
0
 public ZFGood()
 {
     this.ID          = "item_";
     this.marketInfo  = new MarketInfo();
     this.virtualInfo = new VirtualInfo();
 }
示例#9
0
 public VirtualInfo(VirtualInfo virtualInfo)
 {
     this.pvi_itemId = virtualInfo.pvi_itemId;
     this.pvi_amount = virtualInfo.pvi_amount;
 }