Exemplo n.º 1
0
 internal void OnComplete(SimpleDynamicDataSourceCompleteEventArgs eventArgs)
 {
     if (Complete != null)
     {
         Complete(this, eventArgs);
     }
 }
        void LinqDataSource1_Complete(object sender, SimpleDynamicDataSourceCompleteEventArgs e) {
            var newObject = e.NewObject;

            //var someInt = DataBinder.GetPropertyValue(newObject, "SomeInt");

            DetailsView2.DataSource = new object[] { newObject };
            DetailsView2.DataBind();
        }
        protected override int ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) {

            object newObject;

            try {
                newObject = DataSourceUtilities.BuildDataObject(_owner.DataObject, _owner.CustomTypeDescriptor, values);
            }
            catch (LinqDataSourceValidationException e) {
                // allow user to handle conversion or dlinq property validation exceptions.
                _owner.OnException(new DynamicValidatorEventArgs(e, DynamicDataSourceOperation.Update));
                throw;
            }

            var eventArgs = new SimpleDynamicDataSourceCompleteEventArgs() { NewObject = newObject };

            _owner.OnComplete(eventArgs);

            return 1;
        }
Exemplo n.º 4
0
        protected override int ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues)
        {
            object newObject;

            try {
                newObject = DataSourceUtilities.BuildDataObject(_owner.DataObject, _owner.CustomTypeDescriptor, values);
            }
            catch (LinqDataSourceValidationException e) {
                // allow user to handle conversion or dlinq property validation exceptions.
                _owner.OnException(new DynamicValidatorEventArgs(e, DynamicDataSourceOperation.Update));
                throw;
            }

            var eventArgs = new SimpleDynamicDataSourceCompleteEventArgs()
            {
                NewObject = newObject
            };

            _owner.OnComplete(eventArgs);

            return(1);
        }
        void LinqDataSource1_Complete(object sender, SimpleDynamicDataSourceCompleteEventArgs e) {
            var newObject = (MyTestClass)e.NewObject;

            DetailsView2.DataSource = new object[] { newObject };
            DetailsView2.DataBind();
        }
 internal void OnComplete(SimpleDynamicDataSourceCompleteEventArgs eventArgs) {
     if (Complete != null) {
         Complete(this, eventArgs);
     }
 }