예제 #1
0
        public DbDetailStatListSource(IBaseDbConfig config, IConfigCreator <TableResolver> mainResolver,
                                      ChildTableInfoConfig childInfoConfig)
            : base(childInfoConfig.Stat)
        {
            TkDebug.AssertArgumentNull(config, "config", null);
            TkDebug.AssertArgumentNull(mainResolver, "mainResolver", null);
            TkDebug.AssertArgumentNull(childInfoConfig, "childInfoConfig", null);

            SetConfig(config);
            fChildInfo = new ChildTableInfo(this, childInfoConfig);
            // 子列表不该占有主配置的数据权限
            //if (config.DataRight != null)
            //{
            //    SupportData = config.SupportData;
            //    DataRight = config.DataRight.CreateObject(fChildInfo.Resolver);
            //}
            // 子列表不该占有功能权限
            FunctionType = FunctionRightType.None;

            OrderBy         = fChildInfo.Relation.OrderBy;
            FilterSql       = fChildInfo.Relation.FilterSql;
            MainResolver    = fChildInfo.Resolver;
            fMasterResolver = mainResolver.CreateObject(this);
            if (childInfoConfig.Operators != null)
            {
                Operators = childInfoConfig.Operators.CreateObject();
            }
        }
예제 #2
0
        public MultipleDbInsertSource(IBaseDbConfig config)
            : this()
        {
            TkDebug.AssertArgumentNull(config, "config", null);

            SetConfig(config);
            IMultipleResolverConfig multiple = config as IMultipleResolverConfig;

            if (multiple != null)
            {
                SetMainResolver(multiple.MainResolver.CreateObject(this));
                if (multiple.ChildResolvers != null)
                {
                    foreach (var item in multiple.ChildResolvers)
                    {
                        AddDetailTableResolver(item.Resolver.CreateObject(this), item.IsNewEmptyRow);
                    }
                }
            }
            if (config.DataRight != null)
            {
                SupportData = config.SupportData;
                DataRight   = config.DataRight.CreateObject(MainResolver);
            }
            IEditDbConfig totalConfig = config as IEditDbConfig;

            if (totalConfig != null)
            {
                UseMetaData = totalConfig.UseMetaData;
            }
        }
예제 #3
0
        protected void SetConfig(IBaseDbConfig config)
        {
            TkDebug.AssertArgumentNull(config, "config", this);

            if (!string.IsNullOrEmpty(config.Context))
            {
                Context = DbContextUtil.CreateDbContext(config.Context);
            }
        }
예제 #4
0
        protected BaseMultipleDbSource(IBaseDbConfig config)
            : base(config)
        {
            IMultipleResolverConfig multiple = config.Convert <IMultipleResolverConfig>();

            if (multiple.ChildResolvers != null)
            {
                foreach (var item in multiple.ChildResolvers)
                {
                    ChildTableInfo info = new ChildTableInfo(this, item);
                    AddChildTable(info);
                }
            }
        }
예제 #5
0
        protected BaseSingleDbSource(IBaseDbConfig config)
        {
            TkDebug.AssertArgumentNull(config, "config", null);

            SetConfig(config);
            MainResolver = DbConfigUtil.CreateSingleTableResolver(config, this);
            if (config.DataRight != null)
            {
                SupportData = config.SupportData;
                DataRight   = config.DataRight.CreateObject(MainResolver);
            }
            if (config.FunctionRight != null)
            {
                FunctionKey  = config.FunctionRight.FunctionKey;
                FunctionType = config.FunctionRight.FunctionType;
            }
        }
예제 #6
0
 internal SingleDbDelInsSource(IBaseDbConfig config)
     : base(config)
 {
 }