/// <summary> /// 市场活动购买 /// </summary> /// <param name="openID">用户微信ID</param> /// <param name="eventID">活动ID</param> /// <param name="productName">商品名称</param> /// <param name="purchaseAmount">购买金额</param> public void MarketEventPurchase(string openID, string eventID, string productName, string purchaseAmount) { //根据用户微信ID,获取VIPID IWhereCondition[] whereCondition = new IWhereCondition[] { new EqualsCondition() { FieldName = "WeiXinUserId", Value = openID } }; var vips = new VipBLL(this.CurrentUserInfo).Query(whereCondition, null); string vipID = string.Empty; if (vips.Length > 0) { vipID = vips.FirstOrDefault().VIPID; } //添加商品购买信息 MarketEventResponseEntity entity = new MarketEventResponseEntity() { ReponseID = this.NewGuid(), OpenID = openID, MarketEventID = eventID, VIPID = vipID, ProductName = productName, PurchaseAmount = ToDecimal(purchaseAmount), IsSales = 1 }; this.Create(entity); }
/// <summary> /// 市场活动响应 /// </summary> /// <param name="openID">用户微信ID</param> /// <param name="eventID">活动ID</param> public void MarketEventResponse(string openID, string eventID) { IWhereCondition[] whereCondition = new IWhereCondition[] { new EqualsCondition() { FieldName = "OpenID", Value = openID }, new EqualsCondition() { FieldName = "MarketEventID", Value = eventID } }; var responses = this.Query(whereCondition, null); //用户没有响应活动,添加活动响应信息 if (responses.Length == 0) { //根据用户微信ID,获取VIPID whereCondition = new IWhereCondition[] { new EqualsCondition() { FieldName = "WeiXinUserId", Value = openID } }; var vips = new VipBLL(this.CurrentUserInfo).Query(whereCondition, null); string vipID = string.Empty; if (vips.Length > 0) { vipID = vips.FirstOrDefault().VIPID; } MarketEventResponseEntity entity = new MarketEventResponseEntity() { ReponseID = this.NewGuid(), OpenID = openID, MarketEventID = eventID, VIPID = vipID }; this.Create(entity); } else { //更新活动响应信息 MarketEventResponseEntity entity = new MarketEventResponseEntity() { ReponseID = responses.FirstOrDefault().ReponseID, }; this.Update(entity, false); } }
public MarketEventResponseEntity GetEventResponseInfo(string EventID, int Page, int PageSize) { MarketEventResponseEntity info = new MarketEventResponseEntity(); IList <MarketEventResponseEntity> infoList = new List <MarketEventResponseEntity>(); DataSet ds = new DataSet(); ds = _currentDAO.GetEventResponseInfo(EventID, Page, PageSize); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { infoList = DataTableToObject.ConvertToList <MarketEventResponseEntity>(ds.Tables[0]); info.MarketEventResponseInfoList = infoList; info.ICount = _currentDAO.GetEventResponseInfoCount(EventID); } return(info); }
public void Update(MarketEventResponseEntity pEntity, bool pIsUpdateNullField, IDbTransaction pTran) { _currentDAO.Update(pEntity, pIsUpdateNullField, pTran); }
/// <summary> /// 更新 /// </summary> /// <param name="pEntity">实体实例</param> /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param> public void Update(MarketEventResponseEntity pEntity, IDbTransaction pTran) { Update(pEntity, true, pTran); }
/// <summary> /// 在事务内创建一个新实例 /// </summary> /// <param name="pEntity">实体实例</param> /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param> public void Create(MarketEventResponseEntity pEntity, IDbTransaction pTran) { _currentDAO.Create(pEntity, pTran); }
/// <summary> /// 创建一个新实例 /// </summary> /// <param name="pEntity">实体实例</param> public void Create(MarketEventResponseEntity pEntity) { _currentDAO.Create(pEntity); }
/// <summary> /// 分页根据实体条件查询实体 /// </summary> /// <param name="pQueryEntity">以实体形式传入的参数</param> /// <param name="pOrderBys">排序组合</param> /// <returns>符合条件的实体集</returns> public PagedQueryResult <MarketEventResponseEntity> PagedQueryByEntity(MarketEventResponseEntity pQueryEntity, OrderBy[] pOrderBys, int pPageSize, int pCurrentPageIndex) { return(_currentDAO.PagedQueryByEntity(pQueryEntity, pOrderBys, pPageSize, pCurrentPageIndex)); }
/// <summary> /// 根据实体条件查询实体 /// </summary> /// <param name="pQueryEntity">以实体形式传入的参数</param> /// <param name="pOrderBys">排序组合</param> /// <returns>符合条件的实体集</returns> public MarketEventResponseEntity[] QueryByEntity(MarketEventResponseEntity pQueryEntity, OrderBy[] pOrderBys) { return(_currentDAO.QueryByEntity(pQueryEntity, pOrderBys)); }
/// <summary> /// 删除 /// </summary> /// <param name="pEntity"></param> public void Delete(MarketEventResponseEntity pEntity) { _currentDAO.Delete(pEntity); }
public void Update(MarketEventResponseEntity pEntity, bool pIsUpdateNullField) { _currentDAO.Update(pEntity, pIsUpdateNullField); }
/// <summary> /// 更新 /// </summary> /// <param name="pEntity">实体实例</param> public void Update(MarketEventResponseEntity pEntity) { Update(pEntity, true); }