/// <summary> /// 模型转换 /// </summary> public GetVipWithDrawRuleRD TransModel(VipWithDrawRuleEntity dbEntity) { GetVipWithDrawRuleRD result = new GetVipWithDrawRuleRD(); if (dbEntity == null) { return(result); } result.BeforeWithDrawDays = dbEntity.BeforeWithDrawDays; result.MinAmountCondition = dbEntity.MinAmountCondition; result.WithDrawMaxAmount = dbEntity.WithDrawMaxAmount; result.WithDrawNum = dbEntity.WithDrawNum; return(result); }
public bool SetVipWithDrawRule(SetVipWithDrawRuleRP rp) { List <VipWithDrawRuleEntity> dbList = _currentDAO.QueryByEntity(new VipWithDrawRuleEntity { CustomerID = CurrentUserInfo.ClientID }, null).ToList(); //U if (dbList.Count == 1) { var dbEntity = dbList.First(); dbEntity.BeforeWithDrawDays = rp.BeforeWithDrawDays; dbEntity.MinAmountCondition = rp.MinAmountCondition; dbEntity.WithDrawMaxAmount = rp.WithDrawMaxAmount; dbEntity.WithDrawNum = rp.WithDrawNum; dbEntity.WithDrawNumType = 3; dbEntity.LastUpdateBy = CurrentUserInfo.UserID; dbEntity.LastUpdateTime = DateTime.Now; _currentDAO.Update(dbEntity); return(true); } //A else if (dbList.Count == 0) { var dbEntity = new VipWithDrawRuleEntity(); dbEntity.BeforeWithDrawDays = rp.BeforeWithDrawDays; dbEntity.MinAmountCondition = rp.MinAmountCondition; dbEntity.WithDrawMaxAmount = rp.WithDrawMaxAmount; dbEntity.WithDrawNum = rp.WithDrawNum; dbEntity.WithDrawNumType = 3; dbEntity.CustomerID = CurrentUserInfo.ClientID; dbEntity.CreateTime = DateTime.Now; dbEntity.CreateBy = CurrentUserInfo.UserID; dbEntity.LastUpdateBy = CurrentUserInfo.UserID; dbEntity.LastUpdateTime = DateTime.Now; _currentDAO.Create(dbEntity); return(true); } else { //数据错误 throw new APIException(ERROR_CODES.INVALID_BUSINESS, "数据错误,请联系管理员!"); } }
/// <summary> /// 更新 /// </summary> /// <param name="pEntity">实体实例</param> /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param> public void Update(VipWithDrawRuleEntity pEntity, IDbTransaction pTran) { _currentDAO.Update(pEntity, pTran); }
/// <summary> /// 创建一个新实例 /// </summary> /// <param name="pEntity">实体实例</param> public void Create(VipWithDrawRuleEntity pEntity) { _currentDAO.Create(pEntity); }
/// <summary> /// 分页根据实体条件查询实体 /// </summary> /// <param name="pQueryEntity">以实体形式传入的参数</param> /// <param name="pOrderBys">排序组合</param> /// <returns>符合条件的实体集</returns> public PagedQueryResult <VipWithDrawRuleEntity> PagedQueryByEntity(VipWithDrawRuleEntity 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 VipWithDrawRuleEntity[] QueryByEntity(VipWithDrawRuleEntity pQueryEntity, OrderBy[] pOrderBys) { return(_currentDAO.QueryByEntity(pQueryEntity, pOrderBys)); }
/// <summary> /// 删除 /// </summary> /// <param name="pEntity"></param> public void Delete(VipWithDrawRuleEntity pEntity) { _currentDAO.Delete(pEntity); }
/// <summary> /// 更新 /// </summary> /// <param name="pEntity">实体实例</param> public void Update(VipWithDrawRuleEntity pEntity) { _currentDAO.Update(pEntity); }