/// <summary> /// Конструктор. /// </summary> /// <param name="model">Модель.</param> public DataSetsModel(DataSetsModel model) { if (model.DetailDataSet1 != null) { this.DetailDataSet1 = new DataSetModel(model.DetailDataSet1); } if (model.DetailDataSet2 != null) { this.DetailDataSet2 = new DataSetModel(model.DetailDataSet2); } if (model.DetailDataSet3 != null) { this.DetailDataSet3 = new DataSetModel(model.DetailDataSet3); } if (model.DetailDataSet4 != null) { this.DetailDataSet4 = new DataSetModel(model.DetailDataSet4); } if (model.DetailDataSet5 != null) { this.DetailDataSet5 = new DataSetModel(model.DetailDataSet5); } if (model.DetailDataSet6 != null) { this.DetailDataSet6 = new DataSetModel(model.DetailDataSet6); } if (model.DetailDataSet7 != null) { this.DetailDataSet7 = new DataSetModel(model.DetailDataSet7); } if (model.DetailDataSet8 != null) { this.DetailDataSet8 = new DataSetModel(model.DetailDataSet8); } }
/// <summary> /// Добавить или установить набор данных. /// </summary> /// <param name="datasetIndex">Индекс набора данных.</param> /// <param name="dataset">Набор данных.</param> private void AddOrSetDataSet(int datasetIndex, DataSetModel dataset) { if (datasets.ContainsKey(datasetIndex)) { datasets[datasetIndex] = dataset; } else { datasets.Add(datasetIndex, dataset); } }
/// <summary> /// Конструктор. /// </summary> /// <param name="model">Модель.</param> public DataSetModel(DataSetModel model) { if (model.Rows != null) { this.Rows = new List <RowModel>(); foreach (var row in model.Rows) { this.Rows.Add(new RowModel(row)); } } }