Esempio n. 1
0
 /// <summary>
 /// 插入数据
 /// </summary>
 /// <param name="obj">对象</param>
 /// <returns>返回:该条数据的主键Id</returns>
 public int Insert(MPurchase obj)
 {
     if (obj == null) throw new ArgumentNullException("obj");
     String stmtId = "MPurchase.Insert";
     return SqlMapper.Instance().QueryForObject<int>(stmtId, obj);
 }
Esempio n. 2
0
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="obj"></param>
 /// <returns>返回:ture 成功,false 失败</returns>
 public bool Update(MPurchase obj)
 {
     if (obj == null) throw new ArgumentNullException("obj");
     String stmtId = "MPurchase.Update";
     int result = SqlMapper.Instance().QueryForObject<int>(stmtId, obj);
     return result > 0 ? true : false;
 }
Esempio n. 3
0
 /// <summary>
 /// 插入数据
 /// </summary>
 /// <param name="obj">对象</param>
 /// <returns>返回:该条数据的主键Id</returns>
 public int Insert(MPurchase obj)
 {
     return dal.Insert(obj);
 }
Esempio n. 4
0
        /// <summary>
        /// 支付成功的后续事件
        /// </summary>
        public void ExecAfterPaid()
        {
            OrderService os = new OrderService();
            os.Initialize();

            U_UserInfo u = os.UserInfoBll.Get(this.UserId);
            TOrder o = os.TOrderBll.GetOrderAndDetail(this.OrderId);
            //检测订单状态
            CheckOrder(o, new OrderStatus[] { OrderStatus.NewOrder }, u);
            //更新订单状态
            os.TOrderBll.UpdateState2Paid(o.OrderId, this.Status, this.PayWay, this.PayDetail);

            //加入到我的购买
            DDocInfo buyDoc = os.DDocInfoBll.Get(o.OrderDetails[0].DocId);
            if (buyDoc != null)
            {
                MPurchase mp = new MPurchase()
                {
                    DocId = buyDoc.DocId,
                    Price = buyDoc.Price,
                    PurchaseTime = DateTime.Now,
                    UserId = this.UserId,
                    Title = buyDoc.Title,
                    Saler = buyDoc.UserId,
                    DocType = buyDoc.DocType
                };
                os.MPurchaseBll.Insert(mp);
                //给上传人返利
                AddAmountForUploader(o.OrderId, buyDoc.UserId, o.Total, os, buyDoc.DocId, buyDoc.Title, this.UserId, this.PayWay);
            }
            if (!string.IsNullOrEmpty(this.GotoUrl)) {
                HttpContext.Current.Response.Redirect(GotoUrl);
            }
        }
Esempio n. 5
0
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <param name="obj"></param>
 /// <returns>返回:ture 成功,false 失败</returns>
 public bool Update(MPurchase obj)
 {
     return dal.Update(obj);
 }