Exemplo n.º 1
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Update(WXHouseOrderEntity pEntity, IDbTransaction pTran)
 {
     Update(pEntity, true, pTran);
 }
Exemplo n.º 2
0
 public void Update(WXHouseOrderEntity pEntity, bool pIsUpdateNullField, IDbTransaction pTran)
 {
     _currentDAO.Update(pEntity, pIsUpdateNullField, pTran);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Create(WXHouseOrderEntity pEntity)
 {
     _currentDAO.Create(pEntity);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 在事务内创建一个新实例
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param>
 public void Create(WXHouseOrderEntity pEntity, IDbTransaction pTran)
 {
     _currentDAO.Create(pEntity, pTran);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public WXHouseOrderEntity[] QueryByEntity(WXHouseOrderEntity pQueryEntity, OrderBy[] pOrderBys)
 {
     return(_currentDAO.QueryByEntity(pQueryEntity, pOrderBys));
 }
Exemplo n.º 6
0
 /// <summary>
 /// 分页根据实体条件查询实体
 /// </summary>
 /// <param name="pQueryEntity">以实体形式传入的参数</param>
 /// <param name="pOrderBys">排序组合</param>
 /// <returns>符合条件的实体集</returns>
 public PagedQueryResult <WXHouseOrderEntity> PagedQueryByEntity(WXHouseOrderEntity pQueryEntity, OrderBy[] pOrderBys, int pPageSize, int pCurrentPageIndex)
 {
     return(_currentDAO.PagedQueryByEntity(pQueryEntity, pOrderBys, pPageSize, pCurrentPageIndex));
 }
Exemplo n.º 7
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="pEntity"></param>
 public void Delete(WXHouseOrderEntity pEntity)
 {
     _currentDAO.Delete(pEntity);
 }
Exemplo n.º 8
0
 public void Update(WXHouseOrderEntity pEntity, bool pIsUpdateNullField)
 {
     _currentDAO.Update(pEntity, pIsUpdateNullField);
 }
Exemplo n.º 9
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="pEntity">实体实例</param>
 public void Update(WXHouseOrderEntity pEntity)
 {
     Update(pEntity, true);
 }
Exemplo n.º 10
0
        /// <summary>
        /// 支付(过户)。
        /// </summary>
        /// <returns></returns>
        public static void TransferCallBack(string content)
        {
            Loggers.DEFAULT.Debug(new DebugLogInfo {
                Message = "支付(过户)"
            });
            // 解析strXML为SendBuyMessage响应对象
            SendPayMessage model  = GetPayModelResponse(content);
            Hashtable      htComm = GetCommonreturn(model.Commonreturn);

            string customerId    = htComm["CustomerID"].ToString();
            string userId        = htComm["UserID"].ToString();
            string prePaymentId  = htComm["PrePaymentID"].ToString();
            string seqNo         = htComm["SeqNO"].ToString();
            string merchantdate  = htComm["Merchantdate"].ToString();
            string resultPageUrl = htComm["ToPageURL"].ToString();

            Loggers.DEFAULT.Debug(new DebugLogInfo {
                Message = "ToPageUrl" + resultPageUrl
            });
            var loggingSessionInfo = Default.GetBSLoggingSession(customerId, userId);

            int    fundState; //交易状态
            string retMsg;

            //判断华安赎回返回Retcode状态
            if (model.Retcode == "0000")
            {
                fundState = (int)PayHouseStateEnum.Order;
                retMsg    = "委托已受理";
            }
            else
            {
                fundState = (int)PayHouseStateEnum.Unsold;
                retMsg    = "委托失败";
            }

            #region 更新订单表中的证件号码
            var orderBll = new WXHouseOrderBLL(loggingSessionInfo);
            WXHouseOrderEntity orderEntity = orderBll.GetByID(prePaymentId);
            if (orderEntity != null)
            {
                orderEntity.Assbuyeridno = model.Assbuyeridno;
            }
            orderBll.Update(orderEntity);
            #endregion

            #region   增加支付记录
            var redeemBll = new WXHouseReservationPayBLL(loggingSessionInfo);
            WXHouseReservationPayEntity entity = redeemBll.GetByPrePaymentID(customerId, prePaymentId);
            if (entity != null)
            {
                entity.FundState = fundState;
                entity.HaorderNO = model.HaorderNO;
                redeemBll.Update(entity);
            }
            else
            {
                entity = new WXHouseReservationPayEntity
                {
                    ReservationPayID = Guid.NewGuid(),
                    PrePaymentID     = new Guid(prePaymentId),
                    SeqNO            = seqNo,
                    Fundtype         = (int)FundtypeeEnum.ReservationPay,
                    FundState        = fundState,
                    Merchantdate     = merchantdate,
                    HaorderNO        = model.HaorderNO
                };
                int haDt;
                int.TryParse(model.Hatradedt, out haDt);

                entity.Hatradedt  = haDt;
                entity.Retmsg     = model.Retmsg;
                entity.Retcode    = model.Retcode;
                entity.CustomerID = customerId;

                redeemBll.Create(entity);
            }
            #endregion

            string toPageUrl = resultPageUrl + "&type=3&retStatus=" + fundState + "&retMsg=" + retMsg + "&Retcode=" + model.Retcode;
            RedirectUrl(toPageUrl);
        }
Exemplo n.º 11
0
        /// <summary>
        /// 购买回调。
        /// </summary>
        /// <returns></returns>
        public static void BuyCallBack(string content)
        {
            Loggers.DEFAULT.Debug(new DebugLogInfo {
                Message = "BuyCallBack: " + DateTime.Now
            });

            //解析strXML为SendBuyMessage响应对象
            SendBuyMessage model  = GetBuyModelResponse(content);
            Hashtable      htComm = GetCommonreturn(model.Commonreturn);

            string customerId    = htComm["CustomerID"].ToString();
            string userId        = htComm["UserID"].ToString();
            string houseDetailId = htComm["HouseDetailID"].ToString();
            string seqNo         = htComm["SeqNO"].ToString();
            string merchantdate  = htComm["Merchantdate"].ToString();
            string houseId       = htComm["HouseID"].ToString();

            Loggers.DEFAULT.Debug(new DebugLogInfo {
                Message = "SeqNo: " + seqNo
            });

            string orgtotalamt        = model.Orgtotalamt; //实际交易额
            var    loggingSessionInfo = Default.GetBSLoggingSession(customerId, userId);

            //1判断会员楼盘明细映射是否存在记录
            var     bll       = new WXHouseVipMappingBLL(loggingSessionInfo);
            DataSet ds        = bll.VerifWXHouseVipMapping(userId, houseDetailId, customerId);
            Guid    mappingId = Guid.NewGuid();

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                //1.1存在
                mappingId = new Guid(ds.Tables[0].Rows[0]["MappingID"].ToString());
            }
            else
            {
                //1.2不存在
                //插入会员楼盘明细映射表
                var houserVipMappingEntity = new WXHouseVipMappingEntity
                {
                    MappingID  = mappingId,
                    DetailID   = new Guid(houseDetailId),
                    CustomerID = customerId,
                    VIPID      = userId,
                    ReserveNo  = seqNo
                };
                houserVipMappingEntity.CustomerID = customerId;
                bll.Create(houserVipMappingEntity);
            }

            DateTime dt      = DateTime.Now;
            string   orderNo = GenerateOrderNo(dt);

            #region  1.4插入订单信息
            var  orderBll     = new WXHouseOrderBLL(loggingSessionInfo);
            var  orderEntity  = new WXHouseOrderEntity();
            Guid prePaymentId = Guid.NewGuid();  //订单表ID
            orderEntity.PrePaymentID = prePaymentId;
            orderEntity.MappingID    = mappingId;
            orderEntity.OrderNO      = orderNo;
            orderEntity.OrderDate    = Convert.ToDateTime(dt.ToString("yyyy-MM-dd HH:mm:ss"));
            orderEntity.RealPay      = Convert.ToDecimal(orgtotalamt); //实付金额
            var assignbuyerBll = new WXHouseAssignbuyerBLL(loggingSessionInfo);
            WXHouseAssignbuyerEntity buyerEntity = assignbuyerBll.GetWXHouseAssignbuyer(customerId, userId);
            if (buyerEntity != null)
            {
                orderEntity.AssignbuyerID = buyerEntity.AssignbuyerID;
            }
            orderEntity.ThirdOrderNo   = model.Logisticsinfo;
            orderEntity.Assbuyeridtp   = model.Assbuyeridtp;
            orderEntity.Assbuyername   = model.Assbuyername;
            orderEntity.Assbuyermobile = model.Assbuyermobile;

            orderEntity.CustomerID = customerId;
            orderBll.Create(orderEntity);
            #endregion


            #region  购买基金
            var fundBll    = new WXHouseBuyFundBLL(loggingSessionInfo);
            var fundEntity = new WXHouseBuyFundEntity
            {
                BuyFundID    = Guid.NewGuid(),
                PrePaymentID = prePaymentId,
                Fundtype     = 2101,
                PayDate      = dt.ToString("yyyy-MM-dd HH:mm:ss"),
                Merchantdate = merchantdate,
                SeqNO        = seqNo,
                Retmsg       = model.Retmsg,
                CustomerID   = customerId
            };

            Loggers.DEFAULT.Debug(new DebugLogInfo {
                Message = "Retcode" + model.Retcode
            });

            string retMsg;
            int    fundState;
            //判断华安赎回返回Retcode状态
            if (model.Retcode == "0000")
            {
                //2 更改楼盘表销售数量 HouseDetailID
                var buildBll = new WXHouseBuildBLL(loggingSessionInfo);
                WXHouseBuildEntity buildEntity = buildBll.GetByID(houseId);
                if (buildEntity != null)
                {
                    buildEntity.SaleHoseNum += 1;
                    buildBll.Update(buildEntity);
                }

                retMsg    = "支付成功";
                fundState = (int)FundStateEnum.Success;
            }
            else if (model.Retcode == "0999")
            {
                retMsg    = "委托已受理";
                fundState = (int)FundStateEnum.Order;
            }
            else
            {
                retMsg    = "支付失败";
                fundState = (int)FundStateEnum.Error;
            }

            fundEntity.Retcode   = model.Retcode;
            fundEntity.FundState = fundState;
            fundBll.Create(fundEntity);
            #endregion

            //页面跳转
            string toPageUrl = htComm["ToPageURL"] + "&type=1&retStatus=" + fundState + "&retMsg=" + retMsg + "&Retcode=" + model.Retcode;
            RedirectUrl(toPageUrl);
        }