protected override GetVipServicesLogDetailRD ProcessRequest(DTO.Base.APIRequest <SetVipServicesLogRP> pRequest) { var rd = new GetVipServicesLogDetailRD(); var para = pRequest.Parameters; var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo; var vipServicesLogBLL = new VipServicesLogBLL(loggingSessionInfo); VipServicesLogEntity servicesLog = vipServicesLogBLL.GetByID(para.ServicesLogID); if (servicesLog != null) { rd.ServicesLogID = servicesLog.ServicesLogID.ToString(); rd.VipID = servicesLog.VipID; rd.ServicesTime = servicesLog.ServicesTime == DateTime.MinValue?"":servicesLog.ServicesTime.Value.ToString("yyyy-MM-dd hh:mm"); rd.ServicesMode = servicesLog.ServicesMode; rd.UnitID = servicesLog.UnitID; rd.UnitName = servicesLog.UnitName; rd.UserID = servicesLog.UserID; rd.UserName = servicesLog.UserName; rd.Content = servicesLog.Content; rd.ServicesType = servicesLog.ServicesType.Value; rd.Duration = servicesLog.Duration; } return(rd); }
protected override EmptyResponseData ProcessRequest(DTO.Base.APIRequest <SetVipServicesLogRP> pRequest) { var rd = new EmptyResponseData(); var para = pRequest.Parameters; var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo; var vipServicesLogBLL = new VipServicesLogBLL(loggingSessionInfo); VipServicesLogEntity servicesLog = vipServicesLogBLL.GetByID(para.ServicesLogID); if (servicesLog != null) { vipServicesLogBLL.Delete(servicesLog); } return(rd); }
protected override EmptyResponseData ProcessRequest(DTO.Base.APIRequest <SetVipServicesLogRP> pRequest) { var rd = new EmptyResponseData(); var para = pRequest.Parameters; var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo; var vipServicesLogBLL = new VipServicesLogBLL(loggingSessionInfo); VipServicesLogEntity servicesLog = null; if (string.IsNullOrEmpty(para.ServicesLogID))//创建 { servicesLog = new VipServicesLogEntity(); if (!string.IsNullOrEmpty(para.ServicesTime)) { servicesLog.ServicesTime = DateTime.Parse(para.ServicesTime); } servicesLog.VipID = para.VipID; servicesLog.ServicesMode = para.ServicesMode; servicesLog.UnitID = loggingSessionInfo.CurrentUserRole.UnitId; servicesLog.UserID = loggingSessionInfo.UserID; //servicesLog.UserID = para.UserID; servicesLog.ServicesType = para.ServicesType; servicesLog.Duration = para.Duration; servicesLog.Content = para.Content; servicesLog.CustomerID = loggingSessionInfo.ClientID; vipServicesLogBLL.Create(servicesLog); } else//编辑 { servicesLog = vipServicesLogBLL.GetByID(new Guid(para.ServicesLogID)); if (servicesLog != null) { if (!string.IsNullOrEmpty(para.ServicesTime)) { servicesLog.ServicesTime = DateTime.Parse(para.ServicesTime); } if (!string.IsNullOrEmpty(para.VipID)) { servicesLog.VipID = para.VipID; } if (!string.IsNullOrEmpty(para.ServicesMode)) { servicesLog.ServicesMode = para.ServicesMode; } //if (!string.IsNullOrEmpty(para.UnitID)) // servicesLog.UnitID = para.UnitID; //servicesLog.UserID = loggingSessionInfo.UserID; //servicesLog.UserID = para.UserID; if (para.ServicesType > 0) { servicesLog.ServicesType = para.ServicesType; } if (!string.IsNullOrEmpty(para.Duration)) { servicesLog.Duration = para.Duration; } if (!string.IsNullOrEmpty(para.Content)) { servicesLog.Content = para.Content; } vipServicesLogBLL.Update(servicesLog); } } return(rd); }
/// <summary> /// 更新 /// </summary> /// <param name="pEntity">实体实例</param> /// <param name="pTran">事务实例,可为null,如果为null,则不使用事务来更新</param> public void Update(VipServicesLogEntity pEntity, IDbTransaction pTran) { _currentDAO.Update(pEntity, pTran); }
/// <summary> /// 创建一个新实例 /// </summary> /// <param name="pEntity">实体实例</param> public void Create(VipServicesLogEntity pEntity) { _currentDAO.Create(pEntity); }
/// <summary> /// 分页根据实体条件查询实体 /// </summary> /// <param name="pQueryEntity">以实体形式传入的参数</param> /// <param name="pOrderBys">排序组合</param> /// <returns>符合条件的实体集</returns> public PagedQueryResult <VipServicesLogEntity> PagedQueryByEntity(VipServicesLogEntity 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 VipServicesLogEntity[] QueryByEntity(VipServicesLogEntity pQueryEntity, OrderBy[] pOrderBys) { return(_currentDAO.QueryByEntity(pQueryEntity, pOrderBys)); }
/// <summary> /// 删除 /// </summary> /// <param name="pEntity"></param> public void Delete(VipServicesLogEntity pEntity) { _currentDAO.Delete(pEntity); }
/// <summary> /// 更新 /// </summary> /// <param name="pEntity">实体实例</param> public void Update(VipServicesLogEntity pEntity) { _currentDAO.Update(pEntity); }