コード例 #1
0
 public AmplaDataSubmissionResultBinding(DataSubmissionResult[] dataSubmissionResults, List <TModel> models, IModelProperties <TModel> modelProperties)
 {
     this.dataSubmissionResults = dataSubmissionResults ?? new DataSubmissionResult[0];
     this.models          = models;
     this.modelProperties = modelProperties;
     idProperty           = ModelIdentifier.GetPropertyName <TModel>();
 }
コード例 #2
0
 public AmplaDeleteDataBinding(List <TModel> models, List <DeleteRecord> records, IModelProperties <TModel> modelProperties)
 {
     this.models          = models;
     this.records         = records;
     this.modelProperties = modelProperties;
     idProperty           = ModelIdentifier.GetPropertyName <TModel>();
 }
コード例 #3
0
 public ModelIdentifierBinding(TModel model, List <int> identifiers, IModelProperties <TModel> modelProperties)
 {
     this.model           = model;
     this.identifiers     = identifiers;
     this.modelProperties = modelProperties;
     idProperty           = ModelIdentifier.GetPropertyName <TModel>();
 }
コード例 #4
0
        public bool Bind()
        {
            if (response.RowSets.Length == 0)
            {
                return(false);
            }

            RowSet rowSet = response.RowSets[0];

            string idPropertyName = ModelIdentifier.GetPropertyName <TModel>();

            foreach (Row row in rowSet.Rows)
            {
                TModel model = new TModel();

                modelProperties.TrySetValueFromString(model, idPropertyName, row.id);

                foreach (XmlElement cell in row.Any)
                {
                    string field = XmlConvert.DecodeName(cell.Name);

                    modelProperties.TrySetValueFromString(model, field, cell.InnerText);
                }
                records.Add(model);
            }
            return(true);
        }
コード例 #5
0
 protected AmplaUpdateRecordStatusBinding(List <TModel> models, List <UpdateRecordStatus> records, IModelProperties <TModel> modelProperties, UpdateRecordStatusAction recordAction)
 {
     this.models          = models;
     this.records         = records;
     this.modelProperties = modelProperties;
     this.recordAction    = recordAction;
     idProperty           = ModelIdentifier.GetPropertyName <TModel>();
 }