public override ISource CreateObject(params object[] args)
        {
            MultipleDbInsertSource source = new MultipleDbInsertSource(this)
            {
                UseMetaData = UseMetaData
            };

            if (Resolvers != null)
            {
                int i = 0;
                foreach (var item in Resolvers)
                {
                    TableResolver resolver = item.CreateObject(source);
                    if (i++ == 0)
                    {
                        source.SetMainResolver(resolver);
                    }
                    else
                    {
                        source.AddDetailTableResolver(resolver, IsDetailEmptyRow);
                    }
                }
            }

            return(source);
        }
示例#2
0
        protected override ISource CreateGetSource(PageStyle style, IInputData input)
        {
            switch (style)
            {
            case PageStyle.Insert:
                MultipleDbInsertSource source = new MultipleDbInsertSource(this);
                //source.AddTableResolver(MasterResolver.CreateObject(source));
                //source.AddTableResolver(Detail.Resolver.CreateObject(source));
                return(source);

            case PageStyle.Update:
                return(new MultipleDbDetailSource(this)
                {
                    FillDetailData = true
                });

            case PageStyle.Delete:
                return(new MultipleDbDeleteSource(this));

            case PageStyle.Detail:
                return(new MultipleDbDetailSource(this)
                {
                    FillDetailData = false
                });

            case PageStyle.List:
                return(new DbListSource(this));

            case PageStyle.Custom:
                if (input.Style.Operation == "DetailList")
                {
                    return(new DbDetailListSource(this, MasterResolver, Detail));
                }
                if (input.Style.Operation == DbListSource.TAB_STYLE_OPERATION)
                {
                    return(new DbListSource(this));
                }
                break;
            }
            return(null);
        }