Beispiel #1
0
        protected override ReNameFormRD ProcessRequest(DTO.Base.APIRequest <ReNameFormRP> pRequest)
        {
            if (string.IsNullOrEmpty(pRequest.Parameters.Name))
            {
                return(new ReNameFormRD
                {
                    IsSuccess = false, Msg = "无效的名称"
                });
            }
            var result = new ReNameFormRD {
                IsSuccess = true
            };
            var bll = new MobileModuleBLL(CurrentUserInfo);

            if (string.IsNullOrEmpty(pRequest.Parameters.MobileModuleID))
            {
                var entity = new MobileModuleEntity();
                entity.ModuleName = pRequest.Parameters.Name;
                //entity.MobileModuleID = Guid.NewGuid();
                entity.CustomerID = CurrentUserInfo.ClientID;
                entity.IsTemplate = pRequest.Parameters.Type == 1 ? 1 : 0; //注册活动表单 默认为模板
                entity.ModuleType = pRequest.Parameters.Type;
                //bll.Create(entity);
                bll.CreateWithMobilePageBlock(entity);
            }
            else
            {
                var entity = bll.GetByID(pRequest.Parameters.MobileModuleID);
                entity.ModuleName = pRequest.Parameters.Name;
                bll.Update(entity);
                result.MobileModuleID = entity.MobileModuleID.ToString();
            }

            return(result);
        }
Beispiel #2
0
        protected override ReNameFormRD ProcessRequest(DTO.Base.APIRequest<ReNameFormRP> pRequest)
        {
            if ( string.IsNullOrEmpty(pRequest.Parameters.Name) )
            {
                return  new ReNameFormRD
                {
                    IsSuccess = false, Msg = "无效的名称"
                };
            }

            var bll = new MobileModuleBLL(CurrentUserInfo);
            if (string.IsNullOrEmpty(pRequest.Parameters.MobileModuleID))
            {
                var entity = new MobileModuleEntity();
                entity.ModuleName =  pRequest.Parameters.Name;
                entity.MobileModuleID = Guid.NewGuid();
                entity.CustomerID = CurrentUserInfo.ClientID;
                entity.IsTemplate = 0;
                entity.ModuleType = pRequest.Parameters.Type;
                bll.Create(entity);
            }
            else
            {
                var entity = bll.GetByID(pRequest.Parameters.MobileModuleID);
                entity.ModuleName = pRequest.Parameters.Name;
                bll.Update(entity);
            }
            
            return  new ReNameFormRD{ IsSuccess = true};
            
        }