-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
308 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#:E:\WorkSpace\MongoCola\MongoUtilityCore\MongoUtilityCore.xproj | ||
#:E:\WorkSpace\MongoCola\MongoColaWebAdmin\MongoColaWebAdmin.xproj | ||
E:\WorkSpace\MongoCola\MongoColaWebAdmin\MongoColaWebAdmin.xproj|E:\WorkSpace\MongoCola\MongoUtilityCore\MongoUtilityCore.xproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="mongocsharpdriver" version="2.3.0-rc1" targetFramework="net462" /> | ||
<package id="MongoDB.Bson" version="2.3.0-rc1" targetFramework="net462" /> | ||
<package id="MongoDB.Driver" version="2.3.0-rc1" targetFramework="net462" /> | ||
<package id="MongoDB.Driver.Core" version="2.3.0-rc1" targetFramework="net462" /> | ||
<package id="mongocsharpdriver" version="2.3.0" targetFramework="net462" /> | ||
<package id="MongoDB.Bson" version="2.3.0" targetFramework="net462" /> | ||
<package id="MongoDB.Driver" version="2.3.0" targetFramework="net462" /> | ||
<package id="MongoDB.Driver.Core" version="2.3.0" targetFramework="net462" /> | ||
<package id="SSH.NET" version="2016.0.0" targetFramework="net462" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Accord" version="3.2.3-alpha" targetFramework="net462" /> | ||
<package id="Accord.Controls" version="3.2.3-alpha" targetFramework="net462" /> | ||
<package id="Accord.MachineLearning" version="3.2.3-alpha" targetFramework="net462" /> | ||
<package id="Accord.Math" version="3.2.3-alpha" targetFramework="net462" /> | ||
<package id="Accord.Statistics" version="3.2.3-alpha" targetFramework="net462" /> | ||
<package id="mongocsharpdriver" version="2.3.0-rc1" targetFramework="net462" /> | ||
<package id="MongoDB.Bson" version="2.3.0-rc1" targetFramework="net462" /> | ||
<package id="MongoDB.Driver" version="2.3.0-rc1" targetFramework="net462" /> | ||
<package id="MongoDB.Driver.Core" version="2.3.0-rc1" targetFramework="net462" /> | ||
<package id="Accord" version="3.3.0" targetFramework="net462" /> | ||
<package id="Accord.Controls" version="3.3.0" targetFramework="net462" /> | ||
<package id="Accord.MachineLearning" version="3.3.0" targetFramework="net462" /> | ||
<package id="Accord.Math" version="3.3.0" targetFramework="net462" /> | ||
<package id="Accord.Statistics" version="3.3.0" targetFramework="net462" /> | ||
<package id="mongocsharpdriver" version="2.3.0" targetFramework="net462" /> | ||
<package id="MongoDB.Bson" version="2.3.0" targetFramework="net462" /> | ||
<package id="MongoDB.Driver" version="2.3.0" targetFramework="net462" /> | ||
<package id="MongoDB.Driver.Core" version="2.3.0" targetFramework="net462" /> | ||
<package id="ZedGraph" version="5.1.7" targetFramework="net45" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="mongocsharpdriver" version="2.3.0-rc1" targetFramework="net462" /> | ||
<package id="MongoDB.Bson" version="2.3.0-rc1" targetFramework="net462" /> | ||
<package id="MongoDB.Driver" version="2.3.0-rc1" targetFramework="net462" /> | ||
<package id="MongoDB.Driver.Core" version="2.3.0-rc1" targetFramework="net462" /> | ||
<package id="mongocsharpdriver" version="2.3.0" targetFramework="net462" /> | ||
<package id="MongoDB.Bson" version="2.3.0" targetFramework="net462" /> | ||
<package id="MongoDB.Driver" version="2.3.0" targetFramework="net462" /> | ||
<package id="MongoDB.Driver.Core" version="2.3.0" targetFramework="net462" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
using MongoDB.Bson; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
|
||
namespace MongoColaWebAdmin | ||
{ | ||
public class Utility | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
struct BsonElementDesciption | ||
{ | ||
/// <summary> | ||
/// 名称 | ||
/// </summary> | ||
public string name; | ||
/// <summary> | ||
/// 值 | ||
/// </summary> | ||
public string value; | ||
/// <summary> | ||
/// 类型 | ||
/// </summary> | ||
public string type; | ||
/// <summary> | ||
/// 子元素 | ||
/// </summary> | ||
public BsonElementDesciption[] children; | ||
} | ||
|
||
/// <summary> | ||
/// BsonDocument转Json字符串 | ||
/// </summary> | ||
/// <param name="Datalist"></param> | ||
/// <returns></returns> | ||
static List<BsonElementDesciption> GetJsonDocList(List<BsonDocument> Datalist, string rootName) | ||
{ | ||
var rtn = new List<BsonElementDesciption>(); | ||
foreach (var item in Datalist) | ||
{ | ||
rtn.Add(GetJsonDocument(item, rootName)); | ||
} | ||
return rtn; | ||
} | ||
|
||
/// <summary> | ||
/// 获得一个Doc的Json | ||
/// </summary> | ||
/// <param name="doc"></param> | ||
/// <returns></returns> | ||
static BsonElementDesciption GetJsonDocument(BsonDocument doc, string rootName) | ||
{ | ||
var rtn = new BsonElementDesciption(); | ||
rtn.name = rootName; | ||
rtn.type = "Document"; | ||
if (doc.Elements.First().Name == MongoUtility.Basic.ConstMgr.KeyId) | ||
{ | ||
rtn.value = doc.Elements.First().Value.ToString(); | ||
} | ||
return rtn; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.