public DatabaseObjectsUsingAttributesHelper(DatabaseObjects objDatabaseObjects) { if (objDatabaseObjects == null) throw new ArgumentNullException(); pobjDatabaseObjects = objDatabaseObjects; object[] objAttributes = objDatabaseObjects.GetType().GetCustomAttributes(true); if (objAttributes != null) { foreach (Attribute objAttribute in objAttributes) { if (objAttribute is DistinctFieldAttribute) pobjDistinctField = (DistinctFieldAttribute) objAttribute; else if (objAttribute is KeyFieldAttribute) pobjKeyField = (KeyFieldAttribute) objAttribute; else if (objAttribute is OrderByFieldAttribute) pobjOrderByAttributes.Add((OrderByFieldAttribute) objAttribute); else if (objAttribute is SubsetAttribute) pobjSubset = (SubsetAttribute) objAttribute; else if (objAttribute is TableAttribute) pobjTable = (TableAttribute) objAttribute; else if (objAttribute is TableJoinAttribute) pobjTableJoins.Add((TableJoinAttribute) objAttribute); else if (objAttribute is ItemInstanceAttribute) pobjItemInstance = (ItemInstanceAttribute) objAttribute; } } }
protected void Page_Load(object sender, EventArgs e) { _intId = Convert.ToInt32(Request.QueryString["id"]); _strSite = string.Empty; try { //_intId = 146; //here is the hard code value and it will be replace by querystring if (!Page.IsPostBack) { //It calls the Single Ton Connection _clsData = new DatabaseObjects(); //fills the data in the dropdown FillData(_clsData, drpStatus, _spGetImportStatus); FillData(_clsData, drpServerType, _spGetImportServerType); FillData(_clsData, drpEnv, _spGetImportEnv); //fill the existing data in the page _dsAgRecords = ExistingRecords(_dsAgRecords); txtComment.Text = _strComment; calander.Value = _strDate; } } catch (Exception exp) { _strError = "Error : " + exp.Message; } //Response.End(); }
public static void ConstructTableObjectFromPostRequest(JSONTable jt, ref BaseTable bt, ref int pageIndex, ref int pageSize, ref int totalRows, ref SqlFilter whereFilter, ref BaseFilter join, ref OrderBy orderBy) { pageIndex = jt.PageIndex; pageSize = jt.PageSize; totalRows = jt.TotalRows; bt = (BaseTable)DatabaseObjects.GetTableObject(jt.TableName); ColumnList selCols = new ColumnList(); foreach (JTableSelectColumn col in jt.JSelectColumns) { selCols.Add(bt.TableDefinition.ColumnList.GetByCodeName(col.ColumnName), true); } bt.SelectedColumns.Clear(); bt.SelectedColumns.AddRange(selCols); if ((jt.JOrderByList != null)) { foreach (JOrderBy jOrderBy in jt.JOrderByList) { orderBy = new OrderBy(true, false); orderBy.Add(bt.TableDefinition.ColumnList.GetByCodeName(jOrderBy.ColumnName), OrderByItem.ToOrderDir(jOrderBy.OrderDirection)); } } if (jt.JWhereClause != null && jt.JWhereClause.Trim() != "") { whereFilter = new SqlFilter(jt.JWhereClause); } }
private void ExecuteFilter() { lock (gawd) { IEnumerable <DBObjectViewModel> filteredList; if (string.IsNullOrWhiteSpace(ResultsFilter)) { // if there's no filter, just use the plain ol' list filteredList = actualList; } else { var pred = DBObjectSearch.BuildPredicateFromSearchText(ResultsFilter); filteredList = from item in actualList where pred.Invoke(item) select item; } foreach (var found in filteredList) { DatabaseObjects.Add(found); } Execute.OnUIThread(() => { DatabaseObjects.Clear(); DatabaseObjects.AddRange(filteredList); }); } }
/// <summary> /// </summary> /// <param name="itemInstanceTypeToCreate">The type of DatabaseObjects.DatabaseObject to create.</param> /// <param name="databaseObjects">Parameter that is passed to the constructor of the DatabaseObject to create. If there is a default constructor then this argument is not used.</param> public static IDatabaseObject CreateItemInstance(Type itemInstanceTypeToCreate, DatabaseObjects databaseObjects) { object objObjectInstance = null; foreach (ConstructorInfo objConstructor in itemInstanceTypeToCreate.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) { ParameterInfo[] objConstructorParameters = objConstructor.GetParameters(); if (objConstructorParameters.Length == 0) { objObjectInstance = objConstructor.Invoke(null); break; } else if (objConstructorParameters.Length == 1 && (objConstructorParameters[0].ParameterType.IsSubclassOf(typeof(DatabaseObjects)) || objConstructorParameters[0].ParameterType.Equals(typeof(DatabaseObjects)))) { objObjectInstance = objConstructor.Invoke(new[] {databaseObjects}); break; } } if (objObjectInstance == null) throw new Exceptions.DatabaseObjectsException("An empty constructor or constructor with argument DatabaseObjects.DatabaseObjects (or subclass) could not be found for type '" + itemInstanceTypeToCreate.FullName + "'. This type has been specified by the ItemInstanceAttribute for the type '" + databaseObjects.GetType().FullName + "' or as the T argument."); else if (!(objObjectInstance is IDatabaseObject)) throw new Exceptions.DatabaseObjectsException("'" + itemInstanceTypeToCreate.FullName + "' does not implement IDatabaseObject or inherit from DatabaseObject. Type was specified for use by the ItemInstanceAttribute on the type '" + databaseObjects.GetType().FullName + "'"); else return (IDatabaseObject)objObjectInstance; }
public static void ConstructRecordObjectFromPostSaveRequest(JSONRecord jr, ref PrimaryKeyRecord rec) { PrimaryKeyTable t = (PrimaryKeyTable)DatabaseObjects.GetTableObject(jr.TableName); t.ResetSelectedColumns(); rec = new PrimaryKeyRecord(t); rec.IsExistsInDatabase = jr.IsExistsInDatabase; if ((jr.JRecordValues != null)) { foreach (JRecordValue jRecordValue in jr.JRecordValues) { BaseColumn bc = t.TableDefinition.ColumnList.GetByCodeName(jRecordValue.ColumnName); if (!bc.IsValuesReadOnly) { rec.Parse(jRecordValue.ColumnValue, bc); } else if (t.TableDefinition.IsPrimaryKeyElement(bc)) { KeyValue kv = new KeyValue(); kv.AddElement(jRecordValue.ColumnName, jRecordValue.ColumnValue.ToString()); rec.PrimaryKeyValue = kv; } } } }
/// -------------------------------------------------------------------------------- /// <summary> /// Initializes a new DatabaseObject with the parent collection that this object is /// associated with and the lock controller to be used with this object. /// </summary> /// -------------------------------------------------------------------------------- protected DatabaseObjectLockable(DatabaseObjects objParent, DatabaseObjectLockController objLockController) : base(objParent) { if (objLockController == null) throw new ArgumentNullException(); pobjLockController = objLockController; }
/// <summary> /// This method takes a keyValue and a Column and returns an evaluated value of DFKA formula. /// </summary> public static string GetDFKA(String keyValue, BaseColumn col, String formatPattern) { if (keyValue == null) { return(null); } ForeignKey fkColumn = AreasTable.Instance.TableDefinition.GetExpandableNonCompositeForeignKey(col); if (fkColumn == null) { return(null); } String _DFKA = fkColumn.PrimaryKeyDisplayColumns; if (_DFKA.Trim().StartsWith("=")) { String tableName = fkColumn.PrimaryKeyTableDefinition.TableCodeName; PrimaryKeyTable t = (PrimaryKeyTable)DatabaseObjects.GetTableObject(tableName); BaseRecord rec = null; if (t != null) { try { rec = (BaseRecord)t.GetRecordData(keyValue, false); } catch { rec = null; } } if (rec == null) { return(""); } // if the formula is in the format of "= <Primary table>.<Field name>, then pull out the data from the rec object instead of doing formula evaluation string tableCodeName = fkColumn.PrimaryKeyTableDefinition.TableCodeName; string column = _DFKA.Trim('=').Trim(); if (column.StartsWith(tableCodeName + ".", StringComparison.InvariantCultureIgnoreCase)) { column = column.Substring(tableCodeName.Length + 1); } foreach (BaseColumn c in fkColumn.PrimaryKeyTableDefinition.Columns) { if (column == c.CodeName) { return(rec.Format(c)); } } return(EvaluateFormula(_DFKA, rec, null, tableName)); } else { return(null); } }
public ViewColumnInfoExtractUICollection(ColumnInfo c, ViewType viewType, IFilter filter = null) : this() { DatabaseObjects.Add(c); if (filter != null) { DatabaseObjects.Add(filter); } ViewType = viewType; }
public ViewColumnExtractCollection(ExtractionInformation ei, ViewType viewType, IContainer container) : this() { DatabaseObjects.Add(ei); if (container != null) { DatabaseObjects.Add(container); } ViewType = viewType; }
public ViewColumnExtractCollection(ExtractionInformation ei, ViewType viewType, IFilter filter = null) : this() { DatabaseObjects.Add(ei); if (filter != null) { DatabaseObjects.Add(filter); } ViewType = viewType; }
public override void GetDatabaseObjects() { DatabaseObjectsFactory <Destination> factory = new DatabaseObjectsFactory <Destination>(); string collectionName = CollectionsNames.DestinationsCollection; DatabaseObjects <Destination> objects = factory.GetDatabaseObjects(collectionName); collection = objects.Collection; database = objects.Database; }
public override void GetDatabaseObjects() { DatabaseObjectsFactory <Arrangement> factory = new DatabaseObjectsFactory <Arrangement>(); string collectionName = CollectionsNames.ArrangementsCollection; DatabaseObjects <Arrangement> objects = factory.GetDatabaseObjects(collectionName); collection = objects.Collection; database = objects.Database; }
public override void GetDatabaseObjects() { DatabaseObjectsFactory <Hotel> factory = new DatabaseObjectsFactory <Hotel>(); string collectionName = CollectionsNames.HotelsCollection; DatabaseObjects <Hotel> objects = factory.GetDatabaseObjects(collectionName); collection = objects.Collection; database = objects.Database; }
public FilterGraphObjectCollection(AggregateConfiguration graph, ConcreteFilter filter) : this() { if (graph.IsCohortIdentificationAggregate) { throw new ArgumentException("Graph '" + graph + "' is a Cohort Identification Aggregate, this is not allowed. Aggregat must be a graph aggregate"); } DatabaseObjects.Add(graph); DatabaseObjects.Add(filter); }
public override void GetDatabaseObjects() { DatabaseObjectsFactory <Customer> factory = new DatabaseObjectsFactory <Customer>(); string collectionName = CollectionsNames.CustomersCollection; DatabaseObjects <Customer> objects = factory.GetDatabaseObjects(collectionName); collection = objects.Collection; database = objects.Database; }
public void RemoveCatalogue(Catalogue catalogue) { if (catalogue == null) { throw new ArgumentException("Catalogue must not be null", "catalogue"); } DatabaseObjects.Remove(catalogue); }
public void SetSingleCatalogueMode(Catalogue catalogue) { if (catalogue == null) { throw new ArgumentException("Catalogue must not be null to turn on SingleCatalogue mode", "catalogue"); } DatabaseObjects.Clear(); DatabaseObjects.Add(catalogue); }
public ViewTableInfoExtractUICollection(ITableInfo t, ViewType viewType, IFilter filter = null) : this() { DatabaseObjects.Add(t); if (filter != null) { DatabaseObjects.Add(filter); } ViewType = viewType; }
public BaseClasses.Data.BaseTable GetTable() { try { return(DatabaseObjects.GetTableObject(this.TableName)); } catch (System.Exception) { return(DatabaseObjects.GetTableObject(this.TableName)); } }
/// <summary> /// Overload that does the operation on a container with (WhereExtractionIdentifiersIn - the only permissable option) /// </summary> /// <param name="container"></param> /// <param name="graph"></param> public CohortSummaryAggregateGraphObjectCollection(CohortAggregateContainer container, AggregateConfiguration graph) : this() { if (graph.IsCohortIdentificationAggregate) { throw new ArgumentException("Parameter graph was AggregateConfiguration '" + graph + "' which is a Cohort Aggregate (not allowed)", "graph"); } DatabaseObjects.Add(container); DatabaseObjects.Add(graph); Adjustment = CohortSummaryAdjustment.WhereExtractionIdentifiersIn; }
public static void ConstructRecordObjectFromPostDeleteRequest(JSONRecord jr, ref PrimaryKeyTable pk, ref List <KeyValue> kvList) { pk = (PrimaryKeyTable)DatabaseObjects.GetTableObject(jr.TableName); if ((jr.JRecordValues != null)) { foreach (JRecordValue jRecordValue in jr.JRecordValues) { KeyValue kv = new KeyValue(); kv.AddElement(jRecordValue.ColumnName, jRecordValue.ColumnValue.ToString()); kvList.Add(kv); } } }
/// <summary> /// Use this constructor at runtime /// </summary> /// <param name="cohort"></param> /// <param name="graph"></param> /// <param name="adjustment"></param> public CohortSummaryAggregateGraphObjectCollection(AggregateConfiguration cohort, AggregateConfiguration graph, CohortSummaryAdjustment adjustment) : this() { if (!cohort.IsCohortIdentificationAggregate) { throw new ArgumentException("Parameter cohort was AggregateConfiguration '" + cohort + "' which is not a Cohort Aggregate (not allowed)", "cohort"); } if (graph.IsCohortIdentificationAggregate) { throw new ArgumentException("Parameter graph was AggregateConfiguration '" + graph + "' which is a Cohort Aggregate (not allowed)", "graph"); } DatabaseObjects.Add(cohort); DatabaseObjects.Add(graph); Adjustment = adjustment; }
public static SelectItem ConstructSelectItemFromPostRequest(JDataSourceSelectItem jsonSItem) { SelectItem sItem = null; if (!string.IsNullOrEmpty(jsonSItem.ColumnName) && !string.IsNullOrEmpty(jsonSItem.TableName)) { BaseTable table = DatabaseObjects.GetTableObject(jsonSItem.TableName); sItem = new SelectItem(table.TableDefinition.ColumnList.GetByCodeName(jsonSItem.ColumnName), table, jsonSItem.Distinct, jsonSItem.AsClause, jsonSItem.TableAlias); } else if (!string.IsNullOrEmpty(jsonSItem.ItemType) && !string.IsNullOrEmpty(jsonSItem.TableName)) { if (!string.IsNullOrEmpty(jsonSItem.AsClause)) { if (!string.IsNullOrEmpty(jsonSItem.TableAlias)) { sItem = new SelectItem(BaseClasses.Data.SelectItem.ItemTypeDefinition.GetItemType(jsonSItem.ItemType), DatabaseObjects.GetTableObject(jsonSItem.TableName), jsonSItem.AsClause, jsonSItem.TableAlias); } else { sItem = new SelectItem(BaseClasses.Data.SelectItem.ItemTypeDefinition.GetItemType(jsonSItem.ItemType), DatabaseObjects.GetTableObject(jsonSItem.TableName), jsonSItem.AsClause); } } else { sItem = new SelectItem(BaseClasses.Data.SelectItem.ItemTypeDefinition.GetItemType(jsonSItem.ItemType), DatabaseObjects.GetTableObject(jsonSItem.TableName)); } } else { if (!string.IsNullOrEmpty(jsonSItem.Operation)) { if ((jsonSItem.LeftItem != null) && (jsonSItem.RightItem == null)) { sItem = new SelectItem(jsonSItem.Operation, ConstructSelectItemFromPostRequest(jsonSItem.LeftItem), jsonSItem.AsClause); } else if ((jsonSItem.LeftItem != null) && (jsonSItem.RightItem != null)) { sItem = new SelectItem(jsonSItem.Operation, ConstructSelectItemFromPostRequest(jsonSItem.LeftItem), ConstructSelectItemFromPostRequest(jsonSItem.RightItem), jsonSItem.AsClause); } } } return(sItem); }
public void RevertIfMatchedInCollectionObjects(DatabaseEntity oTriggeringRefresh, out bool shouldClose) { shouldClose = false; var matchingObject = DatabaseObjects.SingleOrDefault(o => o.Equals(oTriggeringRefresh)) as IRevertable; //matched object in our collection if (matchingObject != null) { if (matchingObject.Exists()) { matchingObject.RevertToDatabaseState(); } else { shouldClose = true;//object doesn't exist anymore so close control } } }
protected void btnUpdate_Click(object sender, EventArgs e) { _clsData = new DatabaseObjects(); string[] _strData = new string[4] { drpStatus.SelectedItem.Value , drpServerType.SelectedItem.Value, txtComment.Text.Trim(), calander.Value }; //updating the data try { UpdatingData(_strData); _strError = "Record Updated Successfully"; _dsAgRecords = ExistingRecords(_dsAgRecords); } catch (Exception exp) { _strError = "Error : " + exp.Message; } GC.Collect(); }
public static void ConstructDataSourceObjectFromPostRequest(JSONDataSource jsonDS, ref SqlBuilderColumnSelection requestedCols, ref SqlBuilderColumnSelection workingSelCols, ref SqlBuilderColumnSelection distinctSelCols, ref OrderBy orderBy, ref KeylessVirtualTable table) { DataSource ds = new DataSource(); ds.Initialize(jsonDS.Name, DatabaseObjects.GetTableObject(jsonDS.Table), jsonDS.PageSize, jsonDS.PageIndex, jsonDS.GenerateTotal); if ((jsonDS.JSelectItems != null)) { foreach (JDataSourceSelectItem jsonSItem in jsonDS.JSelectItems) { ds.AddSelectItem(ConstructSelectItemFromPostRequest(jsonSItem)); } } requestedCols = new SqlBuilderColumnSelection(jsonDS.ExpandForeignKeyColumns, jsonDS.IsDistinct); workingSelCols = new SqlBuilderColumnSelection(jsonDS.ExpandForeignKeyColumns, jsonDS.IsDistinct); distinctSelCols = new SqlBuilderColumnSelection(jsonDS.ExpandForeignKeyColumns, jsonDS.IsDistinct); List <BaseColumn> columnsList = null; if (jsonDS.isTotalRecordArray) { columnsList = ds.CreateColumnSelectionsForTotal(ref requestedCols, ref workingSelCols, ref distinctSelCols); } else { columnsList = ds.CreateColumnSelections(ref requestedCols, ref workingSelCols, ref distinctSelCols); } table = ds.CreateVirtualTable(columnsList.ToArray()); if ((jsonDS.JOrderByList != null)) { foreach (JOrderBy jsonOrderBy in jsonDS.JOrderByList) { ds.AddAggregateOrderBy(jsonOrderBy.ColumnName, OrderByItem.ToOrderDir(jsonOrderBy.OrderDirection)); } } ds.UpdateOrderBy(columnsList); orderBy = ds.OrderBy; }
protected void ExportData() { if (string.IsNullOrEmpty(this.TableId)) { return; } try { PrimaryKeyTable t = (PrimaryKeyTable)DatabaseObjects.GetTableObject(this.TableId); BaseRecord rec = (BaseRecord)t.GetRecordData(this.RecordId, false); if ((this.ImagePercentSize != 100.0 && !(this.ImagePercentSize == 0.0)) || !((this.ImageHeight == 0) || (this.ImageWidth == 0))) { //To display image with shrinking according to user specified height/width or ImagePercentSize ColumnValue fieldData = MiscUtils.GetData(rec, t.TableDefinition.ColumnList.GetByAnyName(this.FieldId)); byte[] binaryData = MiscUtils.GetBinaryData(t.TableDefinition.ColumnList.GetByAnyName(this.FieldId), fieldData); if (binaryData == null || binaryData.Length == 0) { MiscUtils.RegisterJScriptAlert(this, "No Content", "Field " + this.FieldId + " does not contain any binary data.", false, true); return; } byte[] thumbNailSizeImage = GetThumbNailSizeImage(binaryData); string filName = MiscUtils.GetFileNameWithExtension(t.TableDefinition.ColumnList.GetByAnyName(this.FieldId), binaryData, null); MiscUtils.SendToWriteResponse(this.Response, thumbNailSizeImage, filName, t.TableDefinition.ColumnList.GetByAnyName(this.FieldId), fieldData, this.Offset); } else { //Calling ExportFieldData method without image shrinking. if (!MiscUtils.ExportFieldData(this.Response, rec, t.TableDefinition.ColumnList.GetByAnyName(this.FieldId), this.FileName, this.Offset)) { MiscUtils.RegisterJScriptAlert(this, "No Content", "Field " + this.FieldId + " does not contain any binary data.", false, true); return; } } } catch { } }
protected override bool Run(object parameters) { try { DatabaseConnection connection = (DatabaseConnection)parameters; DatabaseObjects dbObjects = DatabaseValidation.Validate(connection.MasterDatabase, connection.ChildDatabase, false, true); foreach (DatabaseObject dbObject in dbObjects) { if (ValidationError != null) { if (dbObject.ObjectParameter1 == "REPLICATE$HASH") { continue; } ValidationError(this, new SchemaValidationArgs(dbObject.ObjectType.ToString(), dbObject.ObjectName, dbObject.ObjectParameter1, dbObject.Status.ToString(), dbObject.SQL, dbObject.ExistsWithDifferentName)); } } } catch { return(false); } finally { if (ValidationComplete != null) { ValidationComplete(this, EventArgs.Empty); } } return(false); }
private void ExecuteRefreshCommand() { this.refreshIsRunning = true; LoadingDatabaseObjects = true; DatabaseObjects.Clear(); DatabaseObjects.Add(new SimpleNodeViewModel("Retrieving information...")); Task.Factory.StartNew <ObservableCollection <NodeViewModel> >(GetDatabaseObjectsAsync) .ContinueWith((previousTask) => { Application.Current.Dispatcher.Invoke(() => { DatabaseObjects.Clear(); foreach (NodeViewModel dbObject in previousTask.Result) { DatabaseObjects.Add(dbObject); } this.refreshIsRunning = false; LoadingDatabaseObjects = false; }); }); }
/// <summary> /// Initializes a new DatabaseObject with the parent collection that this object is /// associated with and the lock controller to be used with this object. /// </summary> protected DatabaseObjectUsingAttributesLockable(DatabaseObjects objParent, DatabaseObjectLockController objLockController) : base(objParent, objLockController) { }
/// -------------------------------------------------------------------------------- /// <summary> /// Initializes a new DatabaseObject with the parent collection that this object is /// associated with. /// </summary> /// -------------------------------------------------------------------------------- protected DatabaseObjectUsingAttributes(DatabaseObjects objParentCollection) : base(objParentCollection) { }
public IFilter GetFilterIfAny() { return((IFilter)DatabaseObjects.SingleOrDefault(o => o is IFilter)); }
/// -------------------------------------------------------------------------------- /// <summary> /// Initializes the class with the collection that the object is contained within. /// </summary> /// <param name="objCollection"> /// The collection that contains the referenced object. The collection's /// MyBase.Object function is called to load the object. /// </param> /// -------------------------------------------------------------------------------- public ObjectReference(DatabaseObjects objCollection) : this(objCollection.ParentDatabase, objCollection) { }
public object GetDataObject() { return(DatabaseObjects.Single(o => o is ColumnInfo || o is TableInfo)); }
public ViewCohortIdentificationConfigurationSqlCollection(CohortIdentificationConfiguration config) : this() { DatabaseObjects.Add(config); }
public ViewAggregateExtractUICollection(AggregateConfiguration config) : this() { DatabaseObjects.Add(config); }
public void Parse(BlockingCollection <string> input, BlockingCollection <DatabaseObjects> output) { try { List <Device> devices = new List <Device>(); List <Measurement> measurements = new List <Measurement>(); List <MType> mTypes = new List <MType>(); List <Point> points = new List <Point>(); // IEnumerator<string> enumerator = input.GetConsumingEnumerable().GetEnumerator(); DatabaseObjects databaseObjects = new DatabaseObjects(); foreach (string s in input.GetConsumingEnumerable()) { string line = s; string[] items = line.Split(';'); Device device = new Device(); MType mType = new MType(); Measurement measurement = new Measurement(); Point point = new Point(); device.serialNumber = items[9]; device.accuracy = float.Parse(items[10], CultureInfo.InvariantCulture); device.description = items[11]; if (!_existingDevices.ContainsKey(device.serialNumber)) { _existingDevices.Add(device.serialNumber, device.description); devices.Add(device); } mType.idType = int.Parse(items[12]); mType.name = items[13]; if (!_existingMTypes.ContainsKey(mType.idType)) { mTypes.Add(mType); _existingMTypes.Add(mType.idType, mType.name); } measurement.idMeasurement = _idMeasurement; measurement.serialNumberDevice = device.serialNumber; measurement.idMtype = mType.idType; measurement.description = ""; measurement.unit = items[1]; measurement.date = timestampToDateTime(items[0]); measurements.Add(measurement); point.id_point = int.Parse(items[2]); point.idMeasurement = measurement.idMeasurement; point.id_point = measurement.idMeasurement; point.x = Math.Round(float.Parse(items[3], CultureInfo.InvariantCulture), 2); point.y = Math.Round(float.Parse(items[4], CultureInfo.InvariantCulture), 2); point.value1 = float.Parse(items[6], CultureInfo.InvariantCulture); point.value2 = float.Parse(items[7], CultureInfo.InvariantCulture); point.variance = float.Parse(items[8], CultureInfo.InvariantCulture); point.description = items[5]; points.Add(point); if (_idMeasurement % _bufferSize == 0) { databaseObjects.Devices = new List <Device>(devices); databaseObjects.MTypes = new List <MType>(mTypes); databaseObjects.Measurements = new List <Measurement>(measurements); databaseObjects.Points = new List <Point>(points); devices = new List <Device>(); mTypes = new List <MType>(); measurements = new List <Measurement>(); points = new List <Point>(); output.Add(databaseObjects); databaseObjects = new DatabaseObjects(); } _idMeasurement++; } if (measurements.Count > 0) { databaseObjects.Devices = new List <Device>(devices); databaseObjects.MTypes = new List <MType>(mTypes); databaseObjects.Measurements = new List <Measurement>(measurements); databaseObjects.Points = new List <Point>(points); devices = new List <Device>(); mTypes = new List <MType>(); measurements = new List <Measurement>(); points = new List <Point>(); output.Add(databaseObjects); databaseObjects = new DatabaseObjects(); } } finally { output.CompleteAdding(); } }
private void FillData(DatabaseObjects _clsData, DropDownList drp, string _spName) { drp.DataSource = _clsData.GetAgilixImportData(_spName); drp.DataBind(); }