Exemple #1
0
        public FunctionOpenResult <bool> AddComponentConfigForApp(int componentConfigId, int appConfigId)
        {
            var r    = new FunctionOpenResult <bool>();
            var data = Rel_AppConfig_ComponentConfigDal.Get(appConfigId, componentConfigId);

            if (data != null)
            {
                r.Data     = false;
                r.ErrorMsg = "此数据已存在";
                return(r);
            }
            var appConfig       = AppConfigDal.Get(appConfigId);
            var componentConfig = ComponentConfigDal.Get(componentConfigId);

            if (componentConfig == null)
            {
                r.Data     = false;
                r.ErrorMsg = "此组件配置不存在";
                return(r);
            }
            if ((appConfig != null) && (componentConfig != null))
            {
                r.Data = Rel_AppConfig_ComponentConfigDal.Add(new Rel_AppConfig_ComponentConfig()
                {
                    AppConfigId            = appConfig.AppConfigId,
                    AppConfigVersion       = appConfig.Version,
                    ComponentConfigId      = componentConfig.ComponentConfigId,
                    ComponentConfigVersion = componentConfig.Version,
                    SolutionID             = appConfig.SolutionID
                }) > 0;
            }
            return(r);
        }
        public FunctionResult <AppConfig> SendJsAppConfig(String solutionID, int version)
        {
            var r         = new FunctionResult <AppConfig>();
            var appConfig = AppConfigDal.Get(solutionID, version);

            if (appConfig != null)
            {
                r.Data = appConfig;
            }
            else
            {
                r.ErrorMsg = "无获取app的配置数据";
                r.Data     = null;
            }
            return(r);
        }
        public FunctionResult <AppConfig> SendConfig(String solutionID, int version)
        {
            var r         = new FunctionResult <AppConfig>();
            var appConfig = AppConfigDal.Get(solutionID, version);

            if (appConfig != null)
            {
                List <ComponentConfig> list = ComponentConfigDal.GetList(appConfig.AppConfigId, appConfig.Version);
                appConfig.Components = list;
                r.Data = appConfig;
            }
            else
            {
                r.ErrorMsg = "无获取app的配置数据";
                r.Data     = null;
            }
            return(r);
        }
Exemple #4
0
 public FunctionResult <AppConfig> Get(int Id)
 {
     var r = new FunctionResult <AppConfig>(); r.Data = AppConfigDal.Get(Id); return(r);
 }