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);
        }
 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>();
 }