Beispiel #1
0
        private void PostData(IInputData input)
        {
            DataSet postDataSet                   = input.PostObject.Convert <DataSet>();
            FieldErrorInfoCollection errors       = new FieldErrorInfoCollection();
            MetaDataTableResolver    metaResolver = MainResolver as MetaDataTableResolver;

            if (metaResolver != null)
            {
                metaResolver.CheckFirstConstraints(input, errors);
            }
            switch (input.Style.Style)
            {
            case PageStyle.Insert:
                MainResolver.Insert(postDataSet, input);
                break;

            case PageStyle.Update:
                MainResolver.Update(postDataSet, input);
                break;
            }
            if (metaResolver != null)
            {
                metaResolver.CheckLaterConstraints(input, errors);
            }

            errors.CheckError();
        }
Beispiel #2
0
        private void PostData(IInputData input)
        {
            DataSet postDataSet             = input.PostObject.Convert <DataSet>();
            FieldErrorInfoCollection errors = new FieldErrorInfoCollection();
            var childResolvers = ChildResolvers.ToArray();
            MetaDataTableResolver metaResolver = MainResolver as MetaDataTableResolver;

            if (metaResolver != null)
            {
                metaResolver.CheckFirstConstraints(input, errors);
            }
            foreach (var item in childResolvers)
            {
                MetaDataTableResolver childResolver = item as MetaDataTableResolver;
                if (childResolver != null)
                {
                    childResolver.CheckFirstConstraints(input, errors);
                }
            }
            switch (input.Style.Style)
            {
            case PageStyle.Insert:
                MainResolver.Insert(postDataSet, input);
                foreach (var item in childResolvers)
                {
                    item.Insert(postDataSet, input);
                }
                break;

            case PageStyle.Update:
                MainResolver.Update(postDataSet, input);
                foreach (var item in childResolvers)
                {
                    item.Update(postDataSet, input);
                }
                break;
            }
            if (metaResolver != null)
            {
                metaResolver.CheckLaterConstraints(input, errors);
            }
            foreach (var item in childResolvers)
            {
                MetaDataTableResolver childResolver = item as MetaDataTableResolver;
                if (childResolver != null)
                {
                    childResolver.CheckLaterConstraints(input, errors);
                }
            }
            errors.CheckError();
        }
Beispiel #3
0
        public override OutputData DoAction(IInputData input)
        {
            if (input.IsPost)
            {
                FillData(input);
                Prepare();
                DataSet postDataSet = input.PostObject.Convert <DataSet>();
                MainResolver.Update(postDataSet, input);
                Commit(input);

                return(OutputData.CreateToolkitObject(new KeyData("Id", string.Empty)));
            }
            else
            {
                throw new NotSupportedException();
            }
        }