コード例 #1
0
        public dynamic Save(object model)
        {
            IDynamicAmplaViewProperties amplaViewProperties = viewProperties;

            amplaViewProperties.Enforce.CanAdd();

            SubmitDataRequest request = new SubmitDataRequest {
                Credentials = CreateCredentials()
            };
            List <SubmitDataRecord> records = new List <SubmitDataRecord>();
            List <object>           models  = new List <object> {
                model.ToExpando()
            };

            IAmplaBinding binding = new AmplaAddDataDynamicBinding(models, records, amplaViewProperties, modelProperties);

            if (binding.Validate() && binding.Bind())
            {
                request.SubmitDataRecords = records.ToArray();
                SubmitDataResponse response = webServiceClient.SubmitData(request);

                IAmplaBinding resultBinding = new AmplaDataSubmissionResultDynamicBinding(response.DataSubmissionResults, models);
                if (resultBinding.Validate())
                {
                    resultBinding.Bind();
                }
            }
            return(models[0]);
        }
コード例 #2
0
 public SubmitDataResponse SubmitData(SubmitDataRequest request)
 {
     logger.Log("SubmitData ({0})", request);
     return(implementation.SubmitData(request));
 }