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);
        }
示例#3
0
        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);
        }