public string GetSubObjectsDemand(string locationId = null) { locationId = (locationId != null && locationId != "") ? locationId : ""; string queryFunction = "getSubObjectsDemand ( \"" + locationId + "\")"; BsonJavaScript SubFunction = new BsonJavaScript(queryFunction); //Calling the stores Mongo Function MongoConection conection = (MongoConection)Conection.getConection(); BsonArray result = conection.getDataBase().Eval(SubFunction).AsBsonArray; List <BsonDocument> documents = new List <BsonDocument>(); foreach (BsonDocument document in result) { document.Set("_id", document.GetElement("_id").Value.ToString()); try { document.Set("CreatedTimeStamp", document.GetElement("CreatedTimeStamp").Value.ToString()); } catch (Exception ex) { } documents.Add(document); } return(documents.ToJson()); }
public getReports(string table) : base("Reports") { conection = (MongoConection)Conection.getConection(); collection = conection.getCollection(table); //collection.EnsureIndex(IndexKeys.Ascending("_id"), IndexOptions.SetUnique(true)); }
public DemandReport(string table) : base("Demand") { conection = (MongoConection)Conection.getConection(); conection1 = (MongoConection)Conection.getConection(); conection2 = (MongoConection)Conection.getConection(); collection = conection.getCollection(table); }
public string GetIdUnico() { string queryFunction = "getIDOne()"; BsonJavaScript SubFunction = new BsonJavaScript(queryFunction); //Calling the stores Mongo Function MongoConection conection = (MongoConection)Conection.getConection(); double result = conection.getDataBase().Eval(SubFunction).AsDouble; return(result.ToString()); }
public string GetAlldemandsFolio(string objid = null) { objid = (objid != null && objid != "") ? objid : ""; string queryFunction = "getAllDemandsOfObject ( \"" + objid + "\")"; BsonJavaScript SubFunction = new BsonJavaScript(queryFunction); //Calling the stores Mongo Function MongoConection conection = (MongoConection)Conection.getConection(); String result = conection.getDataBase().Eval(SubFunction).AsString; return(result); }
public String NewObjectEPC(String idObjRef, String IdClient) { String result = ""; if (idObjRef != null && IdClient != null) { string queryFunction = "NewObjectBaseEPC ( '" + IdClient + "', '" + idObjRef + "' )"; BsonJavaScript JoinFunction = new BsonJavaScript(queryFunction); //Calling the stores Mongo Function MongoConection conection = (MongoConection)Conection.getConection(); result = conection.getDataBase().Eval(JoinFunction).AsString; } return(result); }
public String getEPC(String idObjRef, String numEtiq) { String newepc = ""; if (idObjRef != null && numEtiq != null) { string queryFunction = "generateEPC ( '" + idObjRef + "', " + numEtiq + " )"; BsonJavaScript JoinFunction = new BsonJavaScript(queryFunction); //Calling the stores Mongo Function MongoConection conection = (MongoConection)Conection.getConection(); BsonDocument result = conection.getDataBase().Eval(JoinFunction).AsBsonDocument; newepc = result.ToJson(); } return(newepc); }
/// <summary> /// Returns all objects from a location and the locations whitin /// </summary> /// <param name="locationId"></param> /// <returns></returns> public string GetSubObjects(string locationId = null, bool filter = false) { locationId = (locationId != null && locationId != "") ? locationId : ""; string queryFunction = "getSubObjects ( \"" + locationId + "\")"; BsonJavaScript SubFunction = new BsonJavaScript(queryFunction); //Calling the stores Mongo Function MongoConection conection = (MongoConection)Conection.getConection(); BsonArray result = conection.getDataBase().Eval(SubFunction).AsBsonArray; List <BsonDocument> documents = new List <BsonDocument>(); foreach (BsonDocument document in result) { document.Set("_id", document.GetElement("_id").Value.ToString()); try { document.Set("CreatedTimeStamp", document.GetElement("CreatedTimeStamp").Value.ToString()); } catch (Exception ex) { } string type = "true"; if (filter) { try { type = document.GetElement("system_status").Value.ToString().ToLower(); } catch { } } if (filter && type == "false") { } else { documents.Add(document); } } return(documents.ToJson()); }
public int GetNumObjects(String idlocation) { int result = 0; BsonArray objs = new BsonArray(); if (idlocation == null || idlocation == "") { idlocation = "null"; } string queryFunction = "getSubObjects ('" + idlocation + "' )"; BsonJavaScript JoinFunction = new BsonJavaScript(queryFunction); //Calling the stores Mongo Function MongoConection conection = (MongoConection)Conection.getConection(); objs = conection.getDataBase().Eval(JoinFunction).AsBsonArray; result = objs.Count; return(result); }
public ProfileTable(string table = "Profiles") : base("Profiles") { conection = (MongoConection)Conection.getConection(); collection = conection.getCollection(table); }
public LocationsReport(string table) : base("Locations") { conection = (MongoConection)Conection.getConection(); collection = conection.getCollection(table); }
/// <summary> /// Intilializes the model, sets the collection to users /// </summary> public UserTable() { conection = (MongoConection)Conection.getConection(); collection = conection.getCollection("Users"); }
/// <summary> /// Initializes the model and sets the Customer collection /// </summary> public CustomerTable() { conection = (MongoConection)Conection.getConection(); collection = conection.getCollection("Customers"); }
public InventoryReport(string table) : base("Inventory") { conection = (MongoConection)Conection.getConection(); collection = conection.getCollection(table); }
public MovementReport(string table) : base("MovementProfiles") { conection = (MongoConection)Conection.getConection(); collection = conection.getCollection(table); }
public MessageReport(string table) : base("Messages") { conection = (MongoConection)Conection.getConection(); collection = conection.getCollection(table); }
/// <summary> /// Initializes the models /// </summary> public ObjectPrototypeTable() { conection = (MongoConection)Conection.getConection(); collection = conection.getCollection("ObjectPrototype"); }
public HwReport(string table) : base("Hardware") { conection = (MongoConection)Conection.getConection(); collection = conection.getCollection(table); }
/// <summary> /// Initializes the model /// </summary> /// <param name="collectionname"> /// the mongo's collections where the data is /// </param> public ListTable() { conection = (MongoConection)Conection.getConection(); collection = conection.getCollection("Lists"); }
public ObjectsRefReport(string table) : base("ReferenceObjects") { conection = (MongoConection)Conection.getConection(); collection = conection.getCollection(table); }
public ProccessReport(string table) : base("Processes") { conection = (MongoConection)Conection.getConection(); collection = conection.getCollection(table); }