初始化

This commit is contained in:
2025-11-20 14:38:48 +08:00
commit f9e0cc8a4a
534 changed files with 247694 additions and 0 deletions

View File

@@ -0,0 +1,134 @@
.help-page h1,
.help-page .h1,
.help-page h2,
.help-page .h2,
.help-page h3,
.help-page .h3,
#body.help-page,
.help-page-table th,
.help-page-table pre,
.help-page-table p {
font-family: "Segoe UI Light", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
}
.help-page pre.wrapped {
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
white-space: pre-wrap;
}
.help-page .warning-message-container {
margin-top: 20px;
padding: 0 10px;
color: #525252;
background: #EFDCA9;
border: 1px solid #CCCCCC;
}
.help-page-table {
width: 100%;
border-collapse: collapse;
text-align: left;
margin: 0px 0px 20px 0px;
border-top: 1px solid #D4D4D4;
}
.help-page-table th {
text-align: left;
font-weight: bold;
border-bottom: 1px solid #D4D4D4;
padding: 5px 6px 5px 6px;
}
.help-page-table td {
border-bottom: 1px solid #D4D4D4;
padding: 10px 8px 10px 8px;
vertical-align: top;
}
.help-page-table pre,
.help-page-table p {
margin: 0px;
padding: 0px;
font-family: inherit;
font-size: 100%;
}
.help-page-table tbody tr:hover td {
background-color: #F3F3F3;
}
.help-page a:hover {
background-color: transparent;
}
.help-page .sample-header {
border: 2px solid #D4D4D4;
background: #00497E;
color: #FFFFFF;
padding: 8px 15px;
border-bottom: none;
display: inline-block;
margin: 10px 0px 0px 0px;
}
.help-page .sample-content {
display: block;
border-width: 0;
padding: 15px 20px;
background: #FFFFFF;
border: 2px solid #D4D4D4;
margin: 0px 0px 10px 0px;
}
.help-page .api-name {
width: 40%;
}
.help-page .api-documentation {
width: 60%;
}
.help-page .parameter-name {
width: 20%;
}
.help-page .parameter-documentation {
width: 40%;
}
.help-page .parameter-type {
width: 20%;
}
.help-page .parameter-annotations {
width: 20%;
}
.help-page h1,
.help-page .h1 {
font-size: 36px;
line-height: normal;
}
.help-page h2,
.help-page .h2 {
font-size: 24px;
}
.help-page h3,
.help-page .h3 {
font-size: 20px;
}
#body.help-page {
font-size: 14px;
line-height: 143%;
color: #333;
}
.help-page a {
color: #0000EE;
text-decoration: none;
}

View File

@@ -0,0 +1,399 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
namespace BLV_API.Dal
{
public class SqlHelper
{
/// <summary>
/// 数据库连接字符串
/// Data Source=数据库地址;Initial Catalog=数据库名称;Persist Security Info=True;User ID=用户名;Password=密码
/// </summary>
private string _SqlConnectionStr = "";
public string SqlConnectionStr { get { return _SqlConnectionStr; } }
public SqlHelper(string connStr)
{
this._SqlConnectionStr = connStr;
}
#region 单值查询
public string GetSingle(string sqlStr)
{
using (SqlConnection conn = new SqlConnection(this._SqlConnectionStr))
{
using (SqlCommand cmd = new SqlCommand(sqlStr, conn))
{
try
{
conn.Open();
return String.Format("{0}", cmd.ExecuteScalar());
}
catch (SqlException e)
{
throw e;
}
finally
{
conn.Close();
}
}
}
}
public string GetSingle(string sqlStr, SqlParameter[] cmdParams)
{
using (SqlConnection conn = new SqlConnection(this._SqlConnectionStr))
{
using (SqlCommand cmd = new SqlCommand())
{
try
{
conn.Open();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = sqlStr;
cmd.Parameters.AddRange(cmdParams);
return String.Format("{0}", cmd.ExecuteScalar());
}
catch (SqlException e)
{
throw e;
}
finally
{
conn.Close();
}
}
}
}
#endregion
#region 查询数据集
public DataSet Query(string sqlStr)
{
using (SqlConnection conn = new SqlConnection(this._SqlConnectionStr))
{
using (SqlDataAdapter ada = new SqlDataAdapter(sqlStr, conn))
{
try
{
conn.Open();
DataSet ds = new DataSet();
ada.Fill(ds);
return ds;
}
catch (SqlException e)
{
throw e;
}
finally
{
conn.Close();
}
}
}
}
public DataSet Query(string sqlStr, SqlParameter[] cmdParams)
{
using (SqlConnection conn = new SqlConnection(this._SqlConnectionStr))
{
using (SqlCommand cmd = new SqlCommand())
{
using (SqlDataAdapter ada = new SqlDataAdapter(cmd))
{
try
{
conn.Open();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = sqlStr;
cmd.Parameters.AddRange(cmdParams);
DataSet ds = new DataSet();
ada.Fill(ds);
return ds;
}
catch (SqlException e)
{
throw e;
}
finally
{
conn.Close();
}
}
}
}
}
public DataSet RunProcedure(string procName, SqlParameter[] cmdParams)
{
using (SqlConnection conn = new SqlConnection(this._SqlConnectionStr))
{
using (SqlCommand cmd = new SqlCommand())
{
using (SqlDataAdapter ada = new SqlDataAdapter(cmd))
{
try
{
conn.Open();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = procName;
cmd.Parameters.AddRange(cmdParams);
DataSet ds = new DataSet();
ada.Fill(ds);
return ds;
}
catch (SqlException e)
{
throw e;
}
finally
{
conn.Close();
}
}
}
}
}
#endregion
#region 单表查询
public DataTable GetQueryData(string sqlStr)
{
DataSet ds = Query(sqlStr);
if (ds != null && ds.Tables.Count > 0)
return ds.Tables[0];
return null;
}
public DataTable GetQueryData(string sqlStr, SqlParameter[] cmdParams)
{
DataSet ds = Query(sqlStr, cmdParams);
if (ds != null && ds.Tables.Count > 0)
return ds.Tables[0];
return null;
}
public DataTable GetProcData(string procName, SqlParameter[] cmdParams)
{
DataSet ds = RunProcedure(procName, cmdParams);
if (ds != null && ds.Tables.Count > 0)
return ds.Tables[0];
return null;
}
#endregion
#region 单行查询
public DataRow GetQueryRecord(string sqlStr)
{
DataTable dt = GetQueryData(sqlStr);
if (dt != null && dt.Rows.Count > 0)
return dt.Rows[0];
return null;
}
public DataRow GetQueryRecord(string sqlStr, SqlParameter[] cmdParams)
{
DataTable dt = GetQueryData(sqlStr, cmdParams);
if (dt != null && dt.Rows.Count > 0)
return dt.Rows[0];
return null;
}
public DataRow GetProcRecord(string procName, SqlParameter[] cmdParams)
{
DataTable dt = GetProcData(procName, cmdParams);
if (dt != null && dt.Rows.Count > 0)
return dt.Rows[0];
return null;
}
#endregion
#region 使用完应关闭Reader
public SqlDataReader ExecuteReader(string sqlStr)
{
SqlConnection conn = new SqlConnection(this._SqlConnectionStr);
SqlCommand cmd = new SqlCommand(sqlStr, conn);
try
{
conn.Open();
return cmd.ExecuteReader(CommandBehavior.CloseConnection);
}
catch (SqlException e)
{
throw e;
}
}
public SqlDataReader ExecuteReeder(string sqlStr, SqlParameter[] cmdParams)
{
SqlConnection conn = new SqlConnection(this._SqlConnectionStr);
SqlCommand cmd = new SqlCommand();
try
{
conn.Open();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = sqlStr;
cmd.Parameters.AddRange(cmdParams);
return cmd.ExecuteReader(CommandBehavior.CloseConnection);
}
catch (SqlException e)
{
throw e;
}
}
#endregion
#region 执行sql语句
public int ExecuteSql(string sqlStr)
{
using (SqlConnection conn = new SqlConnection(this._SqlConnectionStr))
{
using (SqlCommand cmd = new SqlCommand(sqlStr, conn))
{
try
{
conn.Open();
return cmd.ExecuteNonQuery();
}
catch (SqlException e)
{
throw e;
}
finally
{
conn.Close();
}
}
}
}
public int ExecuteSql(string sqlStr, SqlParameter[] cmdParams)
{
using (SqlConnection conn = new SqlConnection(this._SqlConnectionStr))
{
using (SqlCommand cmd = new SqlCommand())
{
try
{
conn.Open();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = sqlStr;
cmd.Parameters.AddRange(cmdParams);
return cmd.ExecuteNonQuery();
}
catch (SqlException e)
{
throw e;
}
finally
{
conn.Close();
}
}
}
}
#endregion
#region 执行事务
public int ExecuteSqlTran(List<string> sqlStrList)
{
using (SqlConnection conn = new SqlConnection(this._SqlConnectionStr))
{
using (SqlCommand cmd = new SqlCommand())
{
using (SqlTransaction tran = conn.BeginTransaction())
{
try
{
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.Transaction = tran;
conn.Open();
int count = 0;
foreach (string sql in sqlStrList)
{
cmd.CommandText = sql;
count += cmd.ExecuteNonQuery();
}
tran.Commit();
return count;
}
catch (SqlException e)
{
tran.Rollback();
throw e;
}
finally
{
conn.Close();
}
}
}
}
}
public int ExecuteSqlTran(List<KeyValuePair<string, SqlParameter[]>> sqlStrList)
{
using (SqlConnection conn = new SqlConnection(this._SqlConnectionStr))
{
using (SqlCommand cmd = new SqlCommand())
{
using (SqlTransaction tran = conn.BeginTransaction())
{
try
{
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.Transaction = tran;
conn.Open();
int count = 0;
foreach (var item in sqlStrList)
{
cmd.CommandText = item.Key;
cmd.Parameters.Clear();
cmd.Parameters.AddRange(item.Value);
count += cmd.ExecuteNonQuery();
}
tran.Commit();
return count;
}
catch (SqlException e)
{
tran.Rollback();
throw e;
}
finally
{
conn.Close();
}
}
}
}
}
public int ExecuteProc(string procName, SqlParameter[] cmdParams)
{
using (SqlConnection conn = new SqlConnection(this._SqlConnectionStr))
{
using (SqlCommand cmd = new SqlCommand())
{
try
{
conn.Open();
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = procName;
cmd.Parameters.AddRange(cmdParams);
return cmd.ExecuteNonQuery();
}
catch (SqlException e)
{
throw e;
}
finally
{
conn.Close();
}
}
}
}
#endregion
}
}

View File

@@ -0,0 +1,7 @@
namespace $rootnamespace$.Areas.HelpPage.ModelDescriptions
{
public class CollectionModelDescription : ModelDescription
{
public ModelDescription ElementDescription { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
using System;
namespace PTS_API_V1.Areas.HelpPage.ModelDescriptions
{
public class ParameterAnnotation
{
public Attribute AnnotationAttribute { get; set; }
public string Documentation { get; set; }
}
}

View File

@@ -0,0 +1,172 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Net.Http.Headers;
namespace PTS_API_V1.Areas.HelpPage
{
/// <summary>
/// This is used to identify the place where the sample should be applied.
/// </summary>
public class HelpPageSampleKey
{
/// <summary>
/// Creates a new <see cref="HelpPageSampleKey"/> based on media type.
/// </summary>
/// <param name="mediaType">The media type.</param>
public HelpPageSampleKey(MediaTypeHeaderValue mediaType)
{
if (mediaType == null)
{
throw new ArgumentNullException("mediaType");
}
ActionName = String.Empty;
ControllerName = String.Empty;
MediaType = mediaType;
ParameterNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
}
/// <summary>
/// Creates a new <see cref="HelpPageSampleKey"/> based on media type and CLR type.
/// </summary>
/// <param name="mediaType">The media type.</param>
/// <param name="type">The CLR type.</param>
public HelpPageSampleKey(MediaTypeHeaderValue mediaType, Type type)
: this(mediaType)
{
if (type == null)
{
throw new ArgumentNullException("type");
}
ParameterType = type;
}
/// <summary>
/// Creates a new <see cref="HelpPageSampleKey"/> based on <see cref="SampleDirection"/>, controller name, action name and parameter names.
/// </summary>
/// <param name="sampleDirection">The <see cref="SampleDirection"/>.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
public HelpPageSampleKey(SampleDirection sampleDirection, string controllerName, string actionName, IEnumerable<string> parameterNames)
{
if (!Enum.IsDefined(typeof(SampleDirection), sampleDirection))
{
throw new InvalidEnumArgumentException("sampleDirection", (int)sampleDirection, typeof(SampleDirection));
}
if (controllerName == null)
{
throw new ArgumentNullException("controllerName");
}
if (actionName == null)
{
throw new ArgumentNullException("actionName");
}
if (parameterNames == null)
{
throw new ArgumentNullException("parameterNames");
}
ControllerName = controllerName;
ActionName = actionName;
ParameterNames = new HashSet<string>(parameterNames, StringComparer.OrdinalIgnoreCase);
SampleDirection = sampleDirection;
}
/// <summary>
/// Creates a new <see cref="HelpPageSampleKey"/> based on media type, <see cref="SampleDirection"/>, controller name, action name and parameter names.
/// </summary>
/// <param name="mediaType">The media type.</param>
/// <param name="sampleDirection">The <see cref="SampleDirection"/>.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
public HelpPageSampleKey(MediaTypeHeaderValue mediaType, SampleDirection sampleDirection, string controllerName, string actionName, IEnumerable<string> parameterNames)
: this(sampleDirection, controllerName, actionName, parameterNames)
{
if (mediaType == null)
{
throw new ArgumentNullException("mediaType");
}
MediaType = mediaType;
}
/// <summary>
/// Gets the name of the controller.
/// </summary>
/// <value>
/// The name of the controller.
/// </value>
public string ControllerName { get; private set; }
/// <summary>
/// Gets the name of the action.
/// </summary>
/// <value>
/// The name of the action.
/// </value>
public string ActionName { get; private set; }
/// <summary>
/// Gets the media type.
/// </summary>
/// <value>
/// The media type.
/// </value>
public MediaTypeHeaderValue MediaType { get; private set; }
/// <summary>
/// Gets the parameter names.
/// </summary>
public HashSet<string> ParameterNames { get; private set; }
public Type ParameterType { get; private set; }
/// <summary>
/// Gets the <see cref="SampleDirection"/>.
/// </summary>
public SampleDirection? SampleDirection { get; private set; }
public override bool Equals(object obj)
{
HelpPageSampleKey otherKey = obj as HelpPageSampleKey;
if (otherKey == null)
{
return false;
}
return String.Equals(ControllerName, otherKey.ControllerName, StringComparison.OrdinalIgnoreCase) &&
String.Equals(ActionName, otherKey.ActionName, StringComparison.OrdinalIgnoreCase) &&
(MediaType == otherKey.MediaType || (MediaType != null && MediaType.Equals(otherKey.MediaType))) &&
ParameterType == otherKey.ParameterType &&
SampleDirection == otherKey.SampleDirection &&
ParameterNames.SetEquals(otherKey.ParameterNames);
}
public override int GetHashCode()
{
int hashCode = ControllerName.ToUpperInvariant().GetHashCode() ^ ActionName.ToUpperInvariant().GetHashCode();
if (MediaType != null)
{
hashCode ^= MediaType.GetHashCode();
}
if (SampleDirection != null)
{
hashCode ^= SampleDirection.GetHashCode();
}
if (ParameterType != null)
{
hashCode ^= ParameterType.GetHashCode();
}
foreach (string parameterName in ParameterNames)
{
hashCode ^= parameterName.ToUpperInvariant().GetHashCode();
}
return hashCode;
}
}
}

View File

@@ -0,0 +1,12 @@
param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
if ($scriptsFolderProjectItem -eq $null) {
# No Scripts folder
Write-Host "No Scripts folder found"
exit
}
# Update the _references.js file
AddOrUpdate-Reference $scriptsFolderProjectItem $modernizrFileNameRegEx $modernizrFileName

View File

@@ -0,0 +1,108 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Net.Http.Headers;
using System.Web.Http.Description;
using $rootnamespace$.Areas.HelpPage.ModelDescriptions;
namespace $rootnamespace$.Areas.HelpPage.Models
{
/// <summary>
/// The model that represents an API displayed on the help page.
/// </summary>
public class HelpPageApiModel
{
/// <summary>
/// Initializes a new instance of the <see cref="HelpPageApiModel"/> class.
/// </summary>
public HelpPageApiModel()
{
UriParameters = new Collection<ParameterDescription>();
SampleRequests = new Dictionary<MediaTypeHeaderValue, object>();
SampleResponses = new Dictionary<MediaTypeHeaderValue, object>();
ErrorMessages = new Collection<string>();
}
/// <summary>
/// Gets or sets the <see cref="ApiDescription"/> that describes the API.
/// </summary>
public ApiDescription ApiDescription { get; set; }
/// <summary>
/// Gets or sets the <see cref="ParameterDescription"/> collection that describes the URI parameters for the API.
/// </summary>
public Collection<ParameterDescription> UriParameters { get; private set; }
/// <summary>
/// Gets or sets the documentation for the request.
/// </summary>
public string RequestDocumentation { get; set; }
/// <summary>
/// Gets or sets the <see cref="ModelDescription"/> that describes the request body.
/// </summary>
public ModelDescription RequestModelDescription { get; set; }
/// <summary>
/// Gets the request body parameter descriptions.
/// </summary>
public IList<ParameterDescription> RequestBodyParameters
{
get
{
return GetParameterDescriptions(RequestModelDescription);
}
}
/// <summary>
/// Gets or sets the <see cref="ModelDescription"/> that describes the resource.
/// </summary>
public ModelDescription ResourceDescription { get; set; }
/// <summary>
/// Gets the resource property descriptions.
/// </summary>
public IList<ParameterDescription> ResourceProperties
{
get
{
return GetParameterDescriptions(ResourceDescription);
}
}
/// <summary>
/// Gets the sample requests associated with the API.
/// </summary>
public IDictionary<MediaTypeHeaderValue, object> SampleRequests { get; private set; }
/// <summary>
/// Gets the sample responses associated with the API.
/// </summary>
public IDictionary<MediaTypeHeaderValue, object> SampleResponses { get; private set; }
/// <summary>
/// Gets the error messages associated with this model.
/// </summary>
public Collection<string> ErrorMessages { get; private set; }
private static IList<ParameterDescription> GetParameterDescriptions(ModelDescription modelDescription)
{
ComplexTypeModelDescription complexTypeModelDescription = modelDescription as ComplexTypeModelDescription;
if (complexTypeModelDescription != null)
{
return complexTypeModelDescription.Properties;
}
CollectionModelDescription collectionModelDescription = modelDescription as CollectionModelDescription;
if (collectionModelDescription != null)
{
complexTypeModelDescription = collectionModelDescription.ElementDescription as ComplexTypeModelDescription;
if (complexTypeModelDescription != null)
{
return complexTypeModelDescription.Properties;
}
}
return null;
}
}
}

View File

@@ -0,0 +1,144 @@
using BLV_API.Dal;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace BLV_API.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Title = "宝来威客控与PMS对接API";
return View();
}
/// <summary>
/// 用户登录
/// </summary>
/// <param name="userName"></param>
/// <param name="password"></param>
/// <param name="hostName"></param>
/// <returns></returns>
public ActionResult Login(string userName, string password)
{
if (string.IsNullOrEmpty(userName))
{
return Json(ReturnResult(4001, "参数(userName)不能为空"), JsonRequestBehavior.AllowGet);
}
if (string.IsNullOrEmpty(password))
{
return Json(ReturnResult(4001, "参数(password)不能为空"), JsonRequestBehavior.AllowGet);
}
try
{
return Json(ReturnResult(200, "登录成功"), JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
return Json(ReturnResult(4001, ex.Message), JsonRequestBehavior.AllowGet);
}
}
/// <summary>
/// 根据条码获取物料
/// </summary>
/// <param name="code">条码</param>
/// <returns></returns>
public ActionResult GetMaterialByCode(string code)
{
if (string.IsNullOrEmpty(code))
{
return Json(ReturnResult(4001, "参数(code)不能为空"), JsonRequestBehavior.AllowGet);
}
try
{
string sql = $"exec sp_GetDetailInfoByProjectNO {1},'{code}',{0}";//参数1扫码输入1参数2条码参数3人工输入情况下0标准件1机加件
DataTable dt = DbProvider.SqlServer.GetQueryData(sql);
return Json(ReturnResult(200, "获取成功", Newtonsoft.Json.JsonConvert.SerializeObject(dt)), JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
return Json(ReturnResult(4001, ex.Message), JsonRequestBehavior.AllowGet);
}
}
/// <summary>
/// 根据物料编码获取附件列表
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
public ActionResult GetModelLibFilesByCode(string code)
{
if (string.IsNullOrEmpty(code))
{
return Json(ReturnResult(4001, "参数(code)不能为空"), JsonRequestBehavior.AllowGet);
}
try
{
string sql = $"select ID,Code,FileName,UploadTime from WMS_BOMModelLibFiles where Code='{code}'";
DataTable dt = DbProvider.SqlServer.GetQueryData(sql);
return Json(ReturnResult(200, "获取成功", Newtonsoft.Json.JsonConvert.SerializeObject(dt)), JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
return Json(ReturnResult(4001, ex.Message), JsonRequestBehavior.AllowGet);
}
}
/// <summary>
/// 根据附件ID获取附件内容
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public ActionResult GetModelLibFileByID(int id)
{
if (id == 0)
{
return Json(ReturnResult(4001, "参数(id)不能为空"), JsonRequestBehavior.AllowGet);
}
try
{
string sql = $"select ID,FileContent from WMS_BOMModelLibFiles where ID={id}";
DataTable dt = DbProvider.SqlServer.GetQueryData(sql);
object result = ReturnResult(200, "获取成功", Newtonsoft.Json.JsonConvert.SerializeObject(dt));
//return Json(ReturnResult(true, "获取成功", Newtonsoft.Json.JsonConvert.SerializeObject(dt)), JsonRequestBehavior.AllowGet);
return new ContentResult
{
Content = new System.Web.Script.Serialization.JavaScriptSerializer { MaxJsonLength = Int32.MaxValue }.Serialize(result),
ContentType = "application/json"
};
}
catch (Exception ex)
{
return Json(ReturnResult(4001, ex.Message), JsonRequestBehavior.AllowGet);
}
}
/// <summary>
/// 返回结果
/// </summary>
/// <param name="result">结果</param>
/// <param name="msg">提示信息</param>
/// <param name="data">返回数据</param>
/// <returns></returns>
private object ReturnResult(int code, string msg, string data = "")
{
return new APIResultEntity() { code = code, msg = msg, data = data };
}
}
public class APIResultEntity
{
/// <summary>
/// 结果true成功false失败
/// </summary>
public int code { get; set; }
/// <summary>
/// 提示信息
/// </summary>
public string msg { get; set; }
/// <summary>
/// 返回数据
/// </summary>
public string data { get; set; }
}
}

View File

@@ -0,0 +1,67 @@
@using System.Web.Http
@using System.Web.Http.Description
@using $rootnamespace$.Areas.HelpPage.Models
@using $rootnamespace$.Areas.HelpPage.ModelDescriptions
@model HelpPageApiModel
@{
ApiDescription description = Model.ApiDescription;
}
<h1>@description.HttpMethod.Method @description.RelativePath</h1>
<div>
<p>@description.Documentation</p>
<h2>Request Information</h2>
<h3>URI Parameters</h3>
@Html.DisplayFor(m => m.UriParameters, "Parameters")
<h3>Body Parameters</h3>
<p>@Model.RequestDocumentation</p>
@if (Model.RequestModelDescription != null)
{
@Html.DisplayFor(m => m.RequestModelDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.RequestModelDescription })
if (Model.RequestBodyParameters != null)
{
@Html.DisplayFor(m => m.RequestBodyParameters, "Parameters")
}
}
else
{
<p>None.</p>
}
@if (Model.SampleRequests.Count > 0)
{
<h3>Request Formats</h3>
@Html.DisplayFor(m => m.SampleRequests, "Samples")
}
<h2>Response Information</h2>
<h3>Resource Description</h3>
<p>@description.ResponseDescription.Documentation</p>
@if (Model.ResourceDescription != null)
{
@Html.DisplayFor(m => m.ResourceDescription.ModelType, "ModelDescriptionLink", new { modelDescription = Model.ResourceDescription })
if (Model.ResourceProperties != null)
{
@Html.DisplayFor(m => m.ResourceProperties, "Parameters")
}
}
else
{
<p>None.</p>
}
@if (Model.SampleResponses.Count > 0)
{
<h3>Response Formats</h3>
@Html.DisplayFor(m => m.SampleResponses, "Samples")
}
</div>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
@{
// Change the Layout path below to blend the look and feel of the help page with your existing web pages.
Layout = "~/Areas/HelpPage/Views/Shared/_Layout.cshtml";
}

View File

@@ -0,0 +1,41 @@
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!-- If runtime tag is absent -->
<runtime xdt:Transform="InsertIfMissing">
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
</assemblyBinding>
</runtime>
<!-- If runtime tag is present, but assembly binding tag is absent -->
<runtime>
<assemblyBinding xdt:Transform="InsertIfMissing" xmlns="urn:schemas-microsoft-com:asm.v1">
</assemblyBinding>
</runtime>
<!-- If the binding redirect is already present, the existing entry needs to be removed before inserting the new entry-->
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly xdt:Transform="Remove"
xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Web.Helpers')" >
</dependentAssembly>
<dependentAssembly xdt:Transform="Remove"
xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Web.WebPages')" >
</dependentAssembly>
</assemblyBinding>
</runtime>
<!-- Inserting the new binding redirect -->
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -0,0 +1,75 @@
function AddOrUpdate-Reference($scriptsFolderProjectItem, $fileNamePattern, $newFileName) {
try {
$referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
}
catch {
# _references.js file not found
return
}
if ($referencesFileProjectItem -eq $null) {
# _references.js file not found
return
}
$referencesFilePath = $referencesFileProjectItem.FileNames(1)
$referencesTempFilePath = Join-Path $env:TEMP "_references.tmp.js"
if ((Select-String $referencesFilePath -pattern $fileNamePattern).Length -eq 0) {
# File has no existing matching reference line
# Add the full reference line to the beginning of the file
"/// <reference path=""$newFileName"" />" | Add-Content $referencesTempFilePath -Encoding UTF8
Get-Content $referencesFilePath | Add-Content $referencesTempFilePath
}
else {
# Loop through file and replace old file name with new file name
Get-Content $referencesFilePath | ForEach-Object { $_ -replace $fileNamePattern, $newFileName } > $referencesTempFilePath
}
# Copy over the new _references.js file
Copy-Item $referencesTempFilePath $referencesFilePath -Force
Remove-Item $referencesTempFilePath -Force
}
function Remove-Reference($scriptsFolderProjectItem, $fileNamePattern) {
try {
$referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
}
catch {
# _references.js file not found
return
}
if ($referencesFileProjectItem -eq $null) {
return
}
$referencesFilePath = $referencesFileProjectItem.FileNames(1)
$referencesTempFilePath = Join-Path $env:TEMP "_references.tmp.js"
if ((Select-String $referencesFilePath -pattern $fileNamePattern).Length -eq 1) {
# Delete the line referencing the file
Get-Content $referencesFilePath | ForEach-Object { if (-not ($_ -match $fileNamePattern)) { $_ } } > $referencesTempFilePath
# Copy over the new _references.js file
Copy-Item $referencesTempFilePath $referencesFilePath -Force
Remove-Item $referencesTempFilePath -Force
}
}
# Extract the version number from the file in the package's content\scripts folder
$packageScriptsFolder = Join-Path $installPath Content\Scripts
$modernizrFileName = Join-Path $packageScriptsFolder "modernizr-*.js" | Get-ChildItem -Exclude "*.min.js","*-vsdoc.js" | Split-Path -Leaf
$modernizrFileNameRegEx = "modernizr-((?:\d+\.)?(?:\d+\.)?(?:\d+\.)?(?:\d+)).js"
$modernizrFileName -match $modernizrFileNameRegEx
$ver = $matches[1]
# Get the project item for the scripts folder
try {
$scriptsFolderProjectItem = $project.ProjectItems.Item("Scripts")
$projectScriptsFolderPath = $scriptsFolderProjectItem.FileNames(1)
}
catch {
# No Scripts folder
Write-Host "No scripts folder found"
}

View File

@@ -0,0 +1,143 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
<runtime>
<gcServer enabled="true" />
<gcConcurrent enabled="false" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.9.0.0" newVersion="2.9.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.9.0.0" newVersion="2.9.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.CodeAnalysis.VisualBasic" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.9.0.0" newVersion="2.9.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.3.0" newVersion="1.2.3.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.FileVersionInfo" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipes" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.4.3.0" newVersion="1.4.3.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Threading.Thread" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Security.Principal.Windows" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -0,0 +1,215 @@
using BLV_API.Dal;
using BLV_API.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Xml.Linq;
namespace BLV_API.Controllers
{
public class ApiController : Controller
{
public ActionResult Index()
{
ViewBag.Title = "宝来威客控与PMS对接API";
return View();
}
/// <summary>
/// Luopan PMS对接
/// </summary>
/// <returns></returns>
public ActionResult LuopanToBLV()
{
Request.InputStream.Position = 0;
byte[] reqBody = new byte[Request.InputStream.Length];
Request.InputStream.Read(reqBody, 0, reqBody.Length);
string reqData = System.Text.Encoding.UTF8.GetString(reqBody);
if (string.IsNullOrEmpty(reqData))
{
return Json(new LuopanEntity.Result() { status = 1, error_msg = "传递参数不能为空" }, JsonRequestBehavior.AllowGet);
}
try
{
LuopanEntity.Root req = JsonConvert.DeserializeObject<LuopanEntity.Root>(reqData);
string hotelCode = System.Configuration.ConfigurationManager.AppSettings[req.HotelId];
if (string.IsNullOrEmpty(hotelCode))
{
LogHelper.WriteLog($"HotelId({req.HotelId})不匹配或未配置");
return Json(new LuopanEntity.Result() { status = 1, error_msg = $"HotelId({req.HotelId})不匹配或未配置" }, JsonRequestBehavior.AllowGet);
}
ServiceReference1.blwwsSoapClient client = new ServiceReference1.blwwsSoapClient();
string errorMsg = "";
bool blvResult = false;
StringBuilder xmlString = new StringBuilder();
string phoneNumber = "";
string idNumber = "";
switch (req.Action)
{
case "CheckIn"://入住
if (req.GuestInfo.Count > 0)
{
phoneNumber = req.GuestInfo[0].Mobile;
idNumber = req.GuestInfo[0].IDCardNo;
xmlString.Append("<interface>");
foreach (LuopanEntity.GuestInfo guest in req.GuestInfo)
{
xmlString.Append("<item idtype=\"" + guest.IDCardTypeId + "\" idcard = \"" + guest.IDCardNo + "\" customer = \"" + guest.GuestName + "\" sex =\"" +
(guest.Gender == 0 ? "男" : "女") + "\" country =\"0\" checkindate = \"" + req.CheckInTime.ToString("yyyy-MM-dd HH:mm:ss") + "\"/>");
}
xmlString.Append("</interface>");
}
blvResult = client.CheckIn("blw_ws@2015", hotelCode, req.RoomNo, req.CheckInTime, xmlString.ToString(), ref errorMsg, phoneNumber, idNumber);
//LogHelper.WriteLog($"转发BLV内部开房接口结果{blvResult},消息:{errorMsg}");
break;
case "CheckOut"://退房
blvResult = client.CheckOut("blw_ws@2015", hotelCode, req.RoomNo, req.CheckOutTime, ref errorMsg);
//LogHelper.WriteLog($"转发BLV内部退房接口结果{blvResult},消息:{errorMsg}");
break;
case "MoveRoom"://换房
//先退房
blvResult = client.CheckOut("blw_ws@2015", hotelCode, req.OldRoomNo, req.MoveTime, ref errorMsg);
//LogHelper.WriteLog($"转发BLV内部退房接口结果{blvResult},消息:{errorMsg}");
//再开房
if (req.GuestInfo.Count > 0)
{
phoneNumber = req.GuestInfo[0].Mobile;
idNumber = req.GuestInfo[0].IDCardNo;
xmlString.Append("<interface>");
foreach (LuopanEntity.GuestInfo guest in req.GuestInfo)
{
xmlString.Append("<item idtype=\"" + guest.IDCardTypeId + "\" idcard = \"" + guest.IDCardNo + "\" customer = \"" + guest.GuestName + "\" sex =\"" +
(guest.Gender == 0 ? "男" : "女") + "\" country =\"0\" checkindate = \"" + req.CheckInTime.ToString("yyyy-MM-dd HH:mm:ss") + "\"/>");
}
xmlString.Append("</interface>");
}
blvResult = client.CheckIn("blw_ws@2015", hotelCode, req.NewRoomNo, req.CheckInTime, xmlString.ToString(), ref errorMsg, phoneNumber, idNumber);
//LogHelper.WriteLog($"转发BLV内部开房接口结果{blvResult},消息:{errorMsg}");
break;
default:
errorMsg = "宝莱威接口未处理Action" + req.Action;
break;
}
if (blvResult)
{
return Json(new LuopanEntity.Result() { status = 0, error_msg = "" }, JsonRequestBehavior.AllowGet);
}
else
{
LogHelper.WriteLog(errorMsg);
LogHelper.WriteLog("收到Luopan请求" + reqData);
return Json(new LuopanEntity.Result() { status = 1, error_msg = errorMsg }, JsonRequestBehavior.AllowGet);
}
}
catch (Exception ex)
{
LogHelper.WriteLog(ex.ToString());
LogHelper.WriteLog("收到Luopan请求" + reqData);
return Json(new LuopanEntity.Result() { status = 1, error_msg = ex.Message }, JsonRequestBehavior.AllowGet);
}
}
/// <summary>
/// Luopan2 PMS对接
/// </summary>
/// <returns></returns>
public ActionResult Luopan2ToBLV()
{
Request.InputStream.Position = 0;
byte[] reqBody = new byte[Request.InputStream.Length];
Request.InputStream.Read(reqBody, 0, reqBody.Length);
string reqData = System.Text.Encoding.UTF8.GetString(reqBody);
if (string.IsNullOrEmpty(reqData))
{
return Json(new LuopanEntity.Result() { status = 1, error_msg = "传递参数不能为空" }, JsonRequestBehavior.AllowGet);
}
try
{
Luopan2Entity.Root req = JsonConvert.DeserializeObject<Luopan2Entity.Root>(reqData);
string hotelCode = System.Configuration.ConfigurationManager.AppSettings[req.hotel_id];
if (string.IsNullOrEmpty(hotelCode))
{
LogHelper.WriteLog($"hotel_id({req.hotel_id})不匹配或未配置");
return Json(new LuopanEntity.Result() { status = 1, error_msg = $"hotel_id({req.hotel_id})不匹配或未配置" }, JsonRequestBehavior.AllowGet);
}
ServiceReference1.blwwsSoapClient client = new ServiceReference1.blwwsSoapClient();
string errorMsg = "";
bool blvResult = false;
StringBuilder xmlString = new StringBuilder();
string phoneNumber = "";
string idNumber = "";
switch (req.type)
{
case "reg.checkin"://入住
case "guest.checkin"://更新入住人
//①转发客控后台
if (req.guests.Count > 0)
{
phoneNumber = req.guests[0].mobile;
idNumber = req.guests[0].id_card_no;
xmlString.Append("<interface>");
foreach (Luopan2Entity.GuestsItem guest in req.guests)
{
xmlString.Append("<item idtype=\"" + guest.id_card_type_id + "\" idcard = \"" + guest.id_card_no + "\" customer = \"" + guest.last_name+guest.first_name + "\" sex =\"" +
(guest.gender_id == 0 ? "男" : "女") + "\" country =\"0\" checkindate = \"" + req.check_in_time.ToString("yyyy-MM-dd HH:mm:ss") + "\"/>");
}
xmlString.Append("</interface>");
}
blvResult = client.CheckIn("blw_ws@2015", hotelCode, req.room_no, req.check_in_time, xmlString.ToString(), ref errorMsg, phoneNumber, idNumber);
//LogHelper.WriteLog($"转发BLV内部开房接口结果{blvResult},消息:{errorMsg}");
//②转发人脸机
//③转发宝镜系统
break;
case "reg.checkout"://退房
//cricsEntity.RoomStatusID = 8;
blvResult = client.CheckOut("blw_ws@2015", hotelCode, req.room_no, req.check_out_time, ref errorMsg);
//LogHelper.WriteLog($"转发BLV内部退房接口结果{blvResult},消息:{errorMsg}");
break;
case "reg.move"://换房
//cricsEntity.RoomStatusID = 2;
//先退房
blvResult = client.CheckOut("blw_ws@2015", hotelCode, req.old_room_no, req.move_time, ref errorMsg);
//LogHelper.WriteLog($"转发BLV内部退房接口结果{blvResult},消息:{errorMsg}");
//再开房
if (req.guests.Count > 0)
{
phoneNumber = req.guests[0].mobile;
idNumber = req.guests[0].id_card_no;
xmlString.Append("<interface>");
foreach (Luopan2Entity.GuestsItem guest in req.guests)
{
xmlString.Append("<item idtype=\"" + guest.id_card_type_id + "\" idcard = \"" + guest.id_card_no + "\" customer = \"" + guest.last_name+guest.first_name + "\" sex =\"" +
(guest.gender_id == 0 ? "男" : "女") + "\" country =\"0\" checkindate = \"" + req.check_in_time.ToString("yyyy-MM-dd HH:mm:ss") + "\"/>");
}
xmlString.Append("</interface>");
}
blvResult = client.CheckIn("blw_ws@2015", hotelCode, req.new_room_no, req.check_in_time, xmlString.ToString(), ref errorMsg, phoneNumber, idNumber);
//LogHelper.WriteLog($"转发BLV内部开房接口结果{blvResult},消息:{errorMsg}");
break;
default:
errorMsg = "宝莱威接口未处理type" + req.type;
break;
}
if (blvResult)
{
return Json(new LuopanEntity.Result() { status = 0, error_msg = "" }, JsonRequestBehavior.AllowGet);
}
else
{
LogHelper.WriteLog(errorMsg);
LogHelper.WriteLog("收到Luopan2请求" + reqData);
return Json(new LuopanEntity.Result() { status = 1, error_msg = errorMsg }, JsonRequestBehavior.AllowGet);
}
}
catch (Exception ex)
{
LogHelper.WriteLog(ex.ToString());
LogHelper.WriteLog("收到Luopan2请求" + reqData);
return Json(new LuopanEntity.Result() { status = 1, error_msg = ex.Message }, JsonRequestBehavior.AllowGet);
}
}
}
}

View File

@@ -0,0 +1,41 @@
param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# VS 11 and above supports the new intellisense JS files
$vsVersion = [System.Version]::Parse($dte.Version)
$supportsJsIntelliSenseFile = $vsVersion.Major -ge 11
if (-not $supportsJsIntelliSenseFile) {
$displayVersion = $vsVersion.Major
Write-Host "IntelliSense JS files are not supported by your version of Visual Studio: $displayVersion"
exit
}
if ($scriptsFolderProjectItem -eq $null) {
# No Scripts folder
Write-Host "No Scripts folder found"
exit
}
# Delete the vsdoc file from the project
try {
$vsDocProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("jquery-$ver-vsdoc.js")
Delete-ProjectItem $vsDocProjectItem
}
catch {
Write-Host "Error deleting vsdoc file: " + $_.Exception -ForegroundColor Red
exit
}
# Copy the intellisense file to the project from the tools folder
$intelliSenseFileSourcePath = Join-Path $toolsPath $intelliSenseFileName
try {
$scriptsFolderProjectItem.ProjectItems.AddFromFileCopy($intelliSenseFileSourcePath)
}
catch {
# This will throw if the file already exists, so we need to catch here
}
# Update the _references.js file
AddOrUpdate-Reference $scriptsFolderProjectItem $jqueryFileNameRegEx $jqueryFileName

View File

@@ -0,0 +1,253 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace BLV_API.Models
{
public class LuopanEntity
{
/// <summary>
/// 入住人信息
/// </summary>
public class GuestInfo
{
/// <summary>
/// 罗盘系统里对客人的唯一主键标识
/// </summary>
public string Id { get; set; }
/// <summary>
/// 称呼:先生、女士
/// </summary>
public string Salutation { get; set; }
/// <summary>
/// 入住人姓名
/// </summary>
public string GuestName { get; set; }
/// <summary>
/// 证件号
/// </summary>
public string IDCardNo { get; set; }
/// <summary>
/// 证件类型
/// </summary>
public string IDCardTypeId { get; set; }
/// <summary>
/// 性别0男1女
/// </summary>
public string Gender { get; set; }
/// <summary>
/// 生日1992-04-27
/// </summary>
public string Birthday { get; set; }
/// <summary>
/// 身份证地址
/// </summary>
public string Address { get; set; }
/// <summary>
/// 手机号
/// </summary>
public string Mobile { get; set; }
/// <summary>
/// 城市代码
/// </summary>
public string CityCode { get; set; }
/// <summary>
/// 省份代码
/// </summary>
public string ProvinceCode { get; set; }
/// <summary>
/// 乡镇代码
/// </summary>
public string CountryCode { get; set; }
/// <summary>
/// 签证号码
/// </summary>
public string VisaNo { get; set; }
/// <summary>
/// 签证种类代码
/// </summary>
public string VisaTypeId { get; set; }
/// <summary>
/// 签证有效期
/// </summary>
public string VisaValid { get; set; }
/// <summary>
///
/// </summary>
public string VipType { get; set; }
}
/// <summary>
/// 主数据入口
/// </summary>
public class Root
{
/// <summary>
/// 动作:新房间入住或者在房间里添加入住人 CheckIn
/// 退房或移出客人 CheckOut
/// 换房包括将登记单换房以及某个客人从A 房间挪到 B 房间MoveRoom
/// 房间延住 Extend
/// </summary>
public string Action { get; set; }
/// <summary>
/// 酒店ID
/// </summary>
public string HotelId { get; set; }
/// <summary>
/// 注册码
/// </summary>
public string RegisterId { get; set; }
/// <summary>
/// 房间ID
/// </summary>
public string RoomId { get; set; }
/// <summary>
/// 房间号
/// </summary>
public string RoomNo { get; set; }
/// <summary>
/// 房型ID
/// </summary>
public string RoomTypeId { get; set; }
/// <summary>
/// 房型
/// </summary>
public string RoomTypeName { get; set; }
/// <summary>
///
/// </summary>
public string RateCode { get; set; }
/// <summary>
/// 楼名称
/// </summary>
public string RoomBuildingName { get; set; }
/// <summary>
/// 楼编号
/// </summary>
public string RoomBuildingCode { get; set; }
/// <summary>
/// 楼层名称
/// </summary>
public string RoomFloorName { get; set; }
/// <summary>
/// 楼层编号
/// </summary>
public string RoomFloorCode { get; set; }
/// <summary>
/// 入住时间
/// </summary>
public DateTime CheckInTime { get; set; }
/// <summary>
/// 预计离店时间
/// </summary>
public DateTime CheckOutTime { get; set; }
/// <summary>
/// 是否开一个新房间true 表示是新房间入住, false 是挪入新同住
/// </summary>
public bool CheckInRoom { get; set; }
/// <summary>
/// 是否将房间退房false 表示仅客人挪走,房间不退
/// </summary>
public bool CheckOutRoom { get; set; }
/// <summary>
/// 要移出的房间号
/// </summary>
public string OldRoomNo { get; set; }
/// <summary>
///
/// </summary>
public string OldRoomTypeId { get; set; }
/// <summary>
/// 豪华单人间
/// </summary>
public string OldRoomTypeName { get; set; }
/// <summary>
/// 13楼
/// </summary>
public string OldRoomBuildingName { get; set; }
/// <summary>
///
/// </summary>
public string OldRoomBuildingCode { get; set; }
/// <summary>
/// 五楼
/// </summary>
public string OldRoomFloorName { get; set; }
/// <summary>
///
/// </summary>
public string OldRoomFloorCode { get; set; }
/// <summary>
/// 要移到的房间号
/// </summary>
public string NewRoomNo { get; set; }
/// <summary>
///
/// </summary>
public string NewRoomTypeId { get; set; }
/// <summary>
/// 豪华单人间
/// </summary>
public string NewRoomTypeName { get; set; }
/// <summary>
/// 13楼
/// </summary>
public string NewRoomBuildingName { get; set; }
/// <summary>
///
/// </summary>
public string NewRoomBuildingCode { get; set; }
/// <summary>
/// 五楼
/// </summary>
public string NewRoomFloorName { get; set; }
/// <summary>
///
/// </summary>
public string NewRoomFloorCode { get; set; }
/// <summary>
/// /换房时间
/// </summary>
public DateTime MoveTime { get; set; }
/// <summary>
/// 是否对旧房间退房true 表示是整体登记单换房
/// </summary>
public bool CheckOutOldRoom { get; set; }
/// <summary>
/// 是否换到一个已经入住的房间false 表示换到一个空房
/// </summary>
public bool MoveToInHouse { get; set; }
/// <summary>
/// 订单ID
/// </summary>
public string OrderId { get; set; }
/// <summary>
/// /所属团队 ID
/// </summary>
public string GroupId { get; set; }
/// <summary>
/// 车牌号,目前对接停车场系统
/// </summary>
public string RegisterNo { get; set; }
/// <summary>
///
/// </summary>
public string AllocationId { get; set; }
/// <summary>
/// 入住人信息
/// </summary>
public List<GuestInfo> GuestInfo { get; set; }
}
public class Result
{
/// <summary>
/// 0表示成功1表示失败不再重试2表示失败希望Luopan再重发
/// </summary>
public int status { get; set; }
/// <summary>
/// 如果失败,这里返回失败的描述信息
/// </summary>
public string error_msg { get; set; }
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,38 @@
@using System.Web.Http
@using System.Web.Http.Controllers
@using System.Web.Http.Description
@using System.Collections.ObjectModel
@using $rootnamespace$.Areas.HelpPage.Models
@model Collection<ApiDescription>
@{
ViewBag.Title = "ASP.NET Web API Help Page";
// Group APIs by controller
ILookup<HttpControllerDescriptor, ApiDescription> apiGroups = Model.ToLookup(api => api.ActionDescriptor.ControllerDescriptor);
}
<link type="text/css" href="~/Areas/HelpPage/HelpPage.css" rel="stylesheet" />
<header class="help-page">
<div class="content-wrapper">
<div class="float-left">
<h1>@ViewBag.Title</h1>
</div>
</div>
</header>
<div id="body" class="help-page">
<section class="featured">
<div class="content-wrapper">
<h2>Introduction</h2>
<p>
Provide a general description of your APIs here.
</p>
</div>
</section>
<section class="content-wrapper main-content clear-fix">
@foreach (var group in apiGroups)
{
@Html.DisplayFor(m => group, "ApiGroup")
}
</section>
</div>

View File

@@ -0,0 +1,444 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
using System.Web.Http.Description;
using System.Xml.Linq;
using Newtonsoft.Json;
namespace $rootnamespace$.Areas.HelpPage
{
/// <summary>
/// This class will generate the samples for the help page.
/// </summary>
public class HelpPageSampleGenerator
{
/// <summary>
/// Initializes a new instance of the <see cref="HelpPageSampleGenerator"/> class.
/// </summary>
public HelpPageSampleGenerator()
{
ActualHttpMessageTypes = new Dictionary<HelpPageSampleKey, Type>();
ActionSamples = new Dictionary<HelpPageSampleKey, object>();
SampleObjects = new Dictionary<Type, object>();
SampleObjectFactories = new List<Func<HelpPageSampleGenerator, Type, object>>
{
DefaultSampleObjectFactory,
};
}
/// <summary>
/// Gets CLR types that are used as the content of <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/>.
/// </summary>
public IDictionary<HelpPageSampleKey, Type> ActualHttpMessageTypes { get; internal set; }
/// <summary>
/// Gets the objects that are used directly as samples for certain actions.
/// </summary>
public IDictionary<HelpPageSampleKey, object> ActionSamples { get; internal set; }
/// <summary>
/// Gets the objects that are serialized as samples by the supported formatters.
/// </summary>
public IDictionary<Type, object> SampleObjects { get; internal set; }
/// <summary>
/// Gets factories for the objects that the supported formatters will serialize as samples. Processed in order,
/// stopping when the factory successfully returns a non-<see langref="null"/> object.
/// </summary>
/// <remarks>
/// Collection includes just <see cref="ObjectGenerator.GenerateObject(Type)"/> initially. Use
/// <code>SampleObjectFactories.Insert(0, func)</code> to provide an override and
/// <code>SampleObjectFactories.Add(func)</code> to provide a fallback.</remarks>
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures",
Justification = "This is an appropriate nesting of generic types")]
public IList<Func<HelpPageSampleGenerator, Type, object>> SampleObjectFactories { get; private set; }
/// <summary>
/// Gets the request body samples for a given <see cref="ApiDescription"/>.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <returns>The samples keyed by media type.</returns>
public IDictionary<MediaTypeHeaderValue, object> GetSampleRequests(ApiDescription api)
{
return GetSample(api, SampleDirection.Request);
}
/// <summary>
/// Gets the response body samples for a given <see cref="ApiDescription"/>.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <returns>The samples keyed by media type.</returns>
public IDictionary<MediaTypeHeaderValue, object> GetSampleResponses(ApiDescription api)
{
return GetSample(api, SampleDirection.Response);
}
/// <summary>
/// Gets the request or response body samples.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param>
/// <returns>The samples keyed by media type.</returns>
public virtual IDictionary<MediaTypeHeaderValue, object> GetSample(ApiDescription api, SampleDirection sampleDirection)
{
if (api == null)
{
throw new ArgumentNullException("api");
}
string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName;
string actionName = api.ActionDescriptor.ActionName;
IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name);
Collection<MediaTypeFormatter> formatters;
Type type = ResolveType(api, controllerName, actionName, parameterNames, sampleDirection, out formatters);
var samples = new Dictionary<MediaTypeHeaderValue, object>();
// Use the samples provided directly for actions
var actionSamples = GetAllActionSamples(controllerName, actionName, parameterNames, sampleDirection);
foreach (var actionSample in actionSamples)
{
samples.Add(actionSample.Key.MediaType, WrapSampleIfString(actionSample.Value));
}
// Do the sample generation based on formatters only if an action doesn't return an HttpResponseMessage.
// Here we cannot rely on formatters because we don't know what's in the HttpResponseMessage, it might not even use formatters.
if (type != null && !typeof(HttpResponseMessage).IsAssignableFrom(type))
{
object sampleObject = GetSampleObject(type);
foreach (var formatter in formatters)
{
foreach (MediaTypeHeaderValue mediaType in formatter.SupportedMediaTypes)
{
if (!samples.ContainsKey(mediaType))
{
object sample = GetActionSample(controllerName, actionName, parameterNames, type, formatter, mediaType, sampleDirection);
// If no sample found, try generate sample using formatter and sample object
if (sample == null && sampleObject != null)
{
sample = WriteSampleObjectUsingFormatter(formatter, sampleObject, type, mediaType);
}
samples.Add(mediaType, WrapSampleIfString(sample));
}
}
}
}
return samples;
}
/// <summary>
/// Search for samples that are provided directly through <see cref="ActionSamples"/>.
/// </summary>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
/// <param name="type">The CLR type.</param>
/// <param name="formatter">The formatter.</param>
/// <param name="mediaType">The media type.</param>
/// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param>
/// <returns>The sample that matches the parameters.</returns>
public virtual object GetActionSample(string controllerName, string actionName, IEnumerable<string> parameterNames, Type type, MediaTypeFormatter formatter, MediaTypeHeaderValue mediaType, SampleDirection sampleDirection)
{
object sample;
// First, try to get the sample provided for the specified mediaType, sampleDirection, controllerName, actionName and parameterNames.
// If not found, try to get the sample provided for the specified mediaType, sampleDirection, controllerName and actionName regardless of the parameterNames.
// If still not found, try to get the sample provided for the specified mediaType and type.
// Finally, try to get the sample provided for the specified mediaType.
if (ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, parameterNames), out sample) ||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, new[] { "*" }), out sample) ||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, type), out sample) ||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType), out sample))
{
return sample;
}
return null;
}
/// <summary>
/// Gets the sample object that will be serialized by the formatters.
/// First, it will look at the <see cref="SampleObjects"/>. If no sample object is found, it will try to create
/// one using <see cref="DefaultSampleObjectFactory"/> (which wraps an <see cref="ObjectGenerator"/>) and other
/// factories in <see cref="SampleObjectFactories"/>.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>The sample object.</returns>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
Justification = "Even if all items in SampleObjectFactories throw, problem will be visible as missing sample.")]
public virtual object GetSampleObject(Type type)
{
object sampleObject;
if (!SampleObjects.TryGetValue(type, out sampleObject))
{
// No specific object available, try our factories.
foreach (Func<HelpPageSampleGenerator, Type, object> factory in SampleObjectFactories)
{
if (factory == null)
{
continue;
}
try
{
sampleObject = factory(this, type);
if (sampleObject != null)
{
break;
}
}
catch
{
// Ignore any problems encountered in the factory; go on to the next one (if any).
}
}
}
return sampleObject;
}
/// <summary>
/// Resolves the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <returns>The type.</returns>
public virtual Type ResolveHttpRequestMessageType(ApiDescription api)
{
string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName;
string actionName = api.ActionDescriptor.ActionName;
IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name);
Collection<MediaTypeFormatter> formatters;
return ResolveType(api, controllerName, actionName, parameterNames, SampleDirection.Request, out formatters);
}
/// <summary>
/// Resolves the type of the action parameter or return value when <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/> is used.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
/// <param name="sampleDirection">The value indicating whether the sample is for a request or a response.</param>
/// <param name="formatters">The formatters.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", Justification = "This is only used in advanced scenarios.")]
public virtual Type ResolveType(ApiDescription api, string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection, out Collection<MediaTypeFormatter> formatters)
{
if (!Enum.IsDefined(typeof(SampleDirection), sampleDirection))
{
throw new InvalidEnumArgumentException("sampleDirection", (int)sampleDirection, typeof(SampleDirection));
}
if (api == null)
{
throw new ArgumentNullException("api");
}
Type type;
if (ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, parameterNames), out type) ||
ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, new[] { "*" }), out type))
{
// Re-compute the supported formatters based on type
Collection<MediaTypeFormatter> newFormatters = new Collection<MediaTypeFormatter>();
foreach (var formatter in api.ActionDescriptor.Configuration.Formatters)
{
if (IsFormatSupported(sampleDirection, formatter, type))
{
newFormatters.Add(formatter);
}
}
formatters = newFormatters;
}
else
{
switch (sampleDirection)
{
case SampleDirection.Request:
ApiParameterDescription requestBodyParameter = api.ParameterDescriptions.FirstOrDefault(p => p.Source == ApiParameterSource.FromBody);
type = requestBodyParameter == null ? null : requestBodyParameter.ParameterDescriptor.ParameterType;
formatters = api.SupportedRequestBodyFormatters;
break;
case SampleDirection.Response:
default:
type = api.ResponseDescription.ResponseType ?? api.ResponseDescription.DeclaredType;
formatters = api.SupportedResponseFormatters;
break;
}
}
return type;
}
/// <summary>
/// Writes the sample object using formatter.
/// </summary>
/// <param name="formatter">The formatter.</param>
/// <param name="value">The value.</param>
/// <param name="type">The type.</param>
/// <param name="mediaType">Type of the media.</param>
/// <returns></returns>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as InvalidSample.")]
public virtual object WriteSampleObjectUsingFormatter(MediaTypeFormatter formatter, object value, Type type, MediaTypeHeaderValue mediaType)
{
if (formatter == null)
{
throw new ArgumentNullException("formatter");
}
if (mediaType == null)
{
throw new ArgumentNullException("mediaType");
}
object sample = String.Empty;
MemoryStream ms = null;
HttpContent content = null;
try
{
if (formatter.CanWriteType(type))
{
ms = new MemoryStream();
content = new ObjectContent(type, value, formatter, mediaType);
formatter.WriteToStreamAsync(type, value, ms, content, null).Wait();
ms.Position = 0;
StreamReader reader = new StreamReader(ms);
string serializedSampleString = reader.ReadToEnd();
if (mediaType.MediaType.ToUpperInvariant().Contains("XML"))
{
serializedSampleString = TryFormatXml(serializedSampleString);
}
else if (mediaType.MediaType.ToUpperInvariant().Contains("JSON"))
{
serializedSampleString = TryFormatJson(serializedSampleString);
}
sample = new TextSample(serializedSampleString);
}
else
{
sample = new InvalidSample(String.Format(
CultureInfo.CurrentCulture,
"Failed to generate the sample for media type '{0}'. Cannot use formatter '{1}' to write type '{2}'.",
mediaType,
formatter.GetType().Name,
type.Name));
}
}
catch (Exception e)
{
sample = new InvalidSample(String.Format(
CultureInfo.CurrentCulture,
"An exception has occurred while using the formatter '{0}' to generate sample for media type '{1}'. Exception message: {2}",
formatter.GetType().Name,
mediaType.MediaType,
UnwrapException(e).Message));
}
finally
{
if (ms != null)
{
ms.Dispose();
}
if (content != null)
{
content.Dispose();
}
}
return sample;
}
internal static Exception UnwrapException(Exception exception)
{
AggregateException aggregateException = exception as AggregateException;
if (aggregateException != null)
{
return aggregateException.Flatten().InnerException;
}
return exception;
}
// Default factory for sample objects
private static object DefaultSampleObjectFactory(HelpPageSampleGenerator sampleGenerator, Type type)
{
// Try to create a default sample object
ObjectGenerator objectGenerator = new ObjectGenerator();
return objectGenerator.GenerateObject(type);
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
private static string TryFormatJson(string str)
{
try
{
object parsedJson = JsonConvert.DeserializeObject(str);
return JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
}
catch
{
// can't parse JSON, return the original string
return str;
}
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
private static string TryFormatXml(string str)
{
try
{
XDocument xml = XDocument.Parse(str);
return xml.ToString();
}
catch
{
// can't parse XML, return the original string
return str;
}
}
private static bool IsFormatSupported(SampleDirection sampleDirection, MediaTypeFormatter formatter, Type type)
{
switch (sampleDirection)
{
case SampleDirection.Request:
return formatter.CanReadType(type);
case SampleDirection.Response:
return formatter.CanWriteType(type);
}
return false;
}
private IEnumerable<KeyValuePair<HelpPageSampleKey, object>> GetAllActionSamples(string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection)
{
HashSet<string> parameterNamesSet = new HashSet<string>(parameterNames, StringComparer.OrdinalIgnoreCase);
foreach (var sample in ActionSamples)
{
HelpPageSampleKey sampleKey = sample.Key;
if (String.Equals(controllerName, sampleKey.ControllerName, StringComparison.OrdinalIgnoreCase) &&
String.Equals(actionName, sampleKey.ActionName, StringComparison.OrdinalIgnoreCase) &&
(sampleKey.ParameterNames.SetEquals(new[] { "*" }) || parameterNamesSet.SetEquals(sampleKey.ParameterNames)) &&
sampleDirection == sampleKey.SampleDirection)
{
yield return sample;
}
}
}
private static object WrapSampleIfString(object sample)
{
string stringSample = sample as string;
if (stringSample != null)
{
return new TextSample(stringSample);
}
return sample;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,339 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{749E71B2-D02B-439F-A8D3-623434B7270A}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BLV_API</RootNamespace>
<AssemblyName>BLV_API</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Routing" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http">
</Reference>
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest">
</Reference>
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Optimization">
<HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="WebGrease">
<Private>True</Private>
<HintPath>..\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
</Reference>
<Reference Include="Antlr3.Runtime">
<Private>True</Private>
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="App_Start\BundleConfig.cs" />
<Compile Include="App_Start\FilterConfig.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="App_Start\WebApiConfig.cs" />
<Compile Include="Areas\HelpPage\ApiDescriptionExtensions.cs" />
<Compile Include="Areas\HelpPage\App_Start\HelpPageConfig.cs" />
<Compile Include="Areas\HelpPage\Controllers\HelpController.cs" />
<Compile Include="Areas\HelpPage\HelpPageAreaRegistration.cs" />
<Compile Include="Areas\HelpPage\HelpPageConfigurationExtensions.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\CollectionModelDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\ComplexTypeModelDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\DictionaryModelDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\EnumTypeModelDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\EnumValueDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\IModelDocumentationProvider.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\KeyValuePairModelDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\ModelDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\ModelDescriptionGenerator.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\ModelNameAttribute.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\ModelNameHelper.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\ParameterAnnotation.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\ParameterDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\SimpleTypeModelDescription.cs" />
<Compile Include="Areas\HelpPage\Models\HelpPageApiModel.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\HelpPageSampleGenerator.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\HelpPageSampleKey.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\ImageSample.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\InvalidSample.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\ObjectGenerator.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\SampleDirection.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\TextSample.cs" />
<Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" />
<Compile Include="Connected Services\ServiceReference1\Reference.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Reference.svcmap</DependentUpon>
</Compile>
<Compile Include="Controllers\ApiController.cs" />
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\testController.cs" />
<Compile Include="Controllers\ValuesController.cs" />
<Compile Include="Dal\DbProvider.cs" />
<Compile Include="Dal\SqlHelper.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="LogHelper.cs" />
<Compile Include="Models\CRICSEntity.cs" />
<Compile Include="Models\BaoJingEntity.cs" />
<Compile Include="Models\Luopan2Entity.cs" />
<Compile Include="Models\LuopanEntity.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tools.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Areas\HelpPage\HelpPage.css" />
<Content Include="Connected Services\ServiceReference1\BLV_API.ServiceReference1.ChangePhoneNumberResponse.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</Content>
<Content Include="Connected Services\ServiceReference1\BLV_API.ServiceReference1.CheckIn2Response.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</Content>
<Content Include="Connected Services\ServiceReference1\BLV_API.ServiceReference1.CheckInResponse.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</Content>
<Content Include="Connected Services\ServiceReference1\BLV_API.ServiceReference1.CheckOutResponse.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</Content>
<Content Include="Connected Services\ServiceReference1\BLV_API.ServiceReference1.RentRoomResponse.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</Content>
<Content Include="Connected Services\ServiceReference1\BLV_API.ServiceReference1.UploadPhotoResponse.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</Content>
<None Include="Connected Services\ServiceReference1\blwws.disco" />
<None Include="Connected Services\ServiceReference1\configuration91.svcinfo" />
<None Include="Connected Services\ServiceReference1\configuration.svcinfo" />
<None Include="Connected Services\ServiceReference1\Reference.svcmap">
<Generator>WCF Proxy Generator</Generator>
<LastGenOutput>Reference.cs</LastGenOutput>
</None>
<Content Include="Content\bootstrap-theme.css" />
<Content Include="Content\bootstrap-theme.min.css" />
<Content Include="Content\bootstrap.css" />
<Content Include="Content\bootstrap.min.css" />
<Content Include="favicon.ico" />
<Content Include="fonts\glyphicons-halflings-regular.svg" />
<Content Include="Global.asax" />
<Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" />
<Content Include="Areas\HelpPage\Views\Web.config" />
<Content Include="Areas\HelpPage\Views\Shared\_Layout.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\ResourceModel.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\Index.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\TextSample.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\SimpleTypeModelDescription.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\Samples.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\Parameters.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\ModelDescriptionLink.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\KeyValuePairModelDescription.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\InvalidSample.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\ImageSample.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\HelpPageApiModel.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\EnumTypeModelDescription.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\DictionaryModelDescription.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\ComplexTypeModelDescription.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\CollectionModelDescription.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\ApiGroup.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\Api.cshtml" />
<None Include="Connected Services\ServiceReference1\blwws.wsdl" />
<None Include="Scripts\jquery-3.4.1.intellisense.js" />
<Content Include="Scripts\jquery-3.4.1.js" />
<Content Include="Scripts\jquery-3.4.1.min.js" />
<Content Include="Scripts\jquery-3.4.1.slim.js" />
<Content Include="Scripts\jquery-3.4.1.slim.min.js" />
<Content Include="Scripts\modernizr-2.8.3.js" />
<Content Include="Web.config" />
<Content Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Areas\HelpPage\Views\_ViewStart.cshtml" />
<Content Include="Content\Site.css" />
<Content Include="Views\Web.config" />
<Content Include="Views\_ViewStart.cshtml" />
<Content Include="Views\Home\Index.cshtml" />
<Content Include="Views\Shared\Error.cshtml" />
<Content Include="Views\Shared\_Layout.cshtml" />
<Content Include="Views\Api\Index.cshtml" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="Views\test\" />
</ItemGroup>
<ItemGroup>
<Content Include="fonts\glyphicons-halflings-regular.woff2" />
</ItemGroup>
<ItemGroup>
<Content Include="fonts\glyphicons-halflings-regular.woff" />
</ItemGroup>
<ItemGroup>
<Content Include="fonts\glyphicons-halflings-regular.ttf" />
</ItemGroup>
<ItemGroup>
<Content Include="fonts\glyphicons-halflings-regular.eot" />
</ItemGroup>
<ItemGroup>
<Content Include="Content\bootstrap.min.css.map" />
</ItemGroup>
<ItemGroup>
<Content Include="Content\bootstrap.css.map" />
</ItemGroup>
<ItemGroup>
<Content Include="Content\bootstrap-theme.min.css.map" />
</ItemGroup>
<ItemGroup>
<Content Include="Content\bootstrap-theme.css.map" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<Content Include="Scripts\jquery-3.4.1.slim.min.map" />
<Content Include="Scripts\jquery-3.4.1.min.map" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<WCFMetadataStorage Include="Connected Services\ServiceReference1\" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
</Target>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>58019</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:58019/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target> -->
</Project>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,24 @@
<div class="jumbotron">
<h1>宝来威客控与PMS对接API</h1>
@*<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS, and JavaScript.</p>
<p><a href="https://asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>*@
</div>
@*<div class="row">
<div class="col-md-4">
<h2>Getting started</h2>
<p>ASP.NET Web API is a framework that makes it easy to build HTTP services that reach
a broad range of clients, including browsers and mobile devices. ASP.NET Web API
is an ideal platform for building RESTful applications on the .NET Framework.</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301870">Learn more &raquo;</a></p>
</div>
<div class="col-md-4">
<h2>Get more libraries</h2>
<p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301871">Learn more &raquo;</a></p>
</div>
<div class="col-md-4">
<h2>Web Hosting</h2>
<p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301872">Learn more &raquo;</a></p>
</div>
</div>*@

View File

@@ -0,0 +1,6 @@
@using PTS_API_V1.Areas.HelpPage.ModelDescriptions
@model CollectionModelDescription
@if (Model.ElementDescription is ComplexTypeModelDescription)
{
@Html.DisplayFor(m => m.ElementDescription)
}

View File

@@ -0,0 +1,25 @@
namespace BLV_API.Dal
{
public class DbProvider
{
private static string _SqlConnectionStr = null;
public static string SqlConnectionStr
{
get
{
if (_SqlConnectionStr == null)
{
_SqlConnectionStr = System.Configuration.ConfigurationManager.AppSettings["connectionString"];
}
return _SqlConnectionStr;
}
}
public static SqlHelper SqlServer
{
get
{
return new SqlHelper(SqlConnectionStr);
}
}
}
}

View File

@@ -0,0 +1,11 @@
namespace $rootnamespace$.Areas.HelpPage
{
/// <summary>
/// Indicates whether the sample is used for request or response
/// </summary>
public enum SampleDirection
{
Request = 0,
Response
}
}

View File

@@ -0,0 +1,41 @@
@using System.Web.Http
@using System.Web.Http.Controllers
@using System.Web.Http.Description
@using $rootnamespace$.Areas.HelpPage
@using $rootnamespace$.Areas.HelpPage.Models
@model IGrouping<HttpControllerDescriptor, ApiDescription>
@{
var controllerDocumentation = ViewBag.DocumentationProvider != null ?
ViewBag.DocumentationProvider.GetDocumentation(Model.Key) :
null;
}
<h2 id="@Model.Key.ControllerName">@Model.Key.ControllerName</h2>
@if (!String.IsNullOrEmpty(controllerDocumentation))
{
<p>@controllerDocumentation</p>
}
<table class="help-page-table">
<thead>
<tr><th>API</th><th>Description</th></tr>
</thead>
<tbody>
@foreach (var api in Model)
{
<tr>
<td class="api-name"><a href="@Url.Action("Api", "Help", new { apiId = api.GetFriendlyId() })">@api.HttpMethod.Method @api.RelativePath</a></td>
<td class="api-documentation">
@if (api.Documentation != null)
{
<p>@api.Documentation</p>
}
else
{
<p>No documentation available.</p>
}
</td>
</tr>
}
</tbody>
</table>

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -0,0 +1,99 @@
using BLV_API.Dal;
using BLV_API.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Xml.Linq;
namespace BLV_API.Controllers
{
public class ApiController : Controller
{
public ActionResult Index()
{
ViewBag.Title = "宝来威客控与PMS对接API";
return View();
}
/// <summary>
/// Luopan PMS对接
/// </summary>
/// <returns></returns>
public ActionResult LuopanToBLV()
{
Request.InputStream.Position = 0;
byte[] reqBody = new byte[Request.InputStream.Length];
Request.InputStream.Read(reqBody, 0, reqBody.Length);
string reqData = System.Text.Encoding.UTF8.GetString(reqBody);
if (string.IsNullOrEmpty(reqData))
{
return Json(new LuopanEntity.Result() { status = 1, error_msg = "传递参数不能为空" }, JsonRequestBehavior.AllowGet);
}
LogHelper.WriteLog("收到Luopan请求" + reqData);
try
{
LuopanEntity.Root req = JsonConvert.DeserializeObject<LuopanEntity.Root>(reqData);
ServiceReference1.blwwsSoapClient client = new ServiceReference1.blwwsSoapClient();
string errorMsg = "";
bool blvResult;
StringBuilder xmlString = new StringBuilder();
string phoneNumber = "";
string idNumber = "";
switch (req.Action)
{
case "CheckIn"://入住
if (req.GuestInfo.Count > 0)
{
phoneNumber = req.GuestInfo[0].Mobile;
idNumber = req.GuestInfo[0].IDCardNo;
xmlString.Append("<interface>");
foreach (LuopanEntity.GuestInfo guest in req.GuestInfo)
{
xmlString.Append("<item idtype=\"" + guest.IDCardTypeId + "\" idcard = \"" + guest.IDCardNo + "\" customer = \"" + guest.GuestName + "\" sex =\"" +
(guest.Gender == 0 ? "男" : "女") + "\" country =\"0\" checkindate = \"" + req.CheckInTime.ToString("yyyy-MM-dd HH:mm:ss") + "\"/>");
}
xmlString.Append("</interface>");
}
blvResult = client.CheckIn("blw_ws@2015", req.HotelId, req.RoomNo, req.CheckInTime, xmlString.ToString(), ref errorMsg, phoneNumber, idNumber);
LogHelper.WriteLog($"转发BLV内部开房接口结果{blvResult},消息:{errorMsg}");
break;
case "CheckOut"://退房
blvResult = client.CheckOut("blw_ws@2015", req.HotelId, req.RoomNo, req.CheckOutTime, ref errorMsg);
LogHelper.WriteLog($"转发BLV内部退房接口结果{blvResult},消息:{errorMsg}");
break;
case "MoveRoom"://换房
//先退房
blvResult = client.CheckOut("blw_ws@2015", req.HotelId, req.OldRoomNo, req.MoveTime, ref errorMsg);
LogHelper.WriteLog($"转发BLV内部退房接口结果{blvResult},消息:{errorMsg}");
//再开房
if (req.GuestInfo.Count > 0)
{
phoneNumber = req.GuestInfo[0].Mobile;
idNumber = req.GuestInfo[0].IDCardNo;
xmlString.Append("<interface>");
foreach (LuopanEntity.GuestInfo guest in req.GuestInfo)
{
xmlString.Append("<item idtype=\"" + guest.IDCardTypeId + "\" idcard = \"" + guest.IDCardNo + "\" customer = \"" + guest.GuestName + "\" sex =\"" +
(guest.Gender == 0 ? "男" : "女") + "\" country =\"0\" checkindate = \"" + req.CheckInTime.ToString("yyyy-MM-dd HH:mm:ss") + "\"/>");
}
xmlString.Append("</interface>");
}
blvResult = client.CheckIn("blw_ws@2015", req.HotelId, req.NewRoomNo, req.CheckInTime, xmlString.ToString(), ref errorMsg, phoneNumber, idNumber);
LogHelper.WriteLog($"转发BLV内部开房接口结果{blvResult},消息:{errorMsg}");
break;
case "Extend"://续住
break;
}
return Json(new LuopanEntity.Result() { status = 0, error_msg = "" }, JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
return Json(new LuopanEntity.Result() { status = 1, error_msg = ex.Message }, JsonRequestBehavior.AllowGet);
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,145 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target
Name="CoreCompile"
Inputs="$(MSBuildAllProjects);
@(Compile);
@(_CoreCompileResourceInputs);
$(ApplicationIcon);
$(AssemblyOriginatorKeyFile);
@(ReferencePath);
@(CompiledLicenseFile);
@(LinkResource);
@(EmbeddedDocumentation);
$(Win32Resource);
$(Win32Manifest);
@(CustomAdditionalCompileInputs);
$(ResolvedCodeAnalysisRuleSet)"
Outputs="@(DocFileItem);
@(IntermediateAssembly);
@(_DebugSymbolsIntermediatePath);
$(NonExistentFile);
@(CustomAdditionalCompileOutputs)"
Returns="@(CscCommandLineArgs)"
DependsOnTargets="$(CoreCompileDependsOn)"
>
<!-- These two compiler warnings are raised when a reference is bound to a different version
than specified in the assembly reference version number. MSBuild raises the same warning in this case,
so the compiler warning would be redundant. -->
<PropertyGroup Condition="('$(TargetFrameworkVersion)' != 'v1.0') and ('$(TargetFrameworkVersion)' != 'v1.1')">
<NoWarn>$(NoWarn);1701;1702</NoWarn>
</PropertyGroup>
<PropertyGroup>
<!-- To match historical behavior, when inside VS11+ disable the warning from csc.exe indicating that no sources were passed in-->
<NoWarn Condition=" '$(BuildingInsideVisualStudio)' == 'true' and '$(VisualStudioVersion)' != '' and '$(VisualStudioVersion)' > '10.0' ">$(NoWarn);2008</NoWarn>
</PropertyGroup>
<ItemGroup Condition="'$(TargetingClr2Framework)'=='true'">
<ReferencePath>
<EmbedInteropTypes/>
</ReferencePath>
</ItemGroup>
<PropertyGroup>
<!-- If the user has specified AppConfigForCompiler, we'll use it. If they have not, but they set UseAppConfigForCompiler,
then we'll use AppConfig -->
<AppConfigForCompiler Condition="'$(AppConfigForCompiler)' == '' and '$(UseAppConfigForCompiler)' == 'true'">$(AppConfig)</AppConfigForCompiler>
<!-- If we are targeting winmdobj we want to specifically the pdbFile property since we do not want it to collide with the output of winmdexp-->
<PdbFile Condition="'$(PdbFile)' == '' and '$(OutputType)' == 'winmdobj' and '$(_DebugSymbolsProduced)' == 'true'">$(IntermediateOutputPath)$(TargetName).compile.pdb</PdbFile>
</PropertyGroup>
<!-- Prefer32Bit was introduced in .NET 4.5. Set it to false if we are targeting 4.0 -->
<PropertyGroup Condition="('$(TargetFrameworkVersion)' == 'v4.0')">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup Condition="('$(AdditionalFileItemNames)' != '')">
<AdditionalFileItems Include="$(AdditionalFileItemNames)" />
<AdditionalFiles Include="@(%(AdditionalFileItems.Identity))" />
</ItemGroup>
<PropertyGroup Condition="'$(UseSharedCompilation)' == ''">
<UseSharedCompilation>true</UseSharedCompilation>
</PropertyGroup>
<!-- Condition is to filter out the _CoreCompileResourceInputs so that it doesn't pass in culture resources to the compiler -->
<Csc Condition=" '%(_CoreCompileResourceInputs.WithCulture)' != 'true' "
AdditionalLibPaths="$(AdditionalLibPaths)"
AddModules="@(AddModules)"
AdditionalFiles="@(AdditionalFiles)"
AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
Analyzers="@(Analyzer)"
ApplicationConfiguration="$(AppConfigForCompiler)"
BaseAddress="$(BaseAddress)"
CheckForOverflowUnderflow="$(CheckForOverflowUnderflow)"
ChecksumAlgorithm="$(ChecksumAlgorithm)"
CodeAnalysisRuleSet="$(ResolvedCodeAnalysisRuleSet)"
CodePage="$(CodePage)"
DebugType="$(DebugType)"
DefineConstants="$(DefineConstants)"
DelaySign="$(DelaySign)"
DisabledWarnings="$(NoWarn)"
DocumentationFile="@(DocFileItem)"
EmitDebugInformation="$(DebugSymbols)"
EnvironmentVariables="$(CscEnvironment)"
ErrorEndLocation="$(ErrorEndLocation)"
ErrorLog="$(ErrorLog)"
ErrorReport="$(ErrorReport)"
Features="$(Features)"
FileAlignment="$(FileAlignment)"
GenerateFullPaths="$(GenerateFullPaths)"
HighEntropyVA="$(HighEntropyVA)"
KeyContainer="$(KeyContainerName)"
KeyFile="$(KeyOriginatorFile)"
LangVersion="$(LangVersion)"
LinkResources="@(LinkResource)"
MainEntryPoint="$(StartupObject)"
ModuleAssemblyName="$(ModuleAssemblyName)"
NoConfig="true"
NoLogo="$(NoLogo)"
NoStandardLib="$(NoCompilerStandardLib)"
NoWin32Manifest="$(NoWin32Manifest)"
Optimize="$(Optimize)"
Deterministic="$(Deterministic)"
PublicSign="$(PublicSign)"
OutputAssembly="@(IntermediateAssembly)"
PdbFile="$(PdbFile)"
Platform="$(PlatformTarget)"
Prefer32Bit="$(Prefer32Bit)"
PreferredUILang="$(PreferredUILang)"
ProvideCommandLineArgs="$(ProvideCommandLineArgs)"
References="@(ReferencePath)"
ReportAnalyzer="$(ReportAnalyzer)"
Resources="@(_CoreCompileResourceInputs);@(CompiledLicenseFile)"
ResponseFiles="$(CompilerResponseFile)"
RuntimeMetadataVersion="$(RuntimeMetadataVersion)"
SkipCompilerExecution="$(SkipCompilerExecution)"
Sources="@(Compile)"
SubsystemVersion="$(SubsystemVersion)"
TargetType="$(OutputType)"
ToolExe="$(CscToolExe)"
ToolPath="$(CscToolPath)"
TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
UseHostCompilerIfAvailable="$(UseHostCompilerIfAvailable)"
UseSharedCompilation="$(UseSharedCompilation)"
Utf8Output="$(Utf8Output)"
VsSessionGuid="$(VsSessionGuid)"
WarningLevel="$(WarningLevel)"
WarningsAsErrors="$(WarningsAsErrors)"
WarningsNotAsErrors="$(WarningsNotAsErrors)"
Win32Icon="$(ApplicationIcon)"
Win32Manifest="$(Win32Manifest)"
Win32Resource="$(Win32Resource)"
PathMap="$(PathMap)"
>
<Output TaskParameter="CommandLineArgs" ItemName="CscCommandLineArgs" />
</Csc>
<ItemGroup>
<_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" />
</ItemGroup>
<CallTarget Targets="$(TargetsTriggeredByCompilation)" Condition="'$(TargetsTriggeredByCompilation)' != ''"/>
</Target>
</Project>

View File

@@ -0,0 +1,12 @@
using System;
using System.Reflection;
namespace PTS_API_V1.Areas.HelpPage.ModelDescriptions
{
public interface IModelDocumentationProvider
{
string GetDocumentation(MemberInfo member);
string GetDocumentation(Type type);
}
}

View File

@@ -0,0 +1,6 @@
namespace PTS_API_V1.Areas.HelpPage.ModelDescriptions
{
public class SimpleTypeModelDescription : ModelDescription
{
}
}

View File

@@ -0,0 +1,16 @@
using System;
namespace $rootnamespace$.Areas.HelpPage.ModelDescriptions
{
/// <summary>
/// Describes a type model.
/// </summary>
public abstract class ModelDescription
{
public string Documentation { get; set; }
public Type ModelType { get; set; }
public string Name { get; set; }
}
}

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using Web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=301874 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
在下例中“SetAttributes”转换将更改
“connectionString”的值仅在“Match”定位器找到值为“MyDB”的
特性“name”时使用“ReleaseSQLServer”。
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
在以下示例中,"Replace" 转换将替换 Web.config 文件的
整个 <customErrors> 节。
请注意,由于在 <system.web> 节点下只有一个
customErrors 节,因此无需使用 "xdt:Locator" 属性。
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>

View File

@@ -0,0 +1,293 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{749E71B2-D02B-439F-A8D3-623434B7270A}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BLV_API</RootNamespace>
<AssemblyName>BLV_API</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Routing" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http">
</Reference>
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest">
</Reference>
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Optimization">
<HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="WebGrease">
<Private>True</Private>
<HintPath>..\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
</Reference>
<Reference Include="Antlr3.Runtime">
<Private>True</Private>
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="App_Start\BundleConfig.cs" />
<Compile Include="App_Start\FilterConfig.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="App_Start\WebApiConfig.cs" />
<Compile Include="Areas\HelpPage\ApiDescriptionExtensions.cs" />
<Compile Include="Areas\HelpPage\App_Start\HelpPageConfig.cs" />
<Compile Include="Areas\HelpPage\Controllers\HelpController.cs" />
<Compile Include="Areas\HelpPage\HelpPageAreaRegistration.cs" />
<Compile Include="Areas\HelpPage\HelpPageConfigurationExtensions.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\CollectionModelDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\ComplexTypeModelDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\DictionaryModelDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\EnumTypeModelDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\EnumValueDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\IModelDocumentationProvider.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\KeyValuePairModelDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\ModelDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\ModelDescriptionGenerator.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\ModelNameAttribute.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\ModelNameHelper.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\ParameterAnnotation.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\ParameterDescription.cs" />
<Compile Include="Areas\HelpPage\ModelDescriptions\SimpleTypeModelDescription.cs" />
<Compile Include="Areas\HelpPage\Models\HelpPageApiModel.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\HelpPageSampleGenerator.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\HelpPageSampleKey.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\ImageSample.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\InvalidSample.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\ObjectGenerator.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\SampleDirection.cs" />
<Compile Include="Areas\HelpPage\SampleGeneration\TextSample.cs" />
<Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" />
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\ValuesController.cs" />
<Compile Include="Dal\DbProvider.cs" />
<Compile Include="Dal\SqlHelper.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tools.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Areas\HelpPage\HelpPage.css" />
<Content Include="Content\bootstrap-theme.css" />
<Content Include="Content\bootstrap-theme.min.css" />
<Content Include="Content\bootstrap.css" />
<Content Include="Content\bootstrap.min.css" />
<Content Include="favicon.ico" />
<Content Include="fonts\glyphicons-halflings-regular.svg" />
<Content Include="Global.asax" />
<Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" />
<Content Include="Areas\HelpPage\Views\Web.config" />
<Content Include="Areas\HelpPage\Views\Shared\_Layout.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\ResourceModel.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\Index.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\TextSample.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\SimpleTypeModelDescription.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\Samples.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\Parameters.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\ModelDescriptionLink.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\KeyValuePairModelDescription.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\InvalidSample.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\ImageSample.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\HelpPageApiModel.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\EnumTypeModelDescription.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\DictionaryModelDescription.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\ComplexTypeModelDescription.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\CollectionModelDescription.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\DisplayTemplates\ApiGroup.cshtml" />
<Content Include="Areas\HelpPage\Views\Help\Api.cshtml" />
<None Include="Scripts\jquery-3.4.1.intellisense.js" />
<Content Include="Scripts\jquery-3.4.1.js" />
<Content Include="Scripts\jquery-3.4.1.min.js" />
<Content Include="Scripts\jquery-3.4.1.slim.js" />
<Content Include="Scripts\jquery-3.4.1.slim.min.js" />
<Content Include="Scripts\modernizr-2.8.3.js" />
<Content Include="Web.config" />
<Content Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
<Content Include="Areas\HelpPage\Views\_ViewStart.cshtml" />
<Content Include="Content\Site.css" />
<Content Include="Views\Web.config" />
<Content Include="Views\_ViewStart.cshtml" />
<Content Include="Views\Home\Index.cshtml" />
<Content Include="Views\Shared\Error.cshtml" />
<Content Include="Views\Shared\_Layout.cshtml" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="Models\" />
</ItemGroup>
<ItemGroup>
<Content Include="fonts\glyphicons-halflings-regular.woff2" />
</ItemGroup>
<ItemGroup>
<Content Include="fonts\glyphicons-halflings-regular.woff" />
</ItemGroup>
<ItemGroup>
<Content Include="fonts\glyphicons-halflings-regular.ttf" />
</ItemGroup>
<ItemGroup>
<Content Include="fonts\glyphicons-halflings-regular.eot" />
</ItemGroup>
<ItemGroup>
<Content Include="Content\bootstrap.min.css.map" />
</ItemGroup>
<ItemGroup>
<Content Include="Content\bootstrap.css.map" />
</ItemGroup>
<ItemGroup>
<Content Include="Content\bootstrap-theme.min.css.map" />
</ItemGroup>
<ItemGroup>
<Content Include="Content\bootstrap-theme.css.map" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<Content Include="Scripts\jquery-3.4.1.slim.min.map" />
<Content Include="Scripts\jquery-3.4.1.min.map" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
</Target>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>58019</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:58019/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target> -->
</Project>

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace BLV_API
{
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}

View File

@@ -0,0 +1,4 @@
@using PTS_API_V1.Areas.HelpPage
@model ImageSample
<img src="@Model.Src" />

View File

@@ -0,0 +1,456 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Reflection;
namespace PTS_API_V1.Areas.HelpPage
{
/// <summary>
/// This class will create an object of a given type and populate it with sample data.
/// </summary>
public class ObjectGenerator
{
internal const int DefaultCollectionSize = 2;
private readonly SimpleTypeObjectGenerator SimpleObjectGenerator = new SimpleTypeObjectGenerator();
/// <summary>
/// Generates an object for a given type. The type needs to be public, have a public default constructor and settable public properties/fields. Currently it supports the following types:
/// Simple types: <see cref="int"/>, <see cref="string"/>, <see cref="Enum"/>, <see cref="DateTime"/>, <see cref="Uri"/>, etc.
/// Complex types: POCO types.
/// Nullables: <see cref="Nullable{T}"/>.
/// Arrays: arrays of simple types or complex types.
/// Key value pairs: <see cref="KeyValuePair{TKey,TValue}"/>
/// Tuples: <see cref="Tuple{T1}"/>, <see cref="Tuple{T1,T2}"/>, etc
/// Dictionaries: <see cref="IDictionary{TKey,TValue}"/> or anything deriving from <see cref="IDictionary{TKey,TValue}"/>.
/// Collections: <see cref="IList{T}"/>, <see cref="IEnumerable{T}"/>, <see cref="ICollection{T}"/>, <see cref="IList"/>, <see cref="IEnumerable"/>, <see cref="ICollection"/> or anything deriving from <see cref="ICollection{T}"/> or <see cref="IList"/>.
/// Queryables: <see cref="IQueryable"/>, <see cref="IQueryable{T}"/>.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>An object of the given type.</returns>
public object GenerateObject(Type type)
{
return GenerateObject(type, new Dictionary<Type, object>());
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Here we just want to return null if anything goes wrong.")]
private object GenerateObject(Type type, Dictionary<Type, object> createdObjectReferences)
{
try
{
if (SimpleTypeObjectGenerator.CanGenerateObject(type))
{
return SimpleObjectGenerator.GenerateObject(type);
}
if (type.IsArray)
{
return GenerateArray(type, DefaultCollectionSize, createdObjectReferences);
}
if (type.IsGenericType)
{
return GenerateGenericType(type, DefaultCollectionSize, createdObjectReferences);
}
if (type == typeof(IDictionary))
{
return GenerateDictionary(typeof(Hashtable), DefaultCollectionSize, createdObjectReferences);
}
if (typeof(IDictionary).IsAssignableFrom(type))
{
return GenerateDictionary(type, DefaultCollectionSize, createdObjectReferences);
}
if (type == typeof(IList) ||
type == typeof(IEnumerable) ||
type == typeof(ICollection))
{
return GenerateCollection(typeof(ArrayList), DefaultCollectionSize, createdObjectReferences);
}
if (typeof(IList).IsAssignableFrom(type))
{
return GenerateCollection(type, DefaultCollectionSize, createdObjectReferences);
}
if (type == typeof(IQueryable))
{
return GenerateQueryable(type, DefaultCollectionSize, createdObjectReferences);
}
if (type.IsEnum)
{
return GenerateEnum(type);
}
if (type.IsPublic || type.IsNestedPublic)
{
return GenerateComplexObject(type, createdObjectReferences);
}
}
catch
{
// Returns null if anything fails
return null;
}
return null;
}
private static object GenerateGenericType(Type type, int collectionSize, Dictionary<Type, object> createdObjectReferences)
{
Type genericTypeDefinition = type.GetGenericTypeDefinition();
if (genericTypeDefinition == typeof(Nullable<>))
{
return GenerateNullable(type, createdObjectReferences);
}
if (genericTypeDefinition == typeof(KeyValuePair<,>))
{
return GenerateKeyValuePair(type, createdObjectReferences);
}
if (IsTuple(genericTypeDefinition))
{
return GenerateTuple(type, createdObjectReferences);
}
Type[] genericArguments = type.GetGenericArguments();
if (genericArguments.Length == 1)
{
if (genericTypeDefinition == typeof(IList<>) ||
genericTypeDefinition == typeof(IEnumerable<>) ||
genericTypeDefinition == typeof(ICollection<>))
{
Type collectionType = typeof(List<>).MakeGenericType(genericArguments);
return GenerateCollection(collectionType, collectionSize, createdObjectReferences);
}
if (genericTypeDefinition == typeof(IQueryable<>))
{
return GenerateQueryable(type, collectionSize, createdObjectReferences);
}
Type closedCollectionType = typeof(ICollection<>).MakeGenericType(genericArguments[0]);
if (closedCollectionType.IsAssignableFrom(type))
{
return GenerateCollection(type, collectionSize, createdObjectReferences);
}
}
if (genericArguments.Length == 2)
{
if (genericTypeDefinition == typeof(IDictionary<,>))
{
Type dictionaryType = typeof(Dictionary<,>).MakeGenericType(genericArguments);
return GenerateDictionary(dictionaryType, collectionSize, createdObjectReferences);
}
Type closedDictionaryType = typeof(IDictionary<,>).MakeGenericType(genericArguments[0], genericArguments[1]);
if (closedDictionaryType.IsAssignableFrom(type))
{
return GenerateDictionary(type, collectionSize, createdObjectReferences);
}
}
if (type.IsPublic || type.IsNestedPublic)
{
return GenerateComplexObject(type, createdObjectReferences);
}
return null;
}
private static object GenerateTuple(Type type, Dictionary<Type, object> createdObjectReferences)
{
Type[] genericArgs = type.GetGenericArguments();
object[] parameterValues = new object[genericArgs.Length];
bool failedToCreateTuple = true;
ObjectGenerator objectGenerator = new ObjectGenerator();
for (int i = 0; i < genericArgs.Length; i++)
{
parameterValues[i] = objectGenerator.GenerateObject(genericArgs[i], createdObjectReferences);
failedToCreateTuple &= parameterValues[i] == null;
}
if (failedToCreateTuple)
{
return null;
}
object result = Activator.CreateInstance(type, parameterValues);
return result;
}
private static bool IsTuple(Type genericTypeDefinition)
{
return genericTypeDefinition == typeof(Tuple<>) ||
genericTypeDefinition == typeof(Tuple<,>) ||
genericTypeDefinition == typeof(Tuple<,,>) ||
genericTypeDefinition == typeof(Tuple<,,,>) ||
genericTypeDefinition == typeof(Tuple<,,,,>) ||
genericTypeDefinition == typeof(Tuple<,,,,,>) ||
genericTypeDefinition == typeof(Tuple<,,,,,,>) ||
genericTypeDefinition == typeof(Tuple<,,,,,,,>);
}
private static object GenerateKeyValuePair(Type keyValuePairType, Dictionary<Type, object> createdObjectReferences)
{
Type[] genericArgs = keyValuePairType.GetGenericArguments();
Type typeK = genericArgs[0];
Type typeV = genericArgs[1];
ObjectGenerator objectGenerator = new ObjectGenerator();
object keyObject = objectGenerator.GenerateObject(typeK, createdObjectReferences);
object valueObject = objectGenerator.GenerateObject(typeV, createdObjectReferences);
if (keyObject == null && valueObject == null)
{
// Failed to create key and values
return null;
}
object result = Activator.CreateInstance(keyValuePairType, keyObject, valueObject);
return result;
}
private static object GenerateArray(Type arrayType, int size, Dictionary<Type, object> createdObjectReferences)
{
Type type = arrayType.GetElementType();
Array result = Array.CreateInstance(type, size);
bool areAllElementsNull = true;
ObjectGenerator objectGenerator = new ObjectGenerator();
for (int i = 0; i < size; i++)
{
object element = objectGenerator.GenerateObject(type, createdObjectReferences);
result.SetValue(element, i);
areAllElementsNull &= element == null;
}
if (areAllElementsNull)
{
return null;
}
return result;
}
private static object GenerateDictionary(Type dictionaryType, int size, Dictionary<Type, object> createdObjectReferences)
{
Type typeK = typeof(object);
Type typeV = typeof(object);
if (dictionaryType.IsGenericType)
{
Type[] genericArgs = dictionaryType.GetGenericArguments();
typeK = genericArgs[0];
typeV = genericArgs[1];
}
object result = Activator.CreateInstance(dictionaryType);
MethodInfo addMethod = dictionaryType.GetMethod("Add") ?? dictionaryType.GetMethod("TryAdd");
MethodInfo containsMethod = dictionaryType.GetMethod("Contains") ?? dictionaryType.GetMethod("ContainsKey");
ObjectGenerator objectGenerator = new ObjectGenerator();
for (int i = 0; i < size; i++)
{
object newKey = objectGenerator.GenerateObject(typeK, createdObjectReferences);
if (newKey == null)
{
// Cannot generate a valid key
return null;
}
bool containsKey = (bool)containsMethod.Invoke(result, new object[] { newKey });
if (!containsKey)
{
object newValue = objectGenerator.GenerateObject(typeV, createdObjectReferences);
addMethod.Invoke(result, new object[] { newKey, newValue });
}
}
return result;
}
private static object GenerateEnum(Type enumType)
{
Array possibleValues = Enum.GetValues(enumType);
if (possibleValues.Length > 0)
{
return possibleValues.GetValue(0);
}
return null;
}
private static object GenerateQueryable(Type queryableType, int size, Dictionary<Type, object> createdObjectReferences)
{
bool isGeneric = queryableType.IsGenericType;
object list;
if (isGeneric)
{
Type listType = typeof(List<>).MakeGenericType(queryableType.GetGenericArguments());
list = GenerateCollection(listType, size, createdObjectReferences);
}
else
{
list = GenerateArray(typeof(object[]), size, createdObjectReferences);
}
if (list == null)
{
return null;
}
if (isGeneric)
{
Type argumentType = typeof(IEnumerable<>).MakeGenericType(queryableType.GetGenericArguments());
MethodInfo asQueryableMethod = typeof(Queryable).GetMethod("AsQueryable", new[] { argumentType });
return asQueryableMethod.Invoke(null, new[] { list });
}
return Queryable.AsQueryable((IEnumerable)list);
}
private static object GenerateCollection(Type collectionType, int size, Dictionary<Type, object> createdObjectReferences)
{
Type type = collectionType.IsGenericType ?
collectionType.GetGenericArguments()[0] :
typeof(object);
object result = Activator.CreateInstance(collectionType);
MethodInfo addMethod = collectionType.GetMethod("Add");
bool areAllElementsNull = true;
ObjectGenerator objectGenerator = new ObjectGenerator();
for (int i = 0; i < size; i++)
{
object element = objectGenerator.GenerateObject(type, createdObjectReferences);
addMethod.Invoke(result, new object[] { element });
areAllElementsNull &= element == null;
}
if (areAllElementsNull)
{
return null;
}
return result;
}
private static object GenerateNullable(Type nullableType, Dictionary<Type, object> createdObjectReferences)
{
Type type = nullableType.GetGenericArguments()[0];
ObjectGenerator objectGenerator = new ObjectGenerator();
return objectGenerator.GenerateObject(type, createdObjectReferences);
}
private static object GenerateComplexObject(Type type, Dictionary<Type, object> createdObjectReferences)
{
object result = null;
if (createdObjectReferences.TryGetValue(type, out result))
{
// The object has been created already, just return it. This will handle the circular reference case.
return result;
}
if (type.IsValueType)
{
result = Activator.CreateInstance(type);
}
else
{
ConstructorInfo defaultCtor = type.GetConstructor(Type.EmptyTypes);
if (defaultCtor == null)
{
// Cannot instantiate the type because it doesn't have a default constructor
return null;
}
result = defaultCtor.Invoke(new object[0]);
}
createdObjectReferences.Add(type, result);
SetPublicProperties(type, result, createdObjectReferences);
SetPublicFields(type, result, createdObjectReferences);
return result;
}
private static void SetPublicProperties(Type type, object obj, Dictionary<Type, object> createdObjectReferences)
{
PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
ObjectGenerator objectGenerator = new ObjectGenerator();
foreach (PropertyInfo property in properties)
{
if (property.CanWrite)
{
object propertyValue = objectGenerator.GenerateObject(property.PropertyType, createdObjectReferences);
property.SetValue(obj, propertyValue, null);
}
}
}
private static void SetPublicFields(Type type, object obj, Dictionary<Type, object> createdObjectReferences)
{
FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.Instance);
ObjectGenerator objectGenerator = new ObjectGenerator();
foreach (FieldInfo field in fields)
{
object fieldValue = objectGenerator.GenerateObject(field.FieldType, createdObjectReferences);
field.SetValue(obj, fieldValue);
}
}
private class SimpleTypeObjectGenerator
{
private long _index = 0;
private static readonly Dictionary<Type, Func<long, object>> DefaultGenerators = InitializeGenerators();
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These are simple type factories and cannot be split up.")]
private static Dictionary<Type, Func<long, object>> InitializeGenerators()
{
return new Dictionary<Type, Func<long, object>>
{
{ typeof(Boolean), index => true },
{ typeof(Byte), index => (Byte)64 },
{ typeof(Char), index => (Char)65 },
{ typeof(DateTime), index => DateTime.Now },
{ typeof(DateTimeOffset), index => new DateTimeOffset(DateTime.Now) },
{ typeof(DBNull), index => DBNull.Value },
{ typeof(Decimal), index => (Decimal)index },
{ typeof(Double), index => (Double)(index + 0.1) },
{ typeof(Guid), index => Guid.NewGuid() },
{ typeof(Int16), index => (Int16)(index % Int16.MaxValue) },
{ typeof(Int32), index => (Int32)(index % Int32.MaxValue) },
{ typeof(Int64), index => (Int64)index },
{ typeof(Object), index => new object() },
{ typeof(SByte), index => (SByte)64 },
{ typeof(Single), index => (Single)(index + 0.1) },
{
typeof(String), index =>
{
return String.Format(CultureInfo.CurrentCulture, "sample string {0}", index);
}
},
{
typeof(TimeSpan), index =>
{
return TimeSpan.FromTicks(1234567);
}
},
{ typeof(UInt16), index => (UInt16)(index % UInt16.MaxValue) },
{ typeof(UInt32), index => (UInt32)(index % UInt32.MaxValue) },
{ typeof(UInt64), index => (UInt64)index },
{
typeof(Uri), index =>
{
return new Uri(String.Format(CultureInfo.CurrentCulture, "http://webapihelppage{0}.com", index));
}
},
};
}
public static bool CanGenerateObject(Type type)
{
return DefaultGenerators.ContainsKey(type);
}
public object GenerateObject(Type type)
{
return DefaultGenerators[type](++_index);
}
}
}
}

View File

@@ -0,0 +1,467 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Description;
using $rootnamespace$.Areas.HelpPage.ModelDescriptions;
using $rootnamespace$.Areas.HelpPage.Models;
namespace $rootnamespace$.Areas.HelpPage
{
public static class HelpPageConfigurationExtensions
{
private const string ApiModelPrefix = "MS_HelpPageApiModel_";
/// <summary>
/// Sets the documentation provider for help page.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="documentationProvider">The documentation provider.</param>
public static void SetDocumentationProvider(this HttpConfiguration config, IDocumentationProvider documentationProvider)
{
config.Services.Replace(typeof(IDocumentationProvider), documentationProvider);
}
/// <summary>
/// Sets the objects that will be used by the formatters to produce sample requests/responses.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sampleObjects">The sample objects.</param>
public static void SetSampleObjects(this HttpConfiguration config, IDictionary<Type, object> sampleObjects)
{
config.GetHelpPageSampleGenerator().SampleObjects = sampleObjects;
}
/// <summary>
/// Sets the sample request directly for the specified media type and action.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sample">The sample request.</param>
/// <param name="mediaType">The media type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
public static void SetSampleRequest(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName)
{
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Request, controllerName, actionName, new[] { "*" }), sample);
}
/// <summary>
/// Sets the sample request directly for the specified media type and action with parameters.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sample">The sample request.</param>
/// <param name="mediaType">The media type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
public static void SetSampleRequest(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName, params string[] parameterNames)
{
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Request, controllerName, actionName, parameterNames), sample);
}
/// <summary>
/// Sets the sample request directly for the specified media type of the action.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sample">The sample response.</param>
/// <param name="mediaType">The media type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
public static void SetSampleResponse(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName)
{
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Response, controllerName, actionName, new[] { "*" }), sample);
}
/// <summary>
/// Sets the sample response directly for the specified media type of the action with specific parameters.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sample">The sample response.</param>
/// <param name="mediaType">The media type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
public static void SetSampleResponse(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, string controllerName, string actionName, params string[] parameterNames)
{
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, SampleDirection.Response, controllerName, actionName, parameterNames), sample);
}
/// <summary>
/// Sets the sample directly for all actions with the specified media type.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sample">The sample.</param>
/// <param name="mediaType">The media type.</param>
public static void SetSampleForMediaType(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType)
{
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType), sample);
}
/// <summary>
/// Sets the sample directly for all actions with the specified type and media type.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sample">The sample.</param>
/// <param name="mediaType">The media type.</param>
/// <param name="type">The parameter type or return type of an action.</param>
public static void SetSampleForType(this HttpConfiguration config, object sample, MediaTypeHeaderValue mediaType, Type type)
{
config.GetHelpPageSampleGenerator().ActionSamples.Add(new HelpPageSampleKey(mediaType, type), sample);
}
/// <summary>
/// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
/// The help page will use this information to produce more accurate request samples.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="type">The type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
public static void SetActualRequestType(this HttpConfiguration config, Type type, string controllerName, string actionName)
{
config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Request, controllerName, actionName, new[] { "*" }), type);
}
/// <summary>
/// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
/// The help page will use this information to produce more accurate request samples.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="type">The type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
public static void SetActualRequestType(this HttpConfiguration config, Type type, string controllerName, string actionName, params string[] parameterNames)
{
config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Request, controllerName, actionName, parameterNames), type);
}
/// <summary>
/// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> returned as part of the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
/// The help page will use this information to produce more accurate response samples.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="type">The type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
public static void SetActualResponseType(this HttpConfiguration config, Type type, string controllerName, string actionName)
{
config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Response, controllerName, actionName, new[] { "*" }), type);
}
/// <summary>
/// Specifies the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> returned as part of the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
/// The help page will use this information to produce more accurate response samples.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="type">The type.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
public static void SetActualResponseType(this HttpConfiguration config, Type type, string controllerName, string actionName, params string[] parameterNames)
{
config.GetHelpPageSampleGenerator().ActualHttpMessageTypes.Add(new HelpPageSampleKey(SampleDirection.Response, controllerName, actionName, parameterNames), type);
}
/// <summary>
/// Gets the help page sample generator.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <returns>The help page sample generator.</returns>
public static HelpPageSampleGenerator GetHelpPageSampleGenerator(this HttpConfiguration config)
{
return (HelpPageSampleGenerator)config.Properties.GetOrAdd(
typeof(HelpPageSampleGenerator),
k => new HelpPageSampleGenerator());
}
/// <summary>
/// Sets the help page sample generator.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="sampleGenerator">The help page sample generator.</param>
public static void SetHelpPageSampleGenerator(this HttpConfiguration config, HelpPageSampleGenerator sampleGenerator)
{
config.Properties.AddOrUpdate(
typeof(HelpPageSampleGenerator),
k => sampleGenerator,
(k, o) => sampleGenerator);
}
/// <summary>
/// Gets the model description generator.
/// </summary>
/// <param name="config">The configuration.</param>
/// <returns>The <see cref="ModelDescriptionGenerator"/></returns>
public static ModelDescriptionGenerator GetModelDescriptionGenerator(this HttpConfiguration config)
{
return (ModelDescriptionGenerator)config.Properties.GetOrAdd(
typeof(ModelDescriptionGenerator),
k => InitializeModelDescriptionGenerator(config));
}
/// <summary>
/// Gets the model that represents an API displayed on the help page. The model is initialized on the first call and cached for subsequent calls.
/// </summary>
/// <param name="config">The <see cref="HttpConfiguration"/>.</param>
/// <param name="apiDescriptionId">The <see cref="ApiDescription"/> ID.</param>
/// <returns>
/// An <see cref="HelpPageApiModel"/>
/// </returns>
public static HelpPageApiModel GetHelpPageApiModel(this HttpConfiguration config, string apiDescriptionId)
{
object model;
string modelId = ApiModelPrefix + apiDescriptionId;
if (!config.Properties.TryGetValue(modelId, out model))
{
Collection<ApiDescription> apiDescriptions = config.Services.GetApiExplorer().ApiDescriptions;
ApiDescription apiDescription = apiDescriptions.FirstOrDefault(api => String.Equals(api.GetFriendlyId(), apiDescriptionId, StringComparison.OrdinalIgnoreCase));
if (apiDescription != null)
{
model = GenerateApiModel(apiDescription, config);
config.Properties.TryAdd(modelId, model);
}
}
return (HelpPageApiModel)model;
}
private static HelpPageApiModel GenerateApiModel(ApiDescription apiDescription, HttpConfiguration config)
{
HelpPageApiModel apiModel = new HelpPageApiModel()
{
ApiDescription = apiDescription,
};
ModelDescriptionGenerator modelGenerator = config.GetModelDescriptionGenerator();
HelpPageSampleGenerator sampleGenerator = config.GetHelpPageSampleGenerator();
GenerateUriParameters(apiModel, modelGenerator);
GenerateRequestModelDescription(apiModel, modelGenerator, sampleGenerator);
GenerateResourceDescription(apiModel, modelGenerator);
GenerateSamples(apiModel, sampleGenerator);
return apiModel;
}
private static void GenerateUriParameters(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator)
{
ApiDescription apiDescription = apiModel.ApiDescription;
foreach (ApiParameterDescription apiParameter in apiDescription.ParameterDescriptions)
{
if (apiParameter.Source == ApiParameterSource.FromUri)
{
HttpParameterDescriptor parameterDescriptor = apiParameter.ParameterDescriptor;
Type parameterType = null;
ModelDescription typeDescription = null;
ComplexTypeModelDescription complexTypeDescription = null;
if (parameterDescriptor != null)
{
parameterType = parameterDescriptor.ParameterType;
typeDescription = modelGenerator.GetOrCreateModelDescription(parameterType);
complexTypeDescription = typeDescription as ComplexTypeModelDescription;
}
// Example:
// [TypeConverter(typeof(PointConverter))]
// public class Point
// {
// public Point(int x, int y)
// {
// X = x;
// Y = y;
// }
// public int X { get; set; }
// public int Y { get; set; }
// }
// Class Point is bindable with a TypeConverter, so Point will be added to UriParameters collection.
//
// public class Point
// {
// public int X { get; set; }
// public int Y { get; set; }
// }
// Regular complex class Point will have properties X and Y added to UriParameters collection.
if (complexTypeDescription != null
&& !IsBindableWithTypeConverter(parameterType))
{
foreach (ParameterDescription uriParameter in complexTypeDescription.Properties)
{
apiModel.UriParameters.Add(uriParameter);
}
}
else if (parameterDescriptor != null)
{
ParameterDescription uriParameter =
AddParameterDescription(apiModel, apiParameter, typeDescription);
if (!parameterDescriptor.IsOptional)
{
uriParameter.Annotations.Add(new ParameterAnnotation() { Documentation = "Required" });
}
object defaultValue = parameterDescriptor.DefaultValue;
if (defaultValue != null)
{
uriParameter.Annotations.Add(new ParameterAnnotation() { Documentation = "Default value is " + Convert.ToString(defaultValue, CultureInfo.InvariantCulture) });
}
}
else
{
Debug.Assert(parameterDescriptor == null);
// If parameterDescriptor is null, this is an undeclared route parameter which only occurs
// when source is FromUri. Ignored in request model and among resource parameters but listed
// as a simple string here.
ModelDescription modelDescription = modelGenerator.GetOrCreateModelDescription(typeof(string));
AddParameterDescription(apiModel, apiParameter, modelDescription);
}
}
}
}
private static bool IsBindableWithTypeConverter(Type parameterType)
{
if (parameterType == null)
{
return false;
}
return TypeDescriptor.GetConverter(parameterType).CanConvertFrom(typeof(string));
}
private static ParameterDescription AddParameterDescription(HelpPageApiModel apiModel,
ApiParameterDescription apiParameter, ModelDescription typeDescription)
{
ParameterDescription parameterDescription = new ParameterDescription
{
Name = apiParameter.Name,
Documentation = apiParameter.Documentation,
TypeDescription = typeDescription,
};
apiModel.UriParameters.Add(parameterDescription);
return parameterDescription;
}
private static void GenerateRequestModelDescription(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator, HelpPageSampleGenerator sampleGenerator)
{
ApiDescription apiDescription = apiModel.ApiDescription;
foreach (ApiParameterDescription apiParameter in apiDescription.ParameterDescriptions)
{
if (apiParameter.Source == ApiParameterSource.FromBody)
{
Type parameterType = apiParameter.ParameterDescriptor.ParameterType;
apiModel.RequestModelDescription = modelGenerator.GetOrCreateModelDescription(parameterType);
apiModel.RequestDocumentation = apiParameter.Documentation;
}
else if (apiParameter.ParameterDescriptor != null &&
apiParameter.ParameterDescriptor.ParameterType == typeof(HttpRequestMessage))
{
Type parameterType = sampleGenerator.ResolveHttpRequestMessageType(apiDescription);
if (parameterType != null)
{
apiModel.RequestModelDescription = modelGenerator.GetOrCreateModelDescription(parameterType);
}
}
}
}
private static void GenerateResourceDescription(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator)
{
ResponseDescription response = apiModel.ApiDescription.ResponseDescription;
Type responseType = response.ResponseType ?? response.DeclaredType;
if (responseType != null && responseType != typeof(void))
{
apiModel.ResourceDescription = modelGenerator.GetOrCreateModelDescription(responseType);
}
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as ErrorMessages.")]
private static void GenerateSamples(HelpPageApiModel apiModel, HelpPageSampleGenerator sampleGenerator)
{
try
{
foreach (var item in sampleGenerator.GetSampleRequests(apiModel.ApiDescription))
{
apiModel.SampleRequests.Add(item.Key, item.Value);
LogInvalidSampleAsError(apiModel, item.Value);
}
foreach (var item in sampleGenerator.GetSampleResponses(apiModel.ApiDescription))
{
apiModel.SampleResponses.Add(item.Key, item.Value);
LogInvalidSampleAsError(apiModel, item.Value);
}
}
catch (Exception e)
{
apiModel.ErrorMessages.Add(String.Format(CultureInfo.CurrentCulture,
"An exception has occurred while generating the sample. Exception message: {0}",
HelpPageSampleGenerator.UnwrapException(e).Message));
}
}
private static bool TryGetResourceParameter(ApiDescription apiDescription, HttpConfiguration config, out ApiParameterDescription parameterDescription, out Type resourceType)
{
parameterDescription = apiDescription.ParameterDescriptions.FirstOrDefault(
p => p.Source == ApiParameterSource.FromBody ||
(p.ParameterDescriptor != null && p.ParameterDescriptor.ParameterType == typeof(HttpRequestMessage)));
if (parameterDescription == null)
{
resourceType = null;
return false;
}
resourceType = parameterDescription.ParameterDescriptor.ParameterType;
if (resourceType == typeof(HttpRequestMessage))
{
HelpPageSampleGenerator sampleGenerator = config.GetHelpPageSampleGenerator();
resourceType = sampleGenerator.ResolveHttpRequestMessageType(apiDescription);
}
if (resourceType == null)
{
parameterDescription = null;
return false;
}
return true;
}
private static ModelDescriptionGenerator InitializeModelDescriptionGenerator(HttpConfiguration config)
{
ModelDescriptionGenerator modelGenerator = new ModelDescriptionGenerator(config);
Collection<ApiDescription> apis = config.Services.GetApiExplorer().ApiDescriptions;
foreach (ApiDescription api in apis)
{
ApiParameterDescription parameterDescription;
Type parameterType;
if (TryGetResourceParameter(api, config, out parameterDescription, out parameterType))
{
modelGenerator.GetOrCreateModelDescription(parameterType);
}
}
return modelGenerator;
}
private static void LogInvalidSampleAsError(HelpPageApiModel apiModel, object sample)
{
InvalidSample invalidSample = sample as InvalidSample;
if (invalidSample != null)
{
apiModel.ErrorMessages.Add(invalidSample.ErrorMessage);
}
}
}
}

View File

@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@Html.ActionLink("应用程序名称", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>@Html.ActionLink("主页", "Index", "Home", new { area = "" }, null)</li>
<li>@Html.ActionLink("API", "Index", "Help", new { area = "" }, null)</li>
</ul>
</div>
</div>
</div>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>&copy; @DateTime.Now.Year - 我的 ASP.NET 应用程序</p>
</footer>
</div>
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
</body>
</html>

View File

@@ -0,0 +1,161 @@
using System;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Web.Http.Controllers;
using System.Web.Http.Description;
using System.Xml.XPath;
using PTS_API_V1.Areas.HelpPage.ModelDescriptions;
namespace PTS_API_V1.Areas.HelpPage
{
/// <summary>
/// A custom <see cref="IDocumentationProvider"/> that reads the API documentation from an XML documentation file.
/// </summary>
public class XmlDocumentationProvider : IDocumentationProvider, IModelDocumentationProvider
{
private XPathNavigator _documentNavigator;
private const string TypeExpression = "/doc/members/member[@name='T:{0}']";
private const string MethodExpression = "/doc/members/member[@name='M:{0}']";
private const string PropertyExpression = "/doc/members/member[@name='P:{0}']";
private const string FieldExpression = "/doc/members/member[@name='F:{0}']";
private const string ParameterExpression = "param[@name='{0}']";
/// <summary>
/// Initializes a new instance of the <see cref="XmlDocumentationProvider"/> class.
/// </summary>
/// <param name="documentPath">The physical path to XML document.</param>
public XmlDocumentationProvider(string documentPath)
{
if (documentPath == null)
{
throw new ArgumentNullException("documentPath");
}
XPathDocument xpath = new XPathDocument(documentPath);
_documentNavigator = xpath.CreateNavigator();
}
public string GetDocumentation(HttpControllerDescriptor controllerDescriptor)
{
XPathNavigator typeNode = GetTypeNode(controllerDescriptor.ControllerType);
return GetTagValue(typeNode, "summary");
}
public virtual string GetDocumentation(HttpActionDescriptor actionDescriptor)
{
XPathNavigator methodNode = GetMethodNode(actionDescriptor);
return GetTagValue(methodNode, "summary");
}
public virtual string GetDocumentation(HttpParameterDescriptor parameterDescriptor)
{
ReflectedHttpParameterDescriptor reflectedParameterDescriptor = parameterDescriptor as ReflectedHttpParameterDescriptor;
if (reflectedParameterDescriptor != null)
{
XPathNavigator methodNode = GetMethodNode(reflectedParameterDescriptor.ActionDescriptor);
if (methodNode != null)
{
string parameterName = reflectedParameterDescriptor.ParameterInfo.Name;
XPathNavigator parameterNode = methodNode.SelectSingleNode(String.Format(CultureInfo.InvariantCulture, ParameterExpression, parameterName));
if (parameterNode != null)
{
return parameterNode.Value.Trim();
}
}
}
return null;
}
public string GetResponseDocumentation(HttpActionDescriptor actionDescriptor)
{
XPathNavigator methodNode = GetMethodNode(actionDescriptor);
return GetTagValue(methodNode, "returns");
}
public string GetDocumentation(MemberInfo member)
{
string memberName = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", GetTypeName(member.DeclaringType), member.Name);
string expression = member.MemberType == MemberTypes.Field ? FieldExpression : PropertyExpression;
string selectExpression = String.Format(CultureInfo.InvariantCulture, expression, memberName);
XPathNavigator propertyNode = _documentNavigator.SelectSingleNode(selectExpression);
return GetTagValue(propertyNode, "summary");
}
public string GetDocumentation(Type type)
{
XPathNavigator typeNode = GetTypeNode(type);
return GetTagValue(typeNode, "summary");
}
private XPathNavigator GetMethodNode(HttpActionDescriptor actionDescriptor)
{
ReflectedHttpActionDescriptor reflectedActionDescriptor = actionDescriptor as ReflectedHttpActionDescriptor;
if (reflectedActionDescriptor != null)
{
string selectExpression = String.Format(CultureInfo.InvariantCulture, MethodExpression, GetMemberName(reflectedActionDescriptor.MethodInfo));
return _documentNavigator.SelectSingleNode(selectExpression);
}
return null;
}
private static string GetMemberName(MethodInfo method)
{
string name = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", GetTypeName(method.DeclaringType), method.Name);
ParameterInfo[] parameters = method.GetParameters();
if (parameters.Length != 0)
{
string[] parameterTypeNames = parameters.Select(param => GetTypeName(param.ParameterType)).ToArray();
name += String.Format(CultureInfo.InvariantCulture, "({0})", String.Join(",", parameterTypeNames));
}
return name;
}
private static string GetTagValue(XPathNavigator parentNode, string tagName)
{
if (parentNode != null)
{
XPathNavigator node = parentNode.SelectSingleNode(tagName);
if (node != null)
{
return node.Value.Trim();
}
}
return null;
}
private XPathNavigator GetTypeNode(Type type)
{
string controllerTypeName = GetTypeName(type);
string selectExpression = String.Format(CultureInfo.InvariantCulture, TypeExpression, controllerTypeName);
return _documentNavigator.SelectSingleNode(selectExpression);
}
private static string GetTypeName(Type type)
{
string name = type.FullName;
if (type.IsGenericType)
{
// Format the generic type name to something like: Generic{System.Int32,System.String}
Type genericType = type.GetGenericTypeDefinition();
Type[] genericArguments = type.GetGenericArguments();
string genericTypeName = genericType.FullName;
// Trim the generic parameter counts from the name
genericTypeName = genericTypeName.Substring(0, genericTypeName.IndexOf('`'));
string[] argumentTypeNames = genericArguments.Select(t => GetTypeName(t)).ToArray();
name = String.Format(CultureInfo.InvariantCulture, "{0}{{{1}}}", genericTypeName, String.Join(",", argumentTypeNames));
}
if (type.IsNested)
{
// Changing the nested type name from OuterType+InnerType to OuterType.InnerType to match the XML documentation syntax.
name = name.Replace("+", ".");
}
return name;
}
}
}

View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly>
<name>System.Web.WebPages.Deployment</name>
</assembly>
<members>
<member name="T:System.Web.WebPages.Deployment.PreApplicationStartCode">
<summary>Provides a registration point for pre-application start code for Web Pages deployment.</summary>
</member>
<member name="M:System.Web.WebPages.Deployment.PreApplicationStartCode.Start">
<summary>Registers pre-application start code for Web Pages deployment.</summary>
</member>
<member name="T:System.Web.WebPages.Deployment.WebPagesDeployment">
<summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Provides methods that are used to get deployment information about the Web application.</summary>
</member>
<member name="M:System.Web.WebPages.Deployment.WebPagesDeployment.GetAssemblyPath(System.Version)">
<summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the assembly path for the Web Pages deployment.</summary>
<returns>The assembly path for the Web Pages deployment.</returns>
<param name="version">The Web Pages version.</param>
</member>
<member name="M:System.Web.WebPages.Deployment.WebPagesDeployment.GetExplicitWebPagesVersion(System.String)">
<summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the Web Pages version from the given binary path.</summary>
<returns>The Web Pages version.</returns>
<param name="path">The binary path for the Web Pages.</param>
</member>
<member name="M:System.Web.WebPages.Deployment.WebPagesDeployment.GetIncompatibleDependencies(System.String)">
<summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the assembly references from the given path regardless of the Web Pages version.</summary>
<returns>The dictionary containing the assembly references of the Web Pages and its version.</returns>
<param name="appPath">The path to the Web Pages application.</param>
</member>
<member name="M:System.Web.WebPages.Deployment.WebPagesDeployment.GetMaxVersion">
<summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the maximum version of the Web Pages loaded assemblies.</summary>
<returns>The maximum version of the Web Pages loaded assemblies.</returns>
</member>
<member name="M:System.Web.WebPages.Deployment.WebPagesDeployment.GetVersion(System.String)">
<summary>Gets the Web Pages version from the given path.</summary>
<returns>The Web Pages version.</returns>
<param name="path">The path of the root directory for the application.</param>
</member>
<member name="M:System.Web.WebPages.Deployment.WebPagesDeployment.GetVersionWithoutEnabledCheck(System.String)">
<summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets the Web Pages version using the configuration settings with the specified path.</summary>
<returns>The Web Pages version.</returns>
<param name="path">The path to the application settings.</param>
</member>
<member name="M:System.Web.WebPages.Deployment.WebPagesDeployment.GetWebPagesAssemblies">
<summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the assemblies for this Web Pages deployment.</summary>
<returns>A list containing the assemblies for this Web Pages deployment.</returns>
</member>
<member name="M:System.Web.WebPages.Deployment.WebPagesDeployment.IsEnabled(System.String)">
<summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the Web Pages deployment is enabled.</summary>
<returns>true if the Web Pages deployment is enabled; otherwise, false.</returns>
<param name="path">The path to the Web Pages deployment.</param>
</member>
<member name="M:System.Web.WebPages.Deployment.WebPagesDeployment.IsExplicitlyDisabled(System.String)">
<summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Indicates whether the Web Pages deployment is explicitly disabled.</summary>
<returns>true if the Web Pages deployment is explicitly disabled; otherwise, false.</returns>
<param name="path">The path to the Web Pages deployment.</param>
</member>
</members>
</doc>

View File

@@ -0,0 +1,13 @@
@using $rootnamespace$.Areas.HelpPage
@model InvalidSample
@if (HttpContext.Current.IsDebuggingEnabled)
{
<div class="warning-message-container">
<p>@Model.ErrorMessage</p>
</div>
}
else
{
<p>Sample not available.</p>
}

View File

@@ -0,0 +1,57 @@
using BLV_API.Dal;
using BLV_API.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace BLV_API.Controllers
{
public class ApiController : Controller
{
public ActionResult Index()
{
ViewBag.Title = "宝来威客控与PMS对接API";
return View();
}
/// <summary>
/// Luopan PMS对接
/// </summary>
/// <returns></returns>
public ActionResult LuopanToBLV()
{
Request.InputStream.Position = 0;
byte[] reqBody = new byte[Request.InputStream.Length];
Request.InputStream.Read(reqBody, 0, reqBody.Length);
string reqData = System.Text.Encoding.UTF8.GetString(reqBody);
LogHelper.WriteLog("收到请求:" + reqData);
try
{
LuopanEntity.Root request = JsonConvert.DeserializeObject<LuopanEntity.Root>(reqData);
ServiceReference1.blwwsSoapClient client = new ServiceReference1.blwwsSoapClient();
switch (request.Action)
{
case "CheckIn"://入住
string errorMsg = "";
bool result = client.CheckIn("blw@2015", request.HotelId, request.RoomNo, request.CheckInTime, "", ref errorMsg, request.GuestInfo[0].Mobile, request.GuestInfo[0].IDCardNo);
break;
case "CheckOut"://退房
break;
case "MoveRoom"://换房
break;
case "Extend"://续住
break;
}
return Json(new LuopanEntity.Result() { status = 0, error_msg = "" }, JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
return Json(new LuopanEntity.Result() { status = 1, error_msg = ex.Message }, JsonRequestBehavior.AllowGet);
}
}
}
}

View File

@@ -0,0 +1,201 @@
<?xml version="1.0" encoding="utf-8"?>
<SavedWcfConfigurationInformation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="9.1" CheckSum="JnvezQfYz7ntN+hp84vGGVcVeG+SY3Pd5I8mFkPfhoY=">
<bindingConfigurations>
<bindingConfiguration bindingType="basicHttpBinding" name="blwwsSoap">
<properties>
<property path="/name" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>blwwsSoap</serializedValue>
</property>
<property path="/closeTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/openTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/receiveTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/sendTimeout" isComplexType="false" isExplicitlyDefined="true" clrType="System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/allowCookies" isComplexType="false" isExplicitlyDefined="true" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/bypassProxyOnLocal" isComplexType="false" isExplicitlyDefined="true" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/hostNameComparisonMode" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.HostNameComparisonMode, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>StrongWildcard</serializedValue>
</property>
<property path="/maxBufferPoolSize" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/maxBufferSize" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>65536</serializedValue>
</property>
<property path="/maxReceivedMessageSize" isComplexType="false" isExplicitlyDefined="true" clrType="System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/proxyAddress" isComplexType="false" isExplicitlyDefined="false" clrType="System.Uri, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/readerQuotas" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement</serializedValue>
</property>
<property path="/readerQuotas/maxDepth" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>0</serializedValue>
</property>
<property path="/readerQuotas/maxStringContentLength" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>0</serializedValue>
</property>
<property path="/readerQuotas/maxArrayLength" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>0</serializedValue>
</property>
<property path="/readerQuotas/maxBytesPerRead" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>0</serializedValue>
</property>
<property path="/readerQuotas/maxNameTableCharCount" isComplexType="false" isExplicitlyDefined="false" clrType="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>0</serializedValue>
</property>
<property path="/textEncoding" isComplexType="false" isExplicitlyDefined="false" clrType="System.Text.Encoding, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>System.Text.UTF8Encoding</serializedValue>
</property>
<property path="/transferMode" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.TransferMode, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>Buffered</serializedValue>
</property>
<property path="/useDefaultWebProxy" isComplexType="false" isExplicitlyDefined="true" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/messageEncoding" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.WSMessageEncoding, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>Text</serializedValue>
</property>
<property path="/security" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.BasicHttpSecurityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>System.ServiceModel.Configuration.BasicHttpSecurityElement</serializedValue>
</property>
<property path="/security/mode" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.BasicHttpSecurityMode, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>None</serializedValue>
</property>
<property path="/security/transport" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.HttpTransportSecurityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>System.ServiceModel.Configuration.HttpTransportSecurityElement</serializedValue>
</property>
<property path="/security/transport/clientCredentialType" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.HttpClientCredentialType, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>None</serializedValue>
</property>
<property path="/security/transport/proxyCredentialType" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.HttpProxyCredentialType, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>None</serializedValue>
</property>
<property path="/security/transport/extendedProtectionPolicy" isComplexType="true" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement</serializedValue>
</property>
<property path="/security/transport/extendedProtectionPolicy/policyEnforcement" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.PolicyEnforcement, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>Never</serializedValue>
</property>
<property path="/security/transport/extendedProtectionPolicy/protectionScenario" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.ProtectionScenario, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>TransportSelected</serializedValue>
</property>
<property path="/security/transport/extendedProtectionPolicy/customServiceNames" isComplexType="true" isExplicitlyDefined="false" clrType="System.Security.Authentication.ExtendedProtection.Configuration.ServiceNameElementCollection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>(集合)</serializedValue>
</property>
<property path="/security/transport/realm" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/security/message" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.BasicHttpMessageSecurityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>System.ServiceModel.Configuration.BasicHttpMessageSecurityElement</serializedValue>
</property>
<property path="/security/message/clientCredentialType" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.BasicHttpMessageCredentialType, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>UserName</serializedValue>
</property>
<property path="/security/message/algorithmSuite" isComplexType="false" isExplicitlyDefined="false" clrType="System.ServiceModel.Security.SecurityAlgorithmSuite, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>Default</serializedValue>
</property>
</properties>
</bindingConfiguration>
</bindingConfigurations>
<endpoints>
<endpoint name="blwwsSoap" contract="ServiceReference1.blwwsSoap" bindingType="basicHttpBinding" address="http://pms.boonlive-rcu.com:89/blwws.asmx" bindingConfiguration="blwwsSoap">
<properties>
<property path="/address" isComplexType="false" isExplicitlyDefined="true" clrType="System.Uri, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>http://pms.boonlive-rcu.com:89/blwws.asmx</serializedValue>
</property>
<property path="/behaviorConfiguration" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/binding" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>basicHttpBinding</serializedValue>
</property>
<property path="/bindingConfiguration" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>blwwsSoap</serializedValue>
</property>
<property path="/contract" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>ServiceReference1.blwwsSoap</serializedValue>
</property>
<property path="/headers" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.AddressHeaderCollectionElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>System.ServiceModel.Configuration.AddressHeaderCollectionElement</serializedValue>
</property>
<property path="/headers/headers" isComplexType="false" isExplicitlyDefined="true" clrType="System.ServiceModel.Channels.AddressHeaderCollection, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>&lt;Header /&gt;</serializedValue>
</property>
<property path="/identity" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.IdentityElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>System.ServiceModel.Configuration.IdentityElement</serializedValue>
</property>
<property path="/identity/userPrincipalName" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.UserPrincipalNameElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>System.ServiceModel.Configuration.UserPrincipalNameElement</serializedValue>
</property>
<property path="/identity/userPrincipalName/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/identity/servicePrincipalName" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.ServicePrincipalNameElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>System.ServiceModel.Configuration.ServicePrincipalNameElement</serializedValue>
</property>
<property path="/identity/servicePrincipalName/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/identity/dns" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.DnsElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>System.ServiceModel.Configuration.DnsElement</serializedValue>
</property>
<property path="/identity/dns/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/identity/rsa" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.RsaElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>System.ServiceModel.Configuration.RsaElement</serializedValue>
</property>
<property path="/identity/rsa/value" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/identity/certificate" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.CertificateElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>System.ServiceModel.Configuration.CertificateElement</serializedValue>
</property>
<property path="/identity/certificate/encodedValue" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/identity/certificateReference" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.CertificateReferenceElement, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>System.ServiceModel.Configuration.CertificateReferenceElement</serializedValue>
</property>
<property path="/identity/certificateReference/storeName" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.StoreName, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>My</serializedValue>
</property>
<property path="/identity/certificateReference/storeLocation" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.StoreLocation, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>LocalMachine</serializedValue>
</property>
<property path="/identity/certificateReference/x509FindType" isComplexType="false" isExplicitlyDefined="false" clrType="System.Security.Cryptography.X509Certificates.X509FindType, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>FindBySubjectDistinguishedName</serializedValue>
</property>
<property path="/identity/certificateReference/findValue" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/identity/certificateReference/isChainIncluded" isComplexType="false" isExplicitlyDefined="false" clrType="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>False</serializedValue>
</property>
<property path="/name" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue>blwwsSoap</serializedValue>
</property>
<property path="/kind" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
<property path="/endpointConfiguration" isComplexType="false" isExplicitlyDefined="false" clrType="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<serializedValue />
</property>
</properties>
</endpoint>
</endpoints>
</SavedWcfConfigurationInformation>

View File

@@ -0,0 +1,846 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly>
<name>System.Web.Helpers</name>
</assembly>
<members>
<member name="T:System.Web.Helpers.Chart">
<summary>以图表格式显示数据。</summary>
</member>
<member name="M:System.Web.Helpers.Chart.#ctor(System.Int32,System.Int32,System.String,System.String)">
<summary>初始化 <see cref="T:System.Web.Helpers.Chart" /> 类的新实例。</summary>
<param name="width">整个图表图像的宽度(以像素为单位)。</param>
<param name="height">整个图表图像的高度(以像素为单位)。</param>
<param name="theme">(可选)要应用到图表的模板(主题)。</param>
<param name="themePath">(可选)要应用到图表的模板(主题)路径和文件名。</param>
</member>
<member name="M:System.Web.Helpers.Chart.AddLegend(System.String,System.String)">
<summary>将图例添加到图表中。</summary>
<returns>图表。</returns>
<param name="title">图例标题的文本。</param>
<param name="name">图例的唯一名称。</param>
</member>
<member name="M:System.Web.Helpers.Chart.AddSeries(System.String,System.String,System.String,System.String,System.String,System.Int32,System.Collections.IEnumerable,System.String,System.Collections.IEnumerable,System.String)">
<summary>提供图表的数据点和系列特性。</summary>
<returns>图表。</returns>
<param name="name">系列的唯一名称。</param>
<param name="chartType">系列的图表类型。</param>
<param name="chartArea">用于绘制数据系列的图表区域的名称。</param>
<param name="axisLabel">系列的轴标签文本。</param>
<param name="legend">与图例关联的系列的名称。</param>
<param name="markerStep">数据点标记的粒度。</param>
<param name="xValue">要沿 X 轴绘制的值。</param>
<param name="xField">用于 X 值的字段的名称。</param>
<param name="yValues">要沿 Y 轴绘制的值。</param>
<param name="yFields">一个逗号分隔列表,其中列出了 Y 值的字段的名称。</param>
</member>
<member name="M:System.Web.Helpers.Chart.AddTitle(System.String,System.String)">
<summary>将标题添加到图表。</summary>
<returns>图表。</returns>
<param name="text">标题文本。</param>
<param name="name">标题的唯一名称。</param>
</member>
<member name="M:System.Web.Helpers.Chart.DataBindCrossTable(System.Collections.IEnumerable,System.String,System.String,System.String,System.String,System.String)">
<summary>将图表绑定到数据表,该表为列中的每个唯一值创建了一个系列。</summary>
<returns>图表。</returns>
<param name="dataSource">图表数据源。</param>
<param name="groupByField">用于将数据分组成系列的列的名称。</param>
<param name="xField">用于 X 值的列的名称。</param>
<param name="yFields">一个逗号分隔列表,其中列出了用于 Y 值的列的名称。</param>
<param name="otherFields">可以绑定的其他数据点属性。</param>
<param name="pointSortOrder">对系列进行排序所依据的顺序。默认值为“升序”。</param>
</member>
<member name="M:System.Web.Helpers.Chart.DataBindTable(System.Collections.IEnumerable,System.String)">
<summary>创建系列数据并将其绑定到指定数据表,然后选择性地填充多个 X 值。</summary>
<returns>图表。</returns>
<param name="dataSource">图表数据源。此数据源可以为任何 <see cref="T:System.Collections.IEnumerable" /> 对象。</param>
<param name="xField">用于系列 X 值的表列的名称。</param>
</member>
<member name="P:System.Web.Helpers.Chart.FileName">
<summary>获取或设置包含图表图像的文件的名称。</summary>
<returns>文件名。</returns>
</member>
<member name="M:System.Web.Helpers.Chart.GetBytes(System.String)">
<summary>以字节数组的形式返回图表图像。</summary>
<returns>图表。</returns>
<param name="format">图像格式。默认值为“jpeg”。</param>
</member>
<member name="M:System.Web.Helpers.Chart.GetFromCache(System.String)">
<summary>从缓存中检索指定图表。</summary>
<returns>图表。</returns>
<param name="key">包含要检索的图表的缓存项的 ID。此键在调用 <see cref="M:System.Web.Helpers.Chart.SaveToCache(System.String,System.Int32,System.Boolean)" /> 方法时设置。</param>
</member>
<member name="P:System.Web.Helpers.Chart.Height">
<summary>获取或设置图表图像的高度(以像素为单位)。</summary>
<returns>图表高度。</returns>
</member>
<member name="M:System.Web.Helpers.Chart.Save(System.String,System.String)">
<summary>将图表图像保存到指定文件中。</summary>
<returns>图表。</returns>
<param name="path">图像文件的位置和名称。</param>
<param name="format">图像文件格式如“png”或“jpeg”。</param>
</member>
<member name="M:System.Web.Helpers.Chart.SaveToCache(System.String,System.Int32,System.Boolean)">
<summary>将图表保存到系统缓存中。</summary>
<returns>包含图表的缓存项的 ID。</returns>
<param name="key">缓存中图表的 ID。</param>
<param name="minutesToCache">在缓存中保留图表图像的分钟数。默认值为 20。</param>
<param name="slidingExpiration">若为 true则指示每次访问项时都重置图表缓存项的过期若为 false则指示过期将基于自向缓存中添加项以来的绝对时间间隔。默认值为 true。</param>
</member>
<member name="M:System.Web.Helpers.Chart.SaveXml(System.String)">
<summary>将图表另存为 XML 文件。</summary>
<returns>图表。</returns>
<param name="path">XML 文件的路径和名称。</param>
</member>
<member name="M:System.Web.Helpers.Chart.SetXAxis(System.String,System.Double,System.Double)">
<summary>设置水平轴的值。</summary>
<returns>图表。</returns>
<param name="title">X 轴的标题。</param>
<param name="min">X 轴的最小值。</param>
<param name="max">X 轴的最大值。</param>
</member>
<member name="M:System.Web.Helpers.Chart.SetYAxis(System.String,System.Double,System.Double)">
<summary>设置垂直轴的值。</summary>
<returns>图表。</returns>
<param name="title">Y 轴的标题。</param>
<param name="min">Y 轴的最小值。</param>
<param name="max">Y 轴的最大值。</param>
</member>
<member name="M:System.Web.Helpers.Chart.ToWebImage(System.String)">
<summary>基于当前 <see cref="T:System.Web.Helpers.Chart" /> 对象创建 <see cref="T:System.Web.Helpers.WebImage" /> 对象。</summary>
<returns>图表。</returns>
<param name="format">将 <see cref="T:System.Web.Helpers.WebImage" /> 对象另存为某种图像时该图像的格式。默认值为“jpeg”。<paramref name="format" /> 参数不区分大小写。</param>
</member>
<member name="P:System.Web.Helpers.Chart.Width">
<summary>获取或设置图表图像的宽度(以像素为单位)。</summary>
<returns>图表宽度。</returns>
</member>
<member name="M:System.Web.Helpers.Chart.Write(System.String)">
<summary>将 <see cref="T:System.Web.Helpers.Chart" /> 对象的输出呈现为图像。</summary>
<returns>图表。</returns>
<param name="format">图像的格式。默认值为“jpeg”。</param>
</member>
<member name="M:System.Web.Helpers.Chart.WriteFromCache(System.String,System.String)">
<summary>将已存入缓存的 <see cref="T:System.Web.Helpers.Chart" /> 对象的输入呈现为图像。</summary>
<returns>图表。</returns>
<param name="key">缓存中图表的 ID。</param>
<param name="format">图像的格式。默认值为“jpeg”。</param>
</member>
<member name="T:System.Web.Helpers.ChartTheme">
<summary>为 <see cref="T:System.Web.Helpers.Chart" /> 对象指定视觉主题。</summary>
</member>
<member name="F:System.Web.Helpers.ChartTheme.Blue">
<summary>以一个具有渐进蓝色、圆角边缘、阴影和高对比度网格线的视觉容器为特色的 2D 图表的主题。</summary>
</member>
<member name="F:System.Web.Helpers.ChartTheme.Green">
<summary>以一个具有渐进绿色、圆角边缘、阴影和低对比度网格线的视觉容器为特色的 2D 图表的主题。</summary>
</member>
<member name="F:System.Web.Helpers.ChartTheme.Vanilla">
<summary>没有视觉容器和网格线的 2D 图表的主题。</summary>
</member>
<member name="F:System.Web.Helpers.ChartTheme.Vanilla3D">
<summary>没有视觉容器、带有有限标签和稀疏高对比度网格线的 3D 图表的主题。</summary>
</member>
<member name="F:System.Web.Helpers.ChartTheme.Yellow">
<summary>以一个具有渐进黄色、圆角边缘、阴影和高对比度网格线的视觉容器为特色的 2D 图表的主题。</summary>
</member>
<member name="T:System.Web.Helpers.Crypto">
<summary>提供用于生成哈希值及加密密码或其他敏感数据的方法。</summary>
</member>
<member name="M:System.Web.Helpers.Crypto.GenerateSalt(System.Int32)">
<summary>生成随机字节值的强密码序列。</summary>
<returns>以 base-64 编码字符串生成的 salt 值。</returns>
<param name="byteLength">要生成的加密随机字节的数量。</param>
</member>
<member name="M:System.Web.Helpers.Crypto.Hash(System.Byte[],System.String)">
<summary>返回指定字节数组的哈希值。</summary>
<returns>由十六进制字符组成的字符串形式的 <paramref name="input" /> 的哈希值。</returns>
<param name="input">要为其提供哈希值的数据。</param>
<param name="algorithm">用于生成哈希值的算法。默认值为“sha256”。</param>
<exception cref="T:System.ArgumentNullException">
<paramref name="input" /> 为 null。</exception>
</member>
<member name="M:System.Web.Helpers.Crypto.Hash(System.String,System.String)">
<summary>返回指定字符串的哈希值。</summary>
<returns>由十六进制字符组成的字符串形式的 <paramref name="input" /> 的哈希值。</returns>
<param name="input">要为其提供哈希值的数据。</param>
<param name="algorithm">用于生成哈希值的算法。默认值为“sha256”。</param>
<exception cref="T:System.ArgumentNullException">
<paramref name="input" /> 为 null。</exception>
</member>
<member name="M:System.Web.Helpers.Crypto.HashPassword(System.String)">
<summary>返回指定密码的 RFC 2898 哈希值。</summary>
<returns>base-64 编码字符串形式的 <paramref name="password" /> 的哈希值。</returns>
<param name="password">要为其生成哈希值的密码。</param>
<exception cref="T:System.ArgumentNullException">
<paramref name="password" /> 为 null。</exception>
</member>
<member name="M:System.Web.Helpers.Crypto.SHA1(System.String)">
<summary>返回指定字符串的 SHA-1 哈希值。</summary>
<returns>由十六进制字符组成的字符串形式的 <paramref name="input" /> 的 SHA-1 哈希值。</returns>
<param name="input">要为其提供哈希值的数据。</param>
<exception cref="T:System.ArgumentNullException">
<paramref name="input" /> 为 null。</exception>
</member>
<member name="M:System.Web.Helpers.Crypto.SHA256(System.String)">
<summary>返回指定字符串的 SHA-256 哈希值。</summary>
<returns>由十六进制字符组成的字符串形式的 <paramref name="input" /> 的 SHA-256 哈希值。</returns>
<param name="input">要为其提供哈希值的数据。</param>
<exception cref="T:System.ArgumentNullException">
<paramref name="input" /> 为 null。</exception>
</member>
<member name="M:System.Web.Helpers.Crypto.VerifyHashedPassword(System.String,System.String)">
<summary>确定指定的 RFC 2898 哈希和密码是否为加密匹配。</summary>
<returns>如果哈希值为密码的加密匹配,则为 true否则为 false。</returns>
<param name="hashedPassword">base-64 编码字符串形式的以前计算的 RFC 2898 哈希值。</param>
<param name="password">要与 <paramref name="hashedPassword" /> 进行加密比较的明文密码。</param>
<exception cref="T:System.ArgumentNullException">
<paramref name="hashedPassword" /> 或 <paramref name="password" /> 为 null。</exception>
</member>
<member name="T:System.Web.Helpers.DynamicJsonArray">
<summary>通过使用动态语言运行时 (DLR) 的动态功能将一系列值表示为类似 JavaScript 的数组。</summary>
</member>
<member name="M:System.Web.Helpers.DynamicJsonArray.#ctor(System.Object[])">
<summary>使用指定的数组元素值初始化 <see cref="T:System.Web.Helpers.DynamicJsonArray" /> 类的新实例。</summary>
<param name="arrayValues">包含要添加到 <see cref="T:System.Web.Helpers.DynamicJsonArray" /> 实例中的值的对象数组。</param>
</member>
<member name="M:System.Web.Helpers.DynamicJsonArray.GetEnumerator">
<summary>返回一个可用于循环访问 <see cref="T:System.Web.Helpers.DynamicJsonArray" /> 实例的元素的枚举器。</summary>
<returns>可用于循环访问 JSON 数组的元素的枚举器。</returns>
</member>
<member name="P:System.Web.Helpers.DynamicJsonArray.Item(System.Int32)">
<summary>返回 <see cref="T:System.Web.Helpers.DynamicJsonArray" /> 实例中指定索引处的值。</summary>
<returns>指定索引处的值。</returns>
</member>
<member name="P:System.Web.Helpers.DynamicJsonArray.Length">
<summary>返回 <see cref="T:System.Web.Helpers.DynamicJsonArray" /> 实例中的元素数。</summary>
<returns>JSON 数组中的元素数。</returns>
</member>
<member name="M:System.Web.Helpers.DynamicJsonArray.op_Implicit(System.Web.Helpers.DynamicJsonArray)~System.Object[]">
<summary>将 <see cref="T:System.Web.Helpers.DynamicJsonArray" /> 实例转换为对象数组。</summary>
<returns>表示 JSON 数组的对象数组。</returns>
<param name="obj">要转换的 JSON 数组。</param>
</member>
<member name="M:System.Web.Helpers.DynamicJsonArray.op_Implicit(System.Web.Helpers.DynamicJsonArray)~System.Array">
<summary>将 <see cref="T:System.Web.Helpers.DynamicJsonArray" /> 实例转换为对象数组。</summary>
<returns>表示 JSON 数组的对象数组。</returns>
<param name="obj">要转换的 JSON 数组。</param>
</member>
<member name="M:System.Web.Helpers.DynamicJsonArray.System#Collections#Generic#IEnumerable{T}#GetEnumerator">
<summary>返回一个可用于循环访问集合的枚举器。</summary>
<returns>一个可用于循环访问集合的枚举器。</returns>
</member>
<member name="M:System.Web.Helpers.DynamicJsonArray.TryConvert(System.Dynamic.ConvertBinder,System.Object@)">
<summary>将 <see cref="T:System.Web.Helpers.DynamicJsonArray" /> 实例转换为兼容类型。</summary>
<returns>如果转换成功,则为 true否则为 false。</returns>
<param name="binder">提供有关转换操作的信息。</param>
<param name="result">此方法返回时,将包含类型转换操作的结果。该参数未经初始化即被传递。</param>
</member>
<member name="M:System.Web.Helpers.DynamicJsonArray.TryGetMember(System.Dynamic.GetMemberBinder,System.Object@)">
<summary>以不会引发异常的方式测试动态成员(不受支持)的 <see cref="T:System.Web.Helpers.DynamicJsonArray" /> 实例。</summary>
<returns>所有情况下均为 true。</returns>
<param name="binder">提供有关 get 操作的信息。</param>
<param name="result">此方法返回时,将包含 null。该参数未经初始化即被传递。</param>
</member>
<member name="T:System.Web.Helpers.DynamicJsonObject">
<summary>通过使用动态语言运行时的功能将值的集合表示为类似 JavaScript 的对象。</summary>
</member>
<member name="M:System.Web.Helpers.DynamicJsonObject.#ctor(System.Collections.Generic.IDictionary{System.String,System.Object})">
<summary>使用指定字段值初始化 <see cref="T:System.Web.Helpers.DynamicJsonObject" /> 类的新实例。</summary>
<param name="values">将作为动态成员添加到 <see cref="T:System.Web.Helpers.DynamicJsonObject" /> 实例中的属性名称和值的字典。</param>
</member>
<member name="M:System.Web.Helpers.DynamicJsonObject.GetDynamicMemberNames">
<summary>返回包含 <see cref="T:System.Web.Helpers.DynamicJsonObject" /> 实例的所有动态成员JSON 字段)的名称的列表。</summary>
<returns>包含每个动态成员JSON 字段)的名称的列表。</returns>
</member>
<member name="M:System.Web.Helpers.DynamicJsonObject.TryConvert(System.Dynamic.ConvertBinder,System.Object@)">
<summary>将 <see cref="T:System.Web.Helpers.DynamicJsonObject" /> 实例转换为兼容类型。</summary>
<returns>所有情况下均为 true。</returns>
<param name="binder">提供有关转换操作的信息。</param>
<param name="result">此方法返回时,将包含类型转换操作的结果。该参数未经初始化即被传递。</param>
<exception cref="T:System.InvalidOperationException">无法将 <see cref="T:System.Web.Helpers.DynamicJsonObject" /> 实例转换为指定类型。</exception>
</member>
<member name="M:System.Web.Helpers.DynamicJsonObject.TryGetIndex(System.Dynamic.GetIndexBinder,System.Object[],System.Object@)">
<summary>使用指定索引获取 <see cref="T:System.Web.Helpers.DynamicJsonObject" /> 字段的值。</summary>
<returns>所有情况下均为 true。</returns>
<param name="binder">提供有关已编入索引的 get 操作的信息。</param>
<param name="indexes">包含按名称将字段编入索引的单个对象的数组。此对象必须能够转换为字符串,以便指定要返回的 JSON 字段的名称。如果指定了多个索引,则当此方法返回时,<paramref name="result" /> 将包含 null。</param>
<param name="result">当此方法返回时,将包含已编入索引的字段的值;或者如果 get 操作失败,则将包含 null。该参数未经初始化即被传递。</param>
</member>
<member name="M:System.Web.Helpers.DynamicJsonObject.TryGetMember(System.Dynamic.GetMemberBinder,System.Object@)">
<summary>使用指定名称获取 <see cref="T:System.Web.Helpers.DynamicJsonObject" /> 字段的值。</summary>
<returns>所有情况下均为 true。</returns>
<param name="binder">提供有关 get 操作的信息。</param>
<param name="result">当此方法返回时,将包含字段的值;或者如果 GET 操作失败,则将包含 null。该参数未经初始化即被传递。</param>
</member>
<member name="M:System.Web.Helpers.DynamicJsonObject.TrySetIndex(System.Dynamic.SetIndexBinder,System.Object[],System.Object)">
<summary>使用指定索引设置 <see cref="T:System.Web.Helpers.DynamicJsonObject" /> 字段的值。</summary>
<returns>所有情况下均为 true。</returns>
<param name="binder">提供有关已编入索引的 SET 操作的信息。</param>
<param name="indexes">包含按名称将字段编入索引的单个对象的数组。此对象必须能够转换为字符串,以便指定要返回的 JSON 字段的名称。如果指定了多个索引,则不会更改或添加任何字段。</param>
<param name="value">要将字段设置为的值。</param>
</member>
<member name="M:System.Web.Helpers.DynamicJsonObject.TrySetMember(System.Dynamic.SetMemberBinder,System.Object)">
<summary>使用指定名称设置 <see cref="T:System.Web.Helpers.DynamicJsonObject" /> 字段的值。</summary>
<returns>所有情况下均为 true。</returns>
<param name="binder">提供有关 SET 操作的信息。</param>
<param name="value">要将字段设置为的值。</param>
</member>
<member name="T:System.Web.Helpers.Json">
<summary>提供处理 JavaScript 对象表示法 (JSON) 格式数据的方法。</summary>
</member>
<member name="M:System.Web.Helpers.Json.Decode``1(System.String)">
<summary>将 JavaScript 对象表示法 (JSON) 格式的数据转换为指定的强类型数据列表。</summary>
<returns>已转换为强类型列表的 JSON 编码数据。</returns>
<param name="value">要转换的 JSON 编码字符串。</param>
<typeparam name="T">要将 JSON 数据转换为的强类型列表的类型。</typeparam>
</member>
<member name="M:System.Web.Helpers.Json.Decode(System.String)">
<summary>将 JavaScript 对象表示法 (JSON) 格式的数据转换为数据对象。</summary>
<returns>已转换为数据对象的 JSON 编码数据。</returns>
<param name="value">要转换的 JSON 编码字符串。</param>
</member>
<member name="M:System.Web.Helpers.Json.Decode(System.String,System.Type)">
<summary>将 JavaScript 对象表示法 (JSON) 格式的数据转换为指定类型的数据对象。</summary>
<returns>已转换为指定类型的 JSON 编码数据。</returns>
<param name="value">要转换的 JSON 编码字符串。</param>
<param name="targetType">应将 <paramref name="value" /> 数据转换为的类型。</param>
</member>
<member name="M:System.Web.Helpers.Json.Encode(System.Object)">
<summary>将数据对象转换为 JavaScript 对象表示法 (JSON) 格式的字符串。</summary>
<returns>返回已转换为 JSON 格式的数据的字符串。</returns>
<param name="value">要转换的数据对象。</param>
</member>
<member name="M:System.Web.Helpers.Json.Write(System.Object,System.IO.TextWriter)">
<summary>将数据对象转换为 JavaScript 对象表示法 (JSON) 格式的字符串,然后将该字符串添加到指定的 <see cref="T:System.IO.TextWriter" /> 对象。</summary>
<param name="value">要转换的数据对象。</param>
<param name="writer">包含已转换的 JSON 数据的对象。</param>
</member>
<member name="T:System.Web.Helpers.ObjectInfo">
<summary>呈现指定对象及其引用的任何子对象的属性名称和值。</summary>
</member>
<member name="M:System.Web.Helpers.ObjectInfo.Print(System.Object,System.Int32,System.Int32)">
<summary>呈现指定对象及任何子对象的属性名称和值。</summary>
<returns>对于简单变量,将返回类型和值。对于包含多个项的对象,将返回属性名称或键,以及每个属性的值。</returns>
<param name="value">要呈现其信息的对象。</param>
<param name="depth">可选。指定要呈现其信息的嵌套子对象的深度。默认值为 10。</param>
<param name="enumerationLength">可选。指定该方法为对象值显示的最大字符数。默认值为 1000。</param>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="depth" /> 小于零。</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="enumerationLength" /> 小于或等于零。</exception>
</member>
<member name="T:System.Web.Helpers.ServerInfo">
<summary>显示有关承载当前网页的 Web 服务器环境的信息。</summary>
</member>
<member name="M:System.Web.Helpers.ServerInfo.GetHtml">
<summary>显示有关 Web 服务器环境的信息。</summary>
<returns>包含 Web 服务器相关信息的名称/值对字符串。</returns>
</member>
<member name="T:System.Web.Helpers.SortDirection">
<summary>指定对项列表进行排序的方向。</summary>
</member>
<member name="F:System.Web.Helpers.SortDirection.Ascending">
<summary>从最小到最大排序 — 例如,从 1 到 10。</summary>
</member>
<member name="F:System.Web.Helpers.SortDirection.Descending">
<summary>从最大到最小排序 — 例如,从 10 到 1。</summary>
</member>
<member name="T:System.Web.Helpers.WebCache">
<summary>提供可存储经常访问的数据的缓存。</summary>
</member>
<member name="M:System.Web.Helpers.WebCache.Get(System.String)">
<summary>从 <see cref="T:System.Web.Helpers.WebCache" /> 对象中检索指定项。</summary>
<returns>从缓存中检索到的项;如果找不到该项,则为 null。</returns>
<param name="key">要检索的缓存项的标识符。</param>
</member>
<member name="M:System.Web.Helpers.WebCache.Remove(System.String)">
<summary>从 <see cref="T:System.Web.Helpers.WebCache" /> 对象中删除指定项。</summary>
<returns>从 <see cref="T:System.Web.Helpers.WebCache" /> 对象中删除的项。如果找不到该项,则返回 null。</returns>
<param name="key">要删除的缓存项的标识符。</param>
</member>
<member name="M:System.Web.Helpers.WebCache.Set(System.String,System.Object,System.Int32,System.Boolean)">
<summary>将一个项插入到 <see cref="T:System.Web.Helpers.WebCache" /> 对象。</summary>
<param name="key">缓存项的标识符。</param>
<param name="value">要插入缓存中的数据。</param>
<param name="minutesToCache">可选。在缓存中保留项的分钟数。默认值为 20。</param>
<param name="slidingExpiration">可选。若为 true则指示每次访问项时都重置缓存项过期若为 false则指示过期将基于自向缓存中添加项以来的绝对时间。默认值为 true。在这种情况下如果还使用 <paramref name="minutesToCache" /> 参数的默认值,缓存的项将在最后一次访问后 20 分钟过期。</param>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="minutesToCache" /> 的值小于或等于零。</exception>
<exception cref="T:System.ArgumentOutOfRangeException">已启用可调过期且 <paramref name="minutesToCache" /> 的值大于一年。</exception>
</member>
<member name="T:System.Web.Helpers.WebGrid">
<summary>在网页上使用 HTML table 元素显示数据。</summary>
</member>
<member name="M:System.Web.Helpers.WebGrid.#ctor(System.Collections.Generic.IEnumerable{System.Object},System.Collections.Generic.IEnumerable{System.String},System.String,System.Int32,System.Boolean,System.Boolean,System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<summary>初始化 <see cref="T:System.Web.Helpers.WebGrid" /> 类的新实例。</summary>
<param name="source">要显示的数据。</param>
<param name="columnNames">包含要显示的数据列的名称的集合。默认情况下,将根据 <paramref name="source" /> 参数中的值自动填充此值。</param>
<param name="defaultSort">默认情况下用于对网格进行排序的数据列的名称。</param>
<param name="rowsPerPage">启用分页时在网格的每个页上显示的行的数量。默认值为 10。</param>
<param name="canPage">若要指定为 <see cref="T:System.Web.Helpers.WebGrid" /> 实例启用分页,则为 true否则为 false。默认值为 true。</param>
<param name="canSort">若要指定为 <see cref="T:System.Web.Helpers.WebGrid" /> 实例启用排序,则为 true否则为 false。默认值为 true。</param>
<param name="ajaxUpdateContainerId">HTML id 特性的值,用于标记 HTML 元素以获取与 <see cref="T:System.Web.Helpers.WebGrid" /> 实例关联的动态 Ajax 更新。</param>
<param name="ajaxUpdateCallback">在更新 <see cref="P:System.Web.Helpers.WebGrid.AjaxUpdateContainerId" /> 属性指定的 HTML 元素后调用的 JavaScript 函数的名称。如果未提供函数名称,将不会调用任何函数。如果指定函数不存在,在调用该函数时,将发生 JavaScript 错误。</param>
<param name="fieldNamePrefix">可应用于所有与 <see cref="T:System.Web.Helpers.WebGrid" /> 实例关联的查询字符串字段的前缀。此值用于支持同一网页上的多个 <see cref="T:System.Web.Helpers.WebGrid" /> 实例。</param>
<param name="pageFieldName">用于指定 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的当前页的查询字符串字段的名称。</param>
<param name="selectionFieldName">用于指定 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的当前选定行的查询字符串字段的名称。</param>
<param name="sortFieldName">查询字符串字段(用于指定作为 <see cref="T:System.Web.Helpers.WebGrid" /> 实例排序依据的数据列的名称)的名称。</param>
<param name="sortDirectionFieldName">用于指定 <see cref="T:System.Web.Helpers.WebGrid" /> 实例排序方向的查询字符串字段的名称。</param>
</member>
<member name="M:System.Web.Helpers.WebGrid.AddSorter``2(System.String,System.Linq.Expressions.Expression{System.Func{``0,``1}})">
<summary>为给定列添加特定的排序函数。</summary>
<returns>应用了新的自定义排序程序的当前网格。</returns>
<param name="columnName">列名称(用于排序)</param>
<param name="keySelector">用于为网格源中的每个元素选择键或排序依据的函数。</param>
<typeparam name="TElement">网格源中的元素类型。</typeparam>
<typeparam name="TProperty">列类型,通常从 keySelector 函数的返回类型推断。</typeparam>
</member>
<member name="P:System.Web.Helpers.WebGrid.AjaxUpdateCallback">
<summary>在更新与 <see cref="T:System.Web.Helpers.WebGrid" /> 实例关联的 HTML 元素以响应 Ajax 更新请求后,获取要调用的 JavaScript 函数的名称。</summary>
<returns>函数的名称。</returns>
</member>
<member name="P:System.Web.Helpers.WebGrid.AjaxUpdateContainerId">
<summary>获取在网页上标记 HTML 元素(该元素获取与 <see cref="T:System.Web.Helpers.WebGrid" /> 实例关联的动态 Ajax 更新)的 HTML id 特性的值。</summary>
<returns>id 特性的值。</returns>
</member>
<member name="M:System.Web.Helpers.WebGrid.Bind(System.Collections.Generic.IEnumerable{System.Object},System.Collections.Generic.IEnumerable{System.String},System.Boolean,System.Int32)">
<summary>将指定数据绑定到 <see cref="T:System.Web.Helpers.WebGrid" /> 实例。</summary>
<returns>已绑定并填充的 <see cref="T:System.Web.Helpers.WebGrid" /> 实例。</returns>
<param name="source">要显示的数据。</param>
<param name="columnNames">包含要绑定的数据列的名称的集合。</param>
<param name="autoSortAndPage">若要为 <see cref="T:System.Web.Helpers.WebGrid" /> 实例启用排序和分页,则为 true否则为 false。</param>
<param name="rowCount">要在网格的每个页上显示的行的数量。</param>
</member>
<member name="P:System.Web.Helpers.WebGrid.CanSort">
<summary>获取指示 <see cref="T:System.Web.Helpers.WebGrid" /> 实例是否支持排序的值。</summary>
<returns>如果该实例支持排序,则为 true否则为 false。</returns>
</member>
<member name="M:System.Web.Helpers.WebGrid.Column(System.String,System.String,System.Func{System.Object,System.Object},System.String,System.Boolean)">
<summary>创建新的 <see cref="T:System.Web.Helpers.WebGridColumn" /> 实例。</summary>
<returns>新列。</returns>
<param name="columnName">要与 <see cref="T:System.Web.Helpers.WebGridColumn" /> 实例关联的数据列的名称。</param>
<param name="header">在 HTML 表列的标题中呈现的、与 <see cref="T:System.Web.Helpers.WebGridColumn" /> 实例关联的文本。</param>
<param name="format">用于格式化与 <see cref="T:System.Web.Helpers.WebGridColumn" /> 实例关联的数据值的函数。</param>
<param name="style">一个用于指定 CSS 类名称的字符串,而 CSS 类则可用于设置与 <see cref="T:System.Web.Helpers.WebGridColumn" /> 实例关联的 HTML 表单元格的样式。</param>
<param name="canSort">若要在 <see cref="T:System.Web.Helpers.WebGrid" /> 实例中按 <see cref="T:System.Web.Helpers.WebGridColumn" /> 实例的关联数据值启用排序,则为 true否则为 false。默认值为 true。</param>
</member>
<member name="P:System.Web.Helpers.WebGrid.ColumnNames">
<summary>获取一个集合,该集合包含绑定到 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的每个数据列的名称。</summary>
<returns>数据列名称的集合。</returns>
</member>
<member name="M:System.Web.Helpers.WebGrid.Columns(System.Web.Helpers.WebGridColumn[])">
<summary>返回包含指定 <see cref="T:System.Web.Helpers.WebGridColumn" /> 实例的数组。</summary>
<returns>列的数组。</returns>
<param name="columnSet">
<see cref="T:System.Web.Helpers.WebGridColumn" /> 列实例的数量可变。</param>
</member>
<member name="P:System.Web.Helpers.WebGrid.FieldNamePrefix">
<summary>获取可应用于所有与 <see cref="T:System.Web.Helpers.WebGrid" /> 实例关联的查询字符串字段的前缀。</summary>
<returns>
<see cref="T:System.Web.Helpers.WebGrid" /> 实例的查询字符串字段前缀。</returns>
</member>
<member name="M:System.Web.Helpers.WebGrid.GetContainerUpdateScript(System.String)">
<summary>返回可用于在指定网页上更新与 <see cref="T:System.Web.Helpers.WebGrid" /> 实例关联的 HTML 元素的 JavaScript 语句。</summary>
<returns>可用于在网页上更新与 <see cref="T:System.Web.Helpers.WebGrid" /> 实例关联的 HTML 元素的 JavaScript 语句。</returns>
<param name="path">包含所更新的 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的网页 URL。此 URL 可以包括查询字符串参数。</param>
</member>
<member name="M:System.Web.Helpers.WebGrid.GetHtml(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.Boolean,System.Boolean,System.String,System.Collections.Generic.IEnumerable{System.Web.Helpers.WebGridColumn},System.Collections.Generic.IEnumerable{System.String},System.Web.Helpers.WebGridPagerModes,System.String,System.String,System.String,System.String,System.Int32,System.Object)">
<summary>返回用于呈现 <see cref="T:System.Web.Helpers.WebGrid" /> 实例并使用指定分页选项的 HTML 标记。</summary>
<returns>表示完全填充的 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的 HTML 标记。</returns>
<param name="tableStyle">用于设置整个表的样式的 CSS 类的名称。</param>
<param name="headerStyle">用于设置表标题样式的 CSS 类的名称。</param>
<param name="footerStyle">用于设置表脚注样式的 CSS 类的名称。</param>
<param name="rowStyle">用于设置每个表行样式的 CSS 类的名称。</param>
<param name="alternatingRowStyle">用于设置偶数表行样式的 CSS 类的名称。</param>
<param name="selectedRowStyle">用于设置选定表行样式的 CSS 类的名称。(一次只能选定一行。)</param>
<param name="caption">表标题。</param>
<param name="displayHeader">若要显示表标题,则为 true否则为 false。默认值为 true。</param>
<param name="fillEmptyRows">在没有足够数据项填充最后一页时,若要在最后一页中插入附加行,则为 true否则为 false。默认值为 false。附加行使用由 <paramref name="emptyRowCellValue" /> 参数指定的文本进行填充。</param>
<param name="emptyRowCellValue">在没有足够数据项填充最后一页时用于在页面中填充附加行的文本。必须将 <paramref name="fillEmptyRows" /> 参数设置为 true 才能显示这些附加行。</param>
<param name="columns">指定如何显示每列的 <see cref="T:System.Web.Helpers.WebGridColumn" /> 实例的集合。其中包括哪个数据列与每个网格列相关联,以及如何格式化每个网格列包含的数据值。</param>
<param name="exclusions">一个集合,其中包含在网格自动填充列时要排除的数据列的名称。</param>
<param name="mode">一种枚举值的按位组合,可用于指定相关方法,以便在 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的页面间进行切换。</param>
<param name="firstText">用于链接到 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的第一个页面的 HTML 链接元素的文本。必须设置 <paramref name="mode" /> 参数的 <see cref="F:System.Web.Helpers.WebGridPagerModes.FirstLast" /> 标记才能显示此页面导航元素。</param>
<param name="previousText">用于链接到 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的上一个页面的 HTML 链接元素的文本。必须设置 <paramref name="mode" /> 参数的 <see cref="F:System.Web.Helpers.WebGridPagerModes.NextPrevious" /> 标记才能显示此页面导航元素。</param>
<param name="nextText">用于链接到 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的下一个页面的 HTML 链接元素的文本。必须设置 <paramref name="mode" /> 参数的 <see cref="F:System.Web.Helpers.WebGridPagerModes.NextPrevious" /> 标记才能显示此页面导航元素。</param>
<param name="lastText">用于链接到 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的最后一个页面的 HTML 链接元素的文本。必须设置 <paramref name="mode" /> 参数的 <see cref="F:System.Web.Helpers.WebGridPagerModes.FirstLast" /> 标记才能显示此页面导航元素。</param>
<param name="numericLinksCount">提供给附近的 <see cref="T:System.Web.Helpers.WebGrid" /> 页的数字页链接的数量。每个数字页链接的文本都包含页码。必须设置 <paramref name="mode" /> 参数的 <see cref="F:System.Web.Helpers.WebGridPagerModes.Numeric" /> 标记才能显示这些页面导航元素。</param>
<param name="htmlAttributes">一个表示特性(名称和值)集合的对象,可针对表示 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的 HTML table 元素进行设置。</param>
</member>
<member name="M:System.Web.Helpers.WebGrid.GetPageUrl(System.Int32)">
<summary>返回可用于显示 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的指定数据页的 URL。</summary>
<returns>可用于显示网格的指定数据页的 URL。</returns>
<param name="pageIndex">要显示的 <see cref="T:System.Web.Helpers.WebGrid" /> 页的索引。</param>
</member>
<member name="M:System.Web.Helpers.WebGrid.GetSortUrl(System.String)">
<summary>返回可用于按指定列对 <see cref="T:System.Web.Helpers.WebGrid" /> 实例进行排序的 URL。</summary>
<returns>可用于对网格进行排序的 URL。</returns>
<param name="column">要作为排序依据的数据列的名称。</param>
</member>
<member name="P:System.Web.Helpers.WebGrid.HasSelection">
<summary>获取指示是否已选定 <see cref="T:System.Web.Helpers.WebGrid" /> 实例中的一行的值。</summary>
<returns>如果当前已选定一行,则为 true否则为 false。</returns>
</member>
<member name="P:System.Web.Helpers.WebGrid.IsAjaxEnabled">
<summary>返回一个值,用于指示 <see cref="T:System.Web.Helpers.WebGrid" /> 实例是否能够使用 Ajax 调用来刷新显示内容。</summary>
<returns>如果该实例支持 Ajax 调用,则为 true否则为 false。</returns>
</member>
<member name="P:System.Web.Helpers.WebGrid.PageCount">
<summary>获取 <see cref="T:System.Web.Helpers.WebGrid" /> 实例包含的页数。</summary>
<returns>页计数。</returns>
</member>
<member name="P:System.Web.Helpers.WebGrid.PageFieldName">
<summary>获取用于指定 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的当前页的查询字符串字段的全名。</summary>
<returns>用于指定网格的当前页的查询字符串字段的全名。</returns>
</member>
<member name="P:System.Web.Helpers.WebGrid.PageIndex">
<summary>获取或设置 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的当前页的索引。</summary>
<returns>当前页的索引。</returns>
</member>
<member name="M:System.Web.Helpers.WebGrid.Pager(System.Web.Helpers.WebGridPagerModes,System.String,System.String,System.String,System.String,System.Int32)">
<summary>返回用于为 <see cref="T:System.Web.Helpers.WebGrid" /> 实例提供指定分页支持的 HTML 标记。</summary>
<returns>为网格提供分页支持的 HTML 标记。</returns>
<param name="mode">一种枚举值的按位组合,可用于指定相关方法,以便在网格的页面间进行切换。默认值为 <see cref="F:System.Web.Helpers.WebGridPagerModes.NextPrevious" /> 和 <see cref="F:System.Web.Helpers.WebGridPagerModes.Numeric" /> 标记的按位或。</param>
<param name="firstText">可导航到网格第一个页面的 HTML 链接元素的文本。</param>
<param name="previousText">可导航到网格上一页面的 HTML 链接元素的文本。</param>
<param name="nextText">可导航到网格下一页面的 HTML 链接元素的文本。</param>
<param name="lastText">可导航到网格最后一个页面的 HTML 链接元素的文本。</param>
<param name="numericLinksCount">要显示的数字页链接的数量。默认值为 5。</param>
</member>
<member name="P:System.Web.Helpers.WebGrid.Rows">
<summary>对网格排序后,获取包含 <see cref="T:System.Web.Helpers.WebGrid" /> 实例当前页上相关行的列表。</summary>
<returns>行列表。</returns>
</member>
<member name="P:System.Web.Helpers.WebGrid.RowsPerPage">
<summary>获取在 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的每个页上显示的行的数量。</summary>
<returns>在网格的每个页上显示的行的数量。</returns>
</member>
<member name="P:System.Web.Helpers.WebGrid.SelectedIndex">
<summary>获取或设置相对于 <see cref="T:System.Web.Helpers.WebGrid" /> 实例当前页的选定行的索引。</summary>
<returns>相对于当前页的选定行的索引。</returns>
</member>
<member name="P:System.Web.Helpers.WebGrid.SelectedRow">
<summary>获取 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的当前选定行。</summary>
<returns>当前选定行。</returns>
</member>
<member name="P:System.Web.Helpers.WebGrid.SelectionFieldName">
<summary>获取用于指定 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的选定行的查询字符串字段的全名。</summary>
<returns>用于指定网格的选定行的查询字符串字段的全名。</returns>
</member>
<member name="P:System.Web.Helpers.WebGrid.SortColumn">
<summary>获取或设置作为 <see cref="T:System.Web.Helpers.WebGrid" /> 实例排序依据的数据列的名称。</summary>
<returns>用于对网格进行排序的数据列的名称。</returns>
</member>
<member name="P:System.Web.Helpers.WebGrid.SortDirection">
<summary>获取或设置 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的排序方向。</summary>
<returns>排序方向。</returns>
</member>
<member name="P:System.Web.Helpers.WebGrid.SortDirectionFieldName">
<summary>获取用于指定 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的排序方向的查询字符串字段的全名。</summary>
<returns>用于指定网格的排序方向的查询字符串字段的全名。</returns>
</member>
<member name="P:System.Web.Helpers.WebGrid.SortFieldName">
<summary>获取查询字符串字段(用于指定作为 <see cref="T:System.Web.Helpers.WebGrid" /> 实例排序依据的数据列的名称)的全名。</summary>
<returns>用于指定作为网格排序依据的数据列名称的查询字符串字段的全名。</returns>
</member>
<member name="M:System.Web.Helpers.WebGrid.Table(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.Boolean,System.Boolean,System.String,System.Collections.Generic.IEnumerable{System.Web.Helpers.WebGridColumn},System.Collections.Generic.IEnumerable{System.String},System.Func{System.Object,System.Object},System.Object)">
<summary>返回用于呈现 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的 HTML 标记。</summary>
<returns>表示完全填充的 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的 HTML 标记。</returns>
<param name="tableStyle">用于设置整个表的样式的 CSS 类的名称。</param>
<param name="headerStyle">用于设置表标题样式的 CSS 类的名称。</param>
<param name="footerStyle">用于设置表脚注样式的 CSS 类的名称。</param>
<param name="rowStyle">用于设置每个表行样式的 CSS 类的名称。</param>
<param name="alternatingRowStyle">用于设置偶数表行样式的 CSS 类的名称。</param>
<param name="selectedRowStyle">用于设置选定表行样式的 CSS 类的名称。</param>
<param name="caption">表标题。</param>
<param name="displayHeader">若要显示表标题,则为 true否则为 false。默认值为 true。</param>
<param name="fillEmptyRows">在没有足够数据项填充最后一页时,若要在最后一页中插入附加行,则为 true否则为 false。默认值为 false。附加行使用由 <paramref name="emptyRowCellValue" /> 参数指定的文本进行填充。</param>
<param name="emptyRowCellValue">在没有足够数据项填充最后一页时用于在最后一页中填充附加行的文本。必须将 <paramref name="fillEmptyRows" /> 参数设置为 true 才能显示这些附加行。</param>
<param name="columns">指定如何显示每列的 <see cref="T:System.Web.Helpers.WebGridColumn" /> 实例的集合。其中包括哪个数据列与每个网格列相关联,以及如何格式化每个网格列包含的数据值。</param>
<param name="exclusions">一个集合,其中包含在网格自动填充列时要排除的数据列的名称。</param>
<param name="footer">可返回用于呈现表脚注的 HTML 标记的函数。</param>
<param name="htmlAttributes">一个表示特性(名称和值)集合的对象,可针对表示 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的 HTML table 元素进行设置。</param>
</member>
<member name="P:System.Web.Helpers.WebGrid.TotalRowCount">
<summary>获取 <see cref="T:System.Web.Helpers.WebGrid" /> 实例包含的行的总数。</summary>
<returns>网格中的行的总数。此值包括每个页中的所有行,但不包括在没有足够数据项填充最后一页时插入到最后一页中的附加行。</returns>
</member>
<member name="T:System.Web.Helpers.WebGridColumn">
<summary>表示 <see cref="T:System.Web.Helpers.WebGrid" /> 实例中的一列。</summary>
</member>
<member name="M:System.Web.Helpers.WebGridColumn.#ctor">
<summary>初始化 <see cref="T:System.Web.Helpers.WebGridColumn" /> 类的新实例。</summary>
</member>
<member name="P:System.Web.Helpers.WebGridColumn.CanSort">
<summary>获取或设置指示是否可以对 <see cref="T:System.Web.Helpers.WebGrid" /> 列进行排序的值。</summary>
<returns>若指示可以对该列进行排序,则为 true否则为 false。</returns>
</member>
<member name="P:System.Web.Helpers.WebGridColumn.ColumnName">
<summary>获取或设置与 <see cref="T:System.Web.Helpers.WebGrid" /> 列关联的数据项的名称。</summary>
<returns>数据项的名称。</returns>
</member>
<member name="P:System.Web.Helpers.WebGridColumn.Format">
<summary>获取或设置一个函数,该函数用于设置与 <see cref="T:System.Web.Helpers.WebGrid" /> 列关联的数据项的格式。</summary>
<returns>用于设置与该列关联的数据项格式的函数。</returns>
</member>
<member name="P:System.Web.Helpers.WebGridColumn.Header">
<summary>获取或设置在 <see cref="T:System.Web.Helpers.WebGrid" /> 列的标题中呈现的文本。</summary>
<returns>呈现到列标题的文本。</returns>
</member>
<member name="P:System.Web.Helpers.WebGridColumn.Style">
<summary>获取或设置 CSS 类特性,该特性可以呈现为与 <see cref="T:System.Web.Helpers.WebGrid" /> 列关联的 HTML 表单元格的一部分。</summary>
<returns>应用于与该列关联的单元格的 CSS 类特性。</returns>
</member>
<member name="T:System.Web.Helpers.WebGridPagerModes">
<summary>指定标记,这些标记所描述的方法可用于在 <see cref="T:System.Web.Helpers.WebGrid" /> 实例的页面间进行切换。此枚举有一个 <see cref="T:System.FlagsAttribute" /> 特性,通过该特性可使其成员值按位组合。</summary>
</member>
<member name="F:System.Web.Helpers.WebGridPagerModes.All">
<summary>指示已提供在 <see cref="T:System.Web.Helpers.WebGrid" /> 页面间进行切换的所有方法。</summary>
</member>
<member name="F:System.Web.Helpers.WebGridPagerModes.FirstLast">
<summary>指示已提供可直接转到第一个或最后一个 <see cref="F:System.Web.Helpers.WebGrid" /> 页面的方法。</summary>
</member>
<member name="F:System.Web.Helpers.WebGridPagerModes.NextPrevious">
<summary>指示已提供可转到下一个或上一个 <see cref="F:System.Web.Helpers.WebGrid" /> 页面的方法。</summary>
</member>
<member name="F:System.Web.Helpers.WebGridPagerModes.Numeric">
<summary>指示已提供可通过使用页码转到附近的 <see cref="F:System.Web.Helpers.WebGrid" /> 页面的方法。</summary>
</member>
<member name="T:System.Web.Helpers.WebGridRow">
<summary>表示 <see cref="T:System.Web.Helpers.WebGrid" /> 实例中的一行。</summary>
</member>
<member name="M:System.Web.Helpers.WebGridRow.#ctor(System.Web.Helpers.WebGrid,System.Object,System.Int32)">
<summary>使用指定的 <see cref="T:System.Web.Helpers.WebGrid" /> 实例、行值和索引初始化 <see cref="T:System.Web.Helpers.WebGridRow" /> 类的新实例。</summary>
<param name="webGrid">包含该行的 <see cref="T:System.Web.Helpers.WebGrid" /> 实例。</param>
<param name="value">包含该行中每个值的属性成员的对象。</param>
<param name="rowIndex">该行的索引。</param>
</member>
<member name="M:System.Web.Helpers.WebGridRow.GetEnumerator">
<summary>返回一个可用于循环访问 <see cref="T:System.Web.Helpers.WebGridRow" /> 实例的值的枚举器。</summary>
<returns>可用于循环访问行的值的枚举器。</returns>
</member>
<member name="M:System.Web.Helpers.WebGridRow.GetSelectLink(System.String)">
<summary>返回可供用户用来选择行的 HTML 元素(链接)。</summary>
<returns>允许用户通过单击方式来选择行的链接。</returns>
<param name="text">链接元素的内部文本。如果 <paramref name="text" /> 为空或 null则使用“Select”。</param>
</member>
<member name="M:System.Web.Helpers.WebGridRow.GetSelectUrl">
<summary>返回可用于选择行的 URL。</summary>
<returns>用于选择行的 URL。</returns>
</member>
<member name="P:System.Web.Helpers.WebGridRow.Item(System.Int32)">
<summary>返回 <see cref="T:System.Web.Helpers.WebGridRow" /> 实例中指定索引处的值。</summary>
<returns>指定索引处的值。</returns>
<param name="index">该行中要返回的值的从零开始的索引。</param>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> 小于 0或大于等于行中值的数量。</exception>
</member>
<member name="P:System.Web.Helpers.WebGridRow.Item(System.String)">
<summary>返回在 <see cref="T:System.Web.Helpers.WebGridRow" /> 实例中具有指定名称的值。</summary>
<returns>指定值。</returns>
<param name="name">该行中要返回的值的名称。</param>
<exception cref="T:System.ArgumentException">
<paramref name="name" /> 为 Nothing 或空。</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="name" /> 指定不存在的值。</exception>
</member>
<member name="M:System.Web.Helpers.WebGridRow.System#Collections#IEnumerable#GetEnumerator">
<summary>返回一个可用于循环访问集合的枚举器。</summary>
<returns>一个可用于循环访问集合的枚举器。</returns>
</member>
<member name="M:System.Web.Helpers.WebGridRow.ToString">
<summary>返回一个表示 <see cref="T:System.Web.Helpers.WebGridRow" /> 实例的所有值的字符串。</summary>
<returns>表示行的值的字符串。</returns>
</member>
<member name="M:System.Web.Helpers.WebGridRow.TryGetMember(System.Dynamic.GetMemberBinder,System.Object@)">
<summary>返回指定联编程序所描述的 <see cref="T:System.Web.Helpers.WebGridRow" /> 成员的值。</summary>
<returns>如果成功检索了项的值,则为 true否则为 false。</returns>
<param name="binder">已绑定的属性成员的 getter。</param>
<param name="result">此方法返回时,其中包含的对象保留了 <paramref name="binder" /> 所描述的项的值。该参数未经初始化即被传递。</param>
</member>
<member name="P:System.Web.Helpers.WebGridRow.Value">
<summary>获取包含该行中每个值的属性成员的对象。</summary>
<returns>以属性的形式包含该行中每个值的对象。</returns>
</member>
<member name="P:System.Web.Helpers.WebGridRow.WebGrid">
<summary>获取该行所属的 <see cref="T:System.Web.Helpers.WebGrid" /> 实例。</summary>
<returns>包含该行的 <see cref="T:System.Web.Helpers.WebGrid" /> 实例。</returns>
</member>
<member name="T:System.Web.Helpers.WebImage">
<summary>表示用于显示和管理网页中图像的对象。</summary>
</member>
<member name="M:System.Web.Helpers.WebImage.#ctor(System.Byte[])">
<summary>使用可表示图像的字节数组来初始化 <see cref="T:System.Web.Helpers.WebImage" /> 类的新实例。</summary>
<param name="content">图像。</param>
</member>
<member name="M:System.Web.Helpers.WebImage.#ctor(System.IO.Stream)">
<summary>使用可表示图像的流来初始化 <see cref="T:System.Web.Helpers.WebImage" /> 类的新实例。</summary>
<param name="imageStream">图像。</param>
</member>
<member name="M:System.Web.Helpers.WebImage.#ctor(System.String)">
<summary>使用可表示图像位置的路径来初始化 <see cref="T:System.Web.Helpers.WebImage" /> 类的新实例。</summary>
<param name="filePath">包含图像的文件的路径。</param>
</member>
<member name="M:System.Web.Helpers.WebImage.AddImageWatermark(System.String,System.Int32,System.Int32,System.String,System.String,System.Int32,System.Int32)">
<summary>使用水印图像的路径添加水印图像。</summary>
<returns>打了水印的图像。</returns>
<param name="watermarkImageFilePath">包含水印图像的文件的路径。</param>
<param name="width">水印图像的宽度(以像素为单位)。</param>
<param name="height">水印图像的高度(以像素为单位)。</param>
<param name="horizontalAlign">水印图像的水平对齐。值可以为“靠左”、“靠右”或“居中”。</param>
<param name="verticalAlign">水印图像的垂直对齐。值可以为“靠上”、“居中”或“靠下”。</param>
<param name="opacity">水印图像的不透明度,已指定为 0 和 100 之间的某个值。</param>
<param name="padding">水印图像周围的边距的大小(以像素为单位)。</param>
</member>
<member name="M:System.Web.Helpers.WebImage.AddImageWatermark(System.Web.Helpers.WebImage,System.Int32,System.Int32,System.String,System.String,System.Int32,System.Int32)">
<summary>使用指定图像对象添加水印图像。</summary>
<returns>打了水印的图像。</returns>
<param name="watermarkImage">
<see cref="T:System.Web.Helpers.WebImage" /> 对象。</param>
<param name="width">水印图像的宽度(以像素为单位)。</param>
<param name="height">水印图像的高度(以像素为单位)。</param>
<param name="horizontalAlign">水印图像的水平对齐。值可以为“靠左”、“靠右”或“居中”。</param>
<param name="verticalAlign">水印图像的垂直对齐。值可以为“靠上”、“居中”或“靠下”。</param>
<param name="opacity">水印图像的不透明度,已指定为 0 和 100 之间的某个值。</param>
<param name="padding">水印图像周围的边距的大小(以像素为单位)。</param>
</member>
<member name="M:System.Web.Helpers.WebImage.AddTextWatermark(System.String,System.String,System.Int32,System.String,System.String,System.String,System.String,System.Int32,System.Int32)">
<summary>在图像中添加水印文本。</summary>
<returns>打了水印的图像。</returns>
<param name="text">要用作水印的文本。</param>
<param name="fontColor">水印文本的颜色。</param>
<param name="fontSize">水印文本的字体大小。</param>
<param name="fontStyle">水印文本的字体样式。</param>
<param name="fontFamily">水印文本的字体类型。</param>
<param name="horizontalAlign">水印文本的水平对齐。值可以为“靠左”、“靠右”或“居中”。</param>
<param name="verticalAlign">水印文本的垂直对齐。值可以为“靠上”、“居中”或“靠下”。</param>
<param name="opacity">水印图像的不透明度,已指定为 0 和 100 之间的某个值。</param>
<param name="padding">水印文本周围的边距的大小(以像素为单位)。</param>
</member>
<member name="M:System.Web.Helpers.WebImage.Clone">
<summary>复制 <see cref="T:System.Web.Helpers.WebImage" /> 对象。</summary>
<returns>图像。</returns>
</member>
<member name="M:System.Web.Helpers.WebImage.Crop(System.Int32,System.Int32,System.Int32,System.Int32)">
<summary>剪切图像。</summary>
<returns>剪切的图像。</returns>
<param name="top">要从顶部删除的像素数。</param>
<param name="left">要从左侧删除的像素数。</param>
<param name="bottom">要从底部删除的像素数。</param>
<param name="right">要从右侧删除的像素数。</param>
</member>
<member name="P:System.Web.Helpers.WebImage.FileName">
<summary>获取或设置 <see cref="T:System.Web.Helpers.WebImage" /> 对象的文件名。</summary>
<returns>文件名。</returns>
</member>
<member name="M:System.Web.Helpers.WebImage.FlipHorizontal">
<summary>水平翻转图像。</summary>
<returns>翻转的图像。</returns>
</member>
<member name="M:System.Web.Helpers.WebImage.FlipVertical">
<summary>垂直翻转图像。</summary>
<returns>翻转的图像。</returns>
</member>
<member name="M:System.Web.Helpers.WebImage.GetBytes(System.String)">
<summary>以字节数组形式返回图像。</summary>
<returns>图像。</returns>
<param name="requestedFormat">
<see cref="T:System.Web.Helpers.WebImage" /> 对象的 <see cref="P:System.Web.Helpers.WebImage.ImageFormat" /> 值。</param>
</member>
<member name="M:System.Web.Helpers.WebImage.GetImageFromRequest(System.String)">
<summary>返回已使用浏览器上载的图像。</summary>
<returns>图像。</returns>
<param name="postedFileName">(可选)已发布的文件的名称。如果未指定文件名,将返回第一个上载的文件。</param>
</member>
<member name="P:System.Web.Helpers.WebImage.Height">
<summary>获取图像的高度(以像素为单位)。</summary>
<returns>高度。</returns>
</member>
<member name="P:System.Web.Helpers.WebImage.ImageFormat">
<summary>获取图像的格式例如“jpeg”或“png”。</summary>
<returns>图像的文件格式。</returns>
</member>
<member name="M:System.Web.Helpers.WebImage.Resize(System.Int32,System.Int32,System.Boolean,System.Boolean)">
<summary>调整图像大小。</summary>
<returns>已调整大小的图像。</returns>
<param name="width">
<see cref="T:System.Web.Helpers.WebImage" /> 对象的宽度(以像素为单位)。</param>
<param name="height">
<see cref="T:System.Web.Helpers.WebImage" /> 对象的高度(以像素为单位)。</param>
<param name="preserveAspectRatio">若要保留图像的纵横比,则为 true否则为 false。</param>
<param name="preventEnlarge">若要防止放大图像,则为 true否则为 false。</param>
</member>
<member name="M:System.Web.Helpers.WebImage.RotateLeft">
<summary>将图像旋转到左侧。</summary>
<returns>已旋转的图像。</returns>
</member>
<member name="M:System.Web.Helpers.WebImage.RotateRight">
<summary>将图像旋转到右侧。</summary>
<returns>已旋转的图像。</returns>
</member>
<member name="M:System.Web.Helpers.WebImage.Save(System.String,System.String,System.Boolean)">
<summary>使用指定文件名保存图像。</summary>
<returns>图像。</returns>
<param name="filePath">用于保存图像的路径。</param>
<param name="imageFormat">保存图像文件时要使用的格式如“gif”或“png”。</param>
<param name="forceCorrectExtension">若要对 <paramref name="imageFormat" /> 中指定的格式强制使用正确的文件名扩展名,则为 true否则为 false。如果文件类型与指定文件名扩展名不匹配且 <paramref name="forceCorrectExtension" /> 为 true则会将正确的扩展名附加到文件名后面。例如名为 Photograph.txt 的 PNG 文件将使用名称 Photograph.txt.png 进行保存。</param>
</member>
<member name="P:System.Web.Helpers.WebImage.Width">
<summary>获取图像的宽度(以像素为单位)。</summary>
<returns>宽度。</returns>
</member>
<member name="M:System.Web.Helpers.WebImage.Write(System.String)">
<summary>将图像呈现到浏览器。</summary>
<returns>图像。</returns>
<param name="requestedFormat">(可选)写入图像时要使用的文件格式。</param>
</member>
<member name="T:System.Web.Helpers.WebMail">
<summary>提供使用简单邮件传输协议 (SMTP) 构建并发送电子邮件的方法。</summary>
</member>
<member name="P:System.Web.Helpers.WebMail.EnableSsl">
<summary>获取或设置一个值,该值指示在发送电子邮件时是否使用安全套接字层 (SSL) 来加密连接。</summary>
<returns>如果使用 SSL 来加密连接,则为 true否则为 false。</returns>
</member>
<member name="P:System.Web.Helpers.WebMail.From">
<summary>获取或设置发件人的电子邮件地址。</summary>
<returns>发件人的电子邮件地址。</returns>
</member>
<member name="P:System.Web.Helpers.WebMail.Password">
<summary>获取或设置发件人的电子邮件帐户的密码。</summary>
<returns>发件人的密码。</returns>
</member>
<member name="M:System.Web.Helpers.WebMail.Send(System.String,System.String,System.String,System.String,System.String,System.Collections.Generic.IEnumerable{System.String},System.Boolean,System.Collections.Generic.IEnumerable{System.String},System.String,System.String,System.String,System.String,System.String)">
<summary>将指定邮件发送到进行传递的 SMTP 服务器。</summary>
<param name="to">收件人的电子邮件地址。使用分号 (;) 分隔多名收件人。</param>
<param name="subject">电子邮件的主题行。</param>
<param name="body">电子邮件的正文。如果 <paramref name="isBodyHtml" /> 为 true则将正文中的 HTML 解释为标记。</param>
<param name="from">(可选)邮件发件人的电子邮件地址;如果不指定发送人,则为 null。默认值为 null。</param>
<param name="cc">(可选)向其发送邮件副本的其他收件人的电子邮件地址;如果没有其他收件人,则为 null。使用分号 (;) 分隔多名收件人。默认值为 null。</param>
<param name="filesToAttach">(可选)文件名的集合,用于指定要附加到电子邮件中的文件;如果没有要附加的文件,则为 null。默认值为 null。</param>
<param name="isBodyHtml">(可选)若为 true则指定电子邮件正文为 HTML 格式;若为 false则指示正文为纯文本格式。默认值为 true。</param>
<param name="additionalHeaders">(可选)标头的集合,可添加到此电子邮件包含的正常 SMTP 标头中;如果不发送其他标头,则为 null。默认值为 null。</param>
<param name="bcc">(可选)向其发送邮件“密送”副本的其他收件人的电子邮件地址;如果没有其他收件人,则为 null。使用分号 (;) 分隔多名收件人。默认值为 null。</param>
<param name="contentEncoding">(可选)用于邮件正文的编码。可能值为 <see cref="T:System.Text.Encoding" /> 类的属性值,如 <see cref="P:System.Text.Encoding.UTF8" />。默认值为 null。</param>
<param name="headerEncoding">(可选)用于邮件标题的编码。可能值为 <see cref="T:System.Text.Encoding" /> 类的属性值,如 <see cref="P:System.Text.Encoding.UTF8" />。默认值为 null。</param>
<param name="priority">(可选)用于指定邮件优先级的值(“常规”、“低”、“高”)。默认值为“常规”。</param>
<param name="replyTo">(可选)收件人回复邮件时将使用的电子邮件地址。默认值为 null表示回复地址为 From 属性的值。</param>
</member>
<member name="P:System.Web.Helpers.WebMail.SmtpPort">
<summary>获取或设置用于 SMTP 事务的端口。</summary>
<returns>用于 SMTP 事务的端口。</returns>
</member>
<member name="P:System.Web.Helpers.WebMail.SmtpServer">
<summary>获取或设置用于传送电子邮件的 SMTP 服务器的名称。</summary>
<returns>SMTP 服务器。</returns>
</member>
<member name="P:System.Web.Helpers.WebMail.SmtpUseDefaultCredentials">
<summary>获取或设置指示是否与请求一起发送默认凭据的值。</summary>
<returns>如果与邮件一起发送凭据,则为 true否则为 false。</returns>
</member>
<member name="P:System.Web.Helpers.WebMail.UserName">
<summary>获取或设置用于发送电子邮件的电子邮件帐户名。</summary>
<returns>用户帐户的名称。</returns>
</member>
</members>
</doc>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<ReferenceGroup xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ID="8fdadb96-e9f6-4bb9-ae98-9828dca06b86" xmlns="urn:schemas-microsoft-com:xml-wcfservicemap">
<ClientOptions>
<GenerateAsynchronousMethods>false</GenerateAsynchronousMethods>
<GenerateTaskBasedAsynchronousMethod>true</GenerateTaskBasedAsynchronousMethod>
<EnableDataBinding>true</EnableDataBinding>
<ExcludedTypes />
<ImportXmlTypes>false</ImportXmlTypes>
<GenerateInternalTypes>false</GenerateInternalTypes>
<GenerateMessageContracts>false</GenerateMessageContracts>
<NamespaceMappings />
<CollectionMappings />
<GenerateSerializableTypes>true</GenerateSerializableTypes>
<Serializer>Auto</Serializer>
<UseSerializerForFaults>true</UseSerializerForFaults>
<ReferenceAllAssemblies>true</ReferenceAllAssemblies>
<ReferencedAssemblies />
<ReferencedDataContractTypes />
<ServiceContractMappings />
</ClientOptions>
<MetadataSources>
<MetadataSource Address="http://pms.boonlive-rcu.com:89/blwws.asmx" Protocol="http" SourceId="1" />
</MetadataSources>
<Metadata>
<MetadataFile FileName="blwws.disco" MetadataType="Disco" ID="b59debda-a4b8-4b03-9fec-729fa926c54d" SourceId="1" SourceUrl="http://pms.boonlive-rcu.com:89/blwws.asmx?disco" />
<MetadataFile FileName="blwws.wsdl" MetadataType="Wsdl" ID="034b71b0-7d46-4c75-85a9-5488d35a568c" SourceId="1" SourceUrl="http://pms.boonlive-rcu.com:89/blwws.asmx?wsdl" />
</Metadata>
<Extensions>
<ExtensionFile FileName="configuration91.svcinfo" Name="configuration91.svcinfo" />
<ExtensionFile FileName="configuration.svcinfo" Name="configuration.svcinfo" />
</Extensions>
</ReferenceGroup>

View File

@@ -0,0 +1,444 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
using System.Web.Http.Description;
using System.Xml.Linq;
using Newtonsoft.Json;
namespace PTS_API_V1.Areas.HelpPage
{
/// <summary>
/// This class will generate the samples for the help page.
/// </summary>
public class HelpPageSampleGenerator
{
/// <summary>
/// Initializes a new instance of the <see cref="HelpPageSampleGenerator"/> class.
/// </summary>
public HelpPageSampleGenerator()
{
ActualHttpMessageTypes = new Dictionary<HelpPageSampleKey, Type>();
ActionSamples = new Dictionary<HelpPageSampleKey, object>();
SampleObjects = new Dictionary<Type, object>();
SampleObjectFactories = new List<Func<HelpPageSampleGenerator, Type, object>>
{
DefaultSampleObjectFactory,
};
}
/// <summary>
/// Gets CLR types that are used as the content of <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/>.
/// </summary>
public IDictionary<HelpPageSampleKey, Type> ActualHttpMessageTypes { get; internal set; }
/// <summary>
/// Gets the objects that are used directly as samples for certain actions.
/// </summary>
public IDictionary<HelpPageSampleKey, object> ActionSamples { get; internal set; }
/// <summary>
/// Gets the objects that are serialized as samples by the supported formatters.
/// </summary>
public IDictionary<Type, object> SampleObjects { get; internal set; }
/// <summary>
/// Gets factories for the objects that the supported formatters will serialize as samples. Processed in order,
/// stopping when the factory successfully returns a non-<see langref="null"/> object.
/// </summary>
/// <remarks>
/// Collection includes just <see cref="ObjectGenerator.GenerateObject(Type)"/> initially. Use
/// <code>SampleObjectFactories.Insert(0, func)</code> to provide an override and
/// <code>SampleObjectFactories.Add(func)</code> to provide a fallback.</remarks>
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures",
Justification = "This is an appropriate nesting of generic types")]
public IList<Func<HelpPageSampleGenerator, Type, object>> SampleObjectFactories { get; private set; }
/// <summary>
/// Gets the request body samples for a given <see cref="ApiDescription"/>.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <returns>The samples keyed by media type.</returns>
public IDictionary<MediaTypeHeaderValue, object> GetSampleRequests(ApiDescription api)
{
return GetSample(api, SampleDirection.Request);
}
/// <summary>
/// Gets the response body samples for a given <see cref="ApiDescription"/>.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <returns>The samples keyed by media type.</returns>
public IDictionary<MediaTypeHeaderValue, object> GetSampleResponses(ApiDescription api)
{
return GetSample(api, SampleDirection.Response);
}
/// <summary>
/// Gets the request or response body samples.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param>
/// <returns>The samples keyed by media type.</returns>
public virtual IDictionary<MediaTypeHeaderValue, object> GetSample(ApiDescription api, SampleDirection sampleDirection)
{
if (api == null)
{
throw new ArgumentNullException("api");
}
string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName;
string actionName = api.ActionDescriptor.ActionName;
IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name);
Collection<MediaTypeFormatter> formatters;
Type type = ResolveType(api, controllerName, actionName, parameterNames, sampleDirection, out formatters);
var samples = new Dictionary<MediaTypeHeaderValue, object>();
// Use the samples provided directly for actions
var actionSamples = GetAllActionSamples(controllerName, actionName, parameterNames, sampleDirection);
foreach (var actionSample in actionSamples)
{
samples.Add(actionSample.Key.MediaType, WrapSampleIfString(actionSample.Value));
}
// Do the sample generation based on formatters only if an action doesn't return an HttpResponseMessage.
// Here we cannot rely on formatters because we don't know what's in the HttpResponseMessage, it might not even use formatters.
if (type != null && !typeof(HttpResponseMessage).IsAssignableFrom(type))
{
object sampleObject = GetSampleObject(type);
foreach (var formatter in formatters)
{
foreach (MediaTypeHeaderValue mediaType in formatter.SupportedMediaTypes)
{
if (!samples.ContainsKey(mediaType))
{
object sample = GetActionSample(controllerName, actionName, parameterNames, type, formatter, mediaType, sampleDirection);
// If no sample found, try generate sample using formatter and sample object
if (sample == null && sampleObject != null)
{
sample = WriteSampleObjectUsingFormatter(formatter, sampleObject, type, mediaType);
}
samples.Add(mediaType, WrapSampleIfString(sample));
}
}
}
}
return samples;
}
/// <summary>
/// Search for samples that are provided directly through <see cref="ActionSamples"/>.
/// </summary>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
/// <param name="type">The CLR type.</param>
/// <param name="formatter">The formatter.</param>
/// <param name="mediaType">The media type.</param>
/// <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param>
/// <returns>The sample that matches the parameters.</returns>
public virtual object GetActionSample(string controllerName, string actionName, IEnumerable<string> parameterNames, Type type, MediaTypeFormatter formatter, MediaTypeHeaderValue mediaType, SampleDirection sampleDirection)
{
object sample;
// First, try to get the sample provided for the specified mediaType, sampleDirection, controllerName, actionName and parameterNames.
// If not found, try to get the sample provided for the specified mediaType, sampleDirection, controllerName and actionName regardless of the parameterNames.
// If still not found, try to get the sample provided for the specified mediaType and type.
// Finally, try to get the sample provided for the specified mediaType.
if (ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, parameterNames), out sample) ||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, new[] { "*" }), out sample) ||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, type), out sample) ||
ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType), out sample))
{
return sample;
}
return null;
}
/// <summary>
/// Gets the sample object that will be serialized by the formatters.
/// First, it will look at the <see cref="SampleObjects"/>. If no sample object is found, it will try to create
/// one using <see cref="DefaultSampleObjectFactory"/> (which wraps an <see cref="ObjectGenerator"/>) and other
/// factories in <see cref="SampleObjectFactories"/>.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>The sample object.</returns>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes",
Justification = "Even if all items in SampleObjectFactories throw, problem will be visible as missing sample.")]
public virtual object GetSampleObject(Type type)
{
object sampleObject;
if (!SampleObjects.TryGetValue(type, out sampleObject))
{
// No specific object available, try our factories.
foreach (Func<HelpPageSampleGenerator, Type, object> factory in SampleObjectFactories)
{
if (factory == null)
{
continue;
}
try
{
sampleObject = factory(this, type);
if (sampleObject != null)
{
break;
}
}
catch
{
// Ignore any problems encountered in the factory; go on to the next one (if any).
}
}
}
return sampleObject;
}
/// <summary>
/// Resolves the actual type of <see cref="System.Net.Http.ObjectContent{T}"/> passed to the <see cref="System.Net.Http.HttpRequestMessage"/> in an action.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <returns>The type.</returns>
public virtual Type ResolveHttpRequestMessageType(ApiDescription api)
{
string controllerName = api.ActionDescriptor.ControllerDescriptor.ControllerName;
string actionName = api.ActionDescriptor.ActionName;
IEnumerable<string> parameterNames = api.ParameterDescriptions.Select(p => p.Name);
Collection<MediaTypeFormatter> formatters;
return ResolveType(api, controllerName, actionName, parameterNames, SampleDirection.Request, out formatters);
}
/// <summary>
/// Resolves the type of the action parameter or return value when <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/> is used.
/// </summary>
/// <param name="api">The <see cref="ApiDescription"/>.</param>
/// <param name="controllerName">Name of the controller.</param>
/// <param name="actionName">Name of the action.</param>
/// <param name="parameterNames">The parameter names.</param>
/// <param name="sampleDirection">The value indicating whether the sample is for a request or a response.</param>
/// <param name="formatters">The formatters.</param>
[SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", Justification = "This is only used in advanced scenarios.")]
public virtual Type ResolveType(ApiDescription api, string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection, out Collection<MediaTypeFormatter> formatters)
{
if (!Enum.IsDefined(typeof(SampleDirection), sampleDirection))
{
throw new InvalidEnumArgumentException("sampleDirection", (int)sampleDirection, typeof(SampleDirection));
}
if (api == null)
{
throw new ArgumentNullException("api");
}
Type type;
if (ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, parameterNames), out type) ||
ActualHttpMessageTypes.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, new[] { "*" }), out type))
{
// Re-compute the supported formatters based on type
Collection<MediaTypeFormatter> newFormatters = new Collection<MediaTypeFormatter>();
foreach (var formatter in api.ActionDescriptor.Configuration.Formatters)
{
if (IsFormatSupported(sampleDirection, formatter, type))
{
newFormatters.Add(formatter);
}
}
formatters = newFormatters;
}
else
{
switch (sampleDirection)
{
case SampleDirection.Request:
ApiParameterDescription requestBodyParameter = api.ParameterDescriptions.FirstOrDefault(p => p.Source == ApiParameterSource.FromBody);
type = requestBodyParameter == null ? null : requestBodyParameter.ParameterDescriptor.ParameterType;
formatters = api.SupportedRequestBodyFormatters;
break;
case SampleDirection.Response:
default:
type = api.ResponseDescription.ResponseType ?? api.ResponseDescription.DeclaredType;
formatters = api.SupportedResponseFormatters;
break;
}
}
return type;
}
/// <summary>
/// Writes the sample object using formatter.
/// </summary>
/// <param name="formatter">The formatter.</param>
/// <param name="value">The value.</param>
/// <param name="type">The type.</param>
/// <param name="mediaType">Type of the media.</param>
/// <returns></returns>
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The exception is recorded as InvalidSample.")]
public virtual object WriteSampleObjectUsingFormatter(MediaTypeFormatter formatter, object value, Type type, MediaTypeHeaderValue mediaType)
{
if (formatter == null)
{
throw new ArgumentNullException("formatter");
}
if (mediaType == null)
{
throw new ArgumentNullException("mediaType");
}
object sample = String.Empty;
MemoryStream ms = null;
HttpContent content = null;
try
{
if (formatter.CanWriteType(type))
{
ms = new MemoryStream();
content = new ObjectContent(type, value, formatter, mediaType);
formatter.WriteToStreamAsync(type, value, ms, content, null).Wait();
ms.Position = 0;
StreamReader reader = new StreamReader(ms);
string serializedSampleString = reader.ReadToEnd();
if (mediaType.MediaType.ToUpperInvariant().Contains("XML"))
{
serializedSampleString = TryFormatXml(serializedSampleString);
}
else if (mediaType.MediaType.ToUpperInvariant().Contains("JSON"))
{
serializedSampleString = TryFormatJson(serializedSampleString);
}
sample = new TextSample(serializedSampleString);
}
else
{
sample = new InvalidSample(String.Format(
CultureInfo.CurrentCulture,
"Failed to generate the sample for media type '{0}'. Cannot use formatter '{1}' to write type '{2}'.",
mediaType,
formatter.GetType().Name,
type.Name));
}
}
catch (Exception e)
{
sample = new InvalidSample(String.Format(
CultureInfo.CurrentCulture,
"An exception has occurred while using the formatter '{0}' to generate sample for media type '{1}'. Exception message: {2}",
formatter.GetType().Name,
mediaType.MediaType,
UnwrapException(e).Message));
}
finally
{
if (ms != null)
{
ms.Dispose();
}
if (content != null)
{
content.Dispose();
}
}
return sample;
}
internal static Exception UnwrapException(Exception exception)
{
AggregateException aggregateException = exception as AggregateException;
if (aggregateException != null)
{
return aggregateException.Flatten().InnerException;
}
return exception;
}
// Default factory for sample objects
private static object DefaultSampleObjectFactory(HelpPageSampleGenerator sampleGenerator, Type type)
{
// Try to create a default sample object
ObjectGenerator objectGenerator = new ObjectGenerator();
return objectGenerator.GenerateObject(type);
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
private static string TryFormatJson(string str)
{
try
{
object parsedJson = JsonConvert.DeserializeObject(str);
return JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
}
catch
{
// can't parse JSON, return the original string
return str;
}
}
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
private static string TryFormatXml(string str)
{
try
{
XDocument xml = XDocument.Parse(str);
return xml.ToString();
}
catch
{
// can't parse XML, return the original string
return str;
}
}
private static bool IsFormatSupported(SampleDirection sampleDirection, MediaTypeFormatter formatter, Type type)
{
switch (sampleDirection)
{
case SampleDirection.Request:
return formatter.CanReadType(type);
case SampleDirection.Response:
return formatter.CanWriteType(type);
}
return false;
}
private IEnumerable<KeyValuePair<HelpPageSampleKey, object>> GetAllActionSamples(string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection)
{
HashSet<string> parameterNamesSet = new HashSet<string>(parameterNames, StringComparer.OrdinalIgnoreCase);
foreach (var sample in ActionSamples)
{
HelpPageSampleKey sampleKey = sample.Key;
if (String.Equals(controllerName, sampleKey.ControllerName, StringComparison.OrdinalIgnoreCase) &&
String.Equals(actionName, sampleKey.ActionName, StringComparison.OrdinalIgnoreCase) &&
(sampleKey.ParameterNames.SetEquals(new[] { "*" }) || parameterNamesSet.SetEquals(sampleKey.ParameterNames)) &&
sampleDirection == sampleKey.SampleDirection)
{
yield return sample;
}
}
}
private static object WrapSampleIfString(object sample)
{
string stringSample = sample as string;
if (stringSample != null)
{
return new TextSample(stringSample);
}
return sample;
}
}
}

View File

@@ -0,0 +1,27 @@
using System.Web;
using System.Web.Optimization;
namespace BLV_API
{
public class BundleConfig
{
// 有关捆绑的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
// 使用要用于开发和学习的 Modernizr 的开发版本。然后,当你做好
// 生产准备就绪,请使用 https://modernizr.com 上的生成工具仅选择所需的测试。
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
}
}
}

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!-- If system.codedom tag is absent -->
<system.codedom xdt:Transform="InsertIfMissing">
</system.codedom>
<!-- If compilers tag is absent -->
<system.codedom>
<compilers xdt:Transform="InsertIfMissing">
</compilers>
</system.codedom>
<!-- If a .cs compiler is already present, the existing entry needs to be removed before inserting the new entry -->
<system.codedom>
<compilers>
<compiler
extension=".cs"
xdt:Transform="Remove"
xdt:Locator="Match(extension)" />
</compilers>
</system.codedom>
<!-- Inserting the new compiler -->
<system.codedom>
<compilers>
<compiler
language="c#;cs;csharp"
extension=".cs"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4"
compilerOptions="/langversion:default /nowarn:1659;1699;1701"
xdt:Transform="Insert" />
</compilers>
</system.codedom>
<!-- If a .vb compiler is already present, the existing entry needs to be removed before inserting the new entry -->
<system.codedom>
<compilers>
<compiler
extension=".vb"
xdt:Transform="Remove"
xdt:Locator="Match(extension)" />
</compilers>
</system.codedom>
<!-- Inserting the new compiler -->
<system.codedom>
<compilers>
<compiler
language="vb;vbs;visualbasic;vbscript"
extension=".vb"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4"
compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"
xdt:Transform="Insert" />
</compilers>
</system.codedom>
</configuration>

View File

@@ -0,0 +1,22 @@
@using System.Web.Http
@using $rootnamespace$.Areas.HelpPage.Models
@model HelpPageApiModel
@{
var description = Model.ApiDescription;
ViewBag.Title = description.HttpMethod.Method + " " + description.RelativePath;
}
<link type="text/css" href="~/Areas/HelpPage/HelpPage.css" rel="stylesheet" />
<div id="body" class="help-page">
<section class="featured">
<div class="content-wrapper">
<p>
@Html.ActionLink("Help Page Home", "Index")
</p>
</div>
</section>
<section class="content-wrapper main-content clear-fix">
@Html.DisplayForModel()
</section>
</div>

View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
https://go.microsoft.com/fwlink/?LinkId=301879
-->
<configuration>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="connectionString" value="Data Source=WINDOWS2008R2\BLW;Initial Catalog=RICS_WS;User ID=sa;Password=pass@123$%^;"/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.8" />
<httpRuntime targetFramework="4.8" />
</system.web>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers>
</system.codedom>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="blwwsSoap" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://pms.boonlive-rcu.com:89/blwws.asmx"
binding="basicHttpBinding" bindingConfiguration="blwwsSoap"
contract="ServiceReference1.blwwsSoap" name="blwwsSoap" />
</client>
</system.serviceModel>
</configuration>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="ChangePhoneNumberResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>BLV_API.ServiceReference1.ChangePhoneNumberResponse, Connected Services.ServiceReference1.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="CheckIn2Response" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>BLV_API.ServiceReference1.CheckIn2Response, Connected Services.ServiceReference1.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using Web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=301874 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
在下例中“SetAttributes”转换将更改
“connectionString”的值仅在“Match”定位器找到值为“MyDB”的
特性“name”时使用“ReleaseSQLServer”。
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<!--
在以下示例中,"Replace" 转换将替换 Web.config 文件的
整个 <customErrors> 节。
请注意,由于在 <system.web> 节点下只有一个
customErrors 节,因此无需使用 "xdt:Locator" 属性。
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>

View File

@@ -0,0 +1,17 @@
body {
padding-top: 50px;
padding-bottom: 20px;
}
/* Set padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}
/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
max-width: 280px;
}

View File

@@ -0,0 +1,451 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Reflection;
using System.Runtime.Serialization;
using System.Web.Http;
using System.Web.Http.Description;
using System.Xml.Serialization;
using Newtonsoft.Json;
namespace PTS_API_V1.Areas.HelpPage.ModelDescriptions
{
/// <summary>
/// Generates model descriptions for given types.
/// </summary>
public class ModelDescriptionGenerator
{
// Modify this to support more data annotation attributes.
private readonly IDictionary<Type, Func<object, string>> AnnotationTextGenerator = new Dictionary<Type, Func<object, string>>
{
{ typeof(RequiredAttribute), a => "Required" },
{ typeof(RangeAttribute), a =>
{
RangeAttribute range = (RangeAttribute)a;
return String.Format(CultureInfo.CurrentCulture, "Range: inclusive between {0} and {1}", range.Minimum, range.Maximum);
}
},
{ typeof(MaxLengthAttribute), a =>
{
MaxLengthAttribute maxLength = (MaxLengthAttribute)a;
return String.Format(CultureInfo.CurrentCulture, "Max length: {0}", maxLength.Length);
}
},
{ typeof(MinLengthAttribute), a =>
{
MinLengthAttribute minLength = (MinLengthAttribute)a;
return String.Format(CultureInfo.CurrentCulture, "Min length: {0}", minLength.Length);
}
},
{ typeof(StringLengthAttribute), a =>
{
StringLengthAttribute strLength = (StringLengthAttribute)a;
return String.Format(CultureInfo.CurrentCulture, "String length: inclusive between {0} and {1}", strLength.MinimumLength, strLength.MaximumLength);
}
},
{ typeof(DataTypeAttribute), a =>
{
DataTypeAttribute dataType = (DataTypeAttribute)a;
return String.Format(CultureInfo.CurrentCulture, "Data type: {0}", dataType.CustomDataType ?? dataType.DataType.ToString());
}
},
{ typeof(RegularExpressionAttribute), a =>
{
RegularExpressionAttribute regularExpression = (RegularExpressionAttribute)a;
return String.Format(CultureInfo.CurrentCulture, "Matching regular expression pattern: {0}", regularExpression.Pattern);
}
},
};
// Modify this to add more default documentations.
private readonly IDictionary<Type, string> DefaultTypeDocumentation = new Dictionary<Type, string>
{
{ typeof(Int16), "integer" },
{ typeof(Int32), "integer" },
{ typeof(Int64), "integer" },
{ typeof(UInt16), "unsigned integer" },
{ typeof(UInt32), "unsigned integer" },
{ typeof(UInt64), "unsigned integer" },
{ typeof(Byte), "byte" },
{ typeof(Char), "character" },
{ typeof(SByte), "signed byte" },
{ typeof(Uri), "URI" },
{ typeof(Single), "decimal number" },
{ typeof(Double), "decimal number" },
{ typeof(Decimal), "decimal number" },
{ typeof(String), "string" },
{ typeof(Guid), "globally unique identifier" },
{ typeof(TimeSpan), "time interval" },
{ typeof(DateTime), "date" },
{ typeof(DateTimeOffset), "date" },
{ typeof(Boolean), "boolean" },
};
private Lazy<IModelDocumentationProvider> _documentationProvider;
public ModelDescriptionGenerator(HttpConfiguration config)
{
if (config == null)
{
throw new ArgumentNullException("config");
}
_documentationProvider = new Lazy<IModelDocumentationProvider>(() => config.Services.GetDocumentationProvider() as IModelDocumentationProvider);
GeneratedModels = new Dictionary<string, ModelDescription>(StringComparer.OrdinalIgnoreCase);
}
public Dictionary<string, ModelDescription> GeneratedModels { get; private set; }
private IModelDocumentationProvider DocumentationProvider
{
get
{
return _documentationProvider.Value;
}
}
public ModelDescription GetOrCreateModelDescription(Type modelType)
{
if (modelType == null)
{
throw new ArgumentNullException("modelType");
}
Type underlyingType = Nullable.GetUnderlyingType(modelType);
if (underlyingType != null)
{
modelType = underlyingType;
}
ModelDescription modelDescription;
string modelName = ModelNameHelper.GetModelName(modelType);
if (GeneratedModels.TryGetValue(modelName, out modelDescription))
{
if (modelType != modelDescription.ModelType)
{
throw new InvalidOperationException(
String.Format(
CultureInfo.CurrentCulture,
"A model description could not be created. Duplicate model name '{0}' was found for types '{1}' and '{2}'. " +
"Use the [ModelName] attribute to change the model name for at least one of the types so that it has a unique name.",
modelName,
modelDescription.ModelType.FullName,
modelType.FullName));
}
return modelDescription;
}
if (DefaultTypeDocumentation.ContainsKey(modelType))
{
return GenerateSimpleTypeModelDescription(modelType);
}
if (modelType.IsEnum)
{
return GenerateEnumTypeModelDescription(modelType);
}
if (modelType.IsGenericType)
{
Type[] genericArguments = modelType.GetGenericArguments();
if (genericArguments.Length == 1)
{
Type enumerableType = typeof(IEnumerable<>).MakeGenericType(genericArguments);
if (enumerableType.IsAssignableFrom(modelType))
{
return GenerateCollectionModelDescription(modelType, genericArguments[0]);
}
}
if (genericArguments.Length == 2)
{
Type dictionaryType = typeof(IDictionary<,>).MakeGenericType(genericArguments);
if (dictionaryType.IsAssignableFrom(modelType))
{
return GenerateDictionaryModelDescription(modelType, genericArguments[0], genericArguments[1]);
}
Type keyValuePairType = typeof(KeyValuePair<,>).MakeGenericType(genericArguments);
if (keyValuePairType.IsAssignableFrom(modelType))
{
return GenerateKeyValuePairModelDescription(modelType, genericArguments[0], genericArguments[1]);
}
}
}
if (modelType.IsArray)
{
Type elementType = modelType.GetElementType();
return GenerateCollectionModelDescription(modelType, elementType);
}
if (modelType == typeof(NameValueCollection))
{
return GenerateDictionaryModelDescription(modelType, typeof(string), typeof(string));
}
if (typeof(IDictionary).IsAssignableFrom(modelType))
{
return GenerateDictionaryModelDescription(modelType, typeof(object), typeof(object));
}
if (typeof(IEnumerable).IsAssignableFrom(modelType))
{
return GenerateCollectionModelDescription(modelType, typeof(object));
}
return GenerateComplexTypeModelDescription(modelType);
}
// Change this to provide different name for the member.
private static string GetMemberName(MemberInfo member, bool hasDataContractAttribute)
{
JsonPropertyAttribute jsonProperty = member.GetCustomAttribute<JsonPropertyAttribute>();
if (jsonProperty != null && !String.IsNullOrEmpty(jsonProperty.PropertyName))
{
return jsonProperty.PropertyName;
}
if (hasDataContractAttribute)
{
DataMemberAttribute dataMember = member.GetCustomAttribute<DataMemberAttribute>();
if (dataMember != null && !String.IsNullOrEmpty(dataMember.Name))
{
return dataMember.Name;
}
}
return member.Name;
}
private static bool ShouldDisplayMember(MemberInfo member, bool hasDataContractAttribute)
{
JsonIgnoreAttribute jsonIgnore = member.GetCustomAttribute<JsonIgnoreAttribute>();
XmlIgnoreAttribute xmlIgnore = member.GetCustomAttribute<XmlIgnoreAttribute>();
IgnoreDataMemberAttribute ignoreDataMember = member.GetCustomAttribute<IgnoreDataMemberAttribute>();
NonSerializedAttribute nonSerialized = member.GetCustomAttribute<NonSerializedAttribute>();
ApiExplorerSettingsAttribute apiExplorerSetting = member.GetCustomAttribute<ApiExplorerSettingsAttribute>();
bool hasMemberAttribute = member.DeclaringType.IsEnum ?
member.GetCustomAttribute<EnumMemberAttribute>() != null :
member.GetCustomAttribute<DataMemberAttribute>() != null;
// Display member only if all the followings are true:
// no JsonIgnoreAttribute
// no XmlIgnoreAttribute
// no IgnoreDataMemberAttribute
// no NonSerializedAttribute
// no ApiExplorerSettingsAttribute with IgnoreApi set to true
// no DataContractAttribute without DataMemberAttribute or EnumMemberAttribute
return jsonIgnore == null &&
xmlIgnore == null &&
ignoreDataMember == null &&
nonSerialized == null &&
(apiExplorerSetting == null || !apiExplorerSetting.IgnoreApi) &&
(!hasDataContractAttribute || hasMemberAttribute);
}
private string CreateDefaultDocumentation(Type type)
{
string documentation;
if (DefaultTypeDocumentation.TryGetValue(type, out documentation))
{
return documentation;
}
if (DocumentationProvider != null)
{
documentation = DocumentationProvider.GetDocumentation(type);
}
return documentation;
}
private void GenerateAnnotations(MemberInfo property, ParameterDescription propertyModel)
{
List<ParameterAnnotation> annotations = new List<ParameterAnnotation>();
IEnumerable<Attribute> attributes = property.GetCustomAttributes();
foreach (Attribute attribute in attributes)
{
Func<object, string> textGenerator;
if (AnnotationTextGenerator.TryGetValue(attribute.GetType(), out textGenerator))
{
annotations.Add(
new ParameterAnnotation
{
AnnotationAttribute = attribute,
Documentation = textGenerator(attribute)
});
}
}
// Rearrange the annotations
annotations.Sort((x, y) =>
{
// Special-case RequiredAttribute so that it shows up on top
if (x.AnnotationAttribute is RequiredAttribute)
{
return -1;
}
if (y.AnnotationAttribute is RequiredAttribute)
{
return 1;
}
// Sort the rest based on alphabetic order of the documentation
return String.Compare(x.Documentation, y.Documentation, StringComparison.OrdinalIgnoreCase);
});
foreach (ParameterAnnotation annotation in annotations)
{
propertyModel.Annotations.Add(annotation);
}
}
private CollectionModelDescription GenerateCollectionModelDescription(Type modelType, Type elementType)
{
ModelDescription collectionModelDescription = GetOrCreateModelDescription(elementType);
if (collectionModelDescription != null)
{
return new CollectionModelDescription
{
Name = ModelNameHelper.GetModelName(modelType),
ModelType = modelType,
ElementDescription = collectionModelDescription
};
}
return null;
}
private ModelDescription GenerateComplexTypeModelDescription(Type modelType)
{
ComplexTypeModelDescription complexModelDescription = new ComplexTypeModelDescription
{
Name = ModelNameHelper.GetModelName(modelType),
ModelType = modelType,
Documentation = CreateDefaultDocumentation(modelType)
};
GeneratedModels.Add(complexModelDescription.Name, complexModelDescription);
bool hasDataContractAttribute = modelType.GetCustomAttribute<DataContractAttribute>() != null;
PropertyInfo[] properties = modelType.GetProperties(BindingFlags.Public | BindingFlags.Instance);
foreach (PropertyInfo property in properties)
{
if (ShouldDisplayMember(property, hasDataContractAttribute))
{
ParameterDescription propertyModel = new ParameterDescription
{
Name = GetMemberName(property, hasDataContractAttribute)
};
if (DocumentationProvider != null)
{
propertyModel.Documentation = DocumentationProvider.GetDocumentation(property);
}
GenerateAnnotations(property, propertyModel);
complexModelDescription.Properties.Add(propertyModel);
propertyModel.TypeDescription = GetOrCreateModelDescription(property.PropertyType);
}
}
FieldInfo[] fields = modelType.GetFields(BindingFlags.Public | BindingFlags.Instance);
foreach (FieldInfo field in fields)
{
if (ShouldDisplayMember(field, hasDataContractAttribute))
{
ParameterDescription propertyModel = new ParameterDescription
{
Name = GetMemberName(field, hasDataContractAttribute)
};
if (DocumentationProvider != null)
{
propertyModel.Documentation = DocumentationProvider.GetDocumentation(field);
}
complexModelDescription.Properties.Add(propertyModel);
propertyModel.TypeDescription = GetOrCreateModelDescription(field.FieldType);
}
}
return complexModelDescription;
}
private DictionaryModelDescription GenerateDictionaryModelDescription(Type modelType, Type keyType, Type valueType)
{
ModelDescription keyModelDescription = GetOrCreateModelDescription(keyType);
ModelDescription valueModelDescription = GetOrCreateModelDescription(valueType);
return new DictionaryModelDescription
{
Name = ModelNameHelper.GetModelName(modelType),
ModelType = modelType,
KeyModelDescription = keyModelDescription,
ValueModelDescription = valueModelDescription
};
}
private EnumTypeModelDescription GenerateEnumTypeModelDescription(Type modelType)
{
EnumTypeModelDescription enumDescription = new EnumTypeModelDescription
{
Name = ModelNameHelper.GetModelName(modelType),
ModelType = modelType,
Documentation = CreateDefaultDocumentation(modelType)
};
bool hasDataContractAttribute = modelType.GetCustomAttribute<DataContractAttribute>() != null;
foreach (FieldInfo field in modelType.GetFields(BindingFlags.Public | BindingFlags.Static))
{
if (ShouldDisplayMember(field, hasDataContractAttribute))
{
EnumValueDescription enumValue = new EnumValueDescription
{
Name = field.Name,
Value = field.GetRawConstantValue().ToString()
};
if (DocumentationProvider != null)
{
enumValue.Documentation = DocumentationProvider.GetDocumentation(field);
}
enumDescription.Values.Add(enumValue);
}
}
GeneratedModels.Add(enumDescription.Name, enumDescription);
return enumDescription;
}
private KeyValuePairModelDescription GenerateKeyValuePairModelDescription(Type modelType, Type keyType, Type valueType)
{
ModelDescription keyModelDescription = GetOrCreateModelDescription(keyType);
ModelDescription valueModelDescription = GetOrCreateModelDescription(valueType);
return new KeyValuePairModelDescription
{
Name = ModelNameHelper.GetModelName(modelType),
ModelType = modelType,
KeyModelDescription = keyModelDescription,
ValueModelDescription = valueModelDescription
};
}
private ModelDescription GenerateSimpleTypeModelDescription(Type modelType)
{
SimpleTypeModelDescription simpleModelDescription = new SimpleTypeModelDescription
{
Name = ModelNameHelper.GetModelName(modelType),
ModelType = modelType,
Documentation = CreateDefaultDocumentation(modelType)
};
GeneratedModels.Add(simpleModelDescription.Name, simpleModelDescription);
return simpleModelDescription;
}
}
}

View File

@@ -0,0 +1,294 @@
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly>
<name>System.Web.WebPages.Razor</name>
</assembly>
<members>
<member name="T:System.Web.WebPages.Razor.CompilingPathEventArgs">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。表示包含事件数据的编译路径的基类。</summary>
</member>
<member name="M:System.Web.WebPages.Razor.CompilingPathEventArgs.#ctor(System.String,System.Web.WebPages.Razor.WebPageRazorHost)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。初始化 <see cref="T:System.Web.WebPages.Razor.CompilingPathEventArgs" /> 类的新实例。</summary>
<param name="virtualPath">虚拟路径的字符串。</param>
<param name="host">网页 Razor 的主机。</param>
</member>
<member name="P:System.Web.WebPages.Razor.CompilingPathEventArgs.Host">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取或设置网页 Razor 的主机。</summary>
<returns>网页 Razor 的主机。</returns>
</member>
<member name="P:System.Web.WebPages.Razor.CompilingPathEventArgs.VirtualPath">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取网页的虚拟路径。</summary>
<returns>网页的虚拟路径。</returns>
</member>
<member name="T:System.Web.WebPages.Razor.PreApplicationStartCode">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。</summary>
</member>
<member name="M:System.Web.WebPages.Razor.PreApplicationStartCode.Start">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。</summary>
</member>
<member name="T:System.Web.WebPages.Razor.RazorBuildProvider">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。表示 Razor 的生成提供程序。</summary>
</member>
<member name="M:System.Web.WebPages.Razor.RazorBuildProvider.#ctor">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。初始化 <see cref="T:System.Web.WebPages.Razor.RazorBuildProvider" /> 类的新实例。</summary>
</member>
<member name="M:System.Web.WebPages.Razor.RazorBuildProvider.AddVirtualPathDependency(System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。将虚拟路径依赖关系添加到集合中。</summary>
<param name="dependency">要添加的虚拟路径依赖关系。</param>
</member>
<member name="P:System.Web.WebPages.Razor.RazorBuildProvider.AssemblyBuilder">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取 Razor 环境的程序集生成器。</summary>
<returns>程序集生成器。</returns>
</member>
<member name="P:System.Web.WebPages.Razor.RazorBuildProvider.CodeCompilerType">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取 Razor 环境的编译器设置。</summary>
</member>
<member name="E:System.Web.WebPages.Razor.RazorBuildProvider.CodeGenerationCompleted">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。在代码生成完成时发生。</summary>
</member>
<member name="E:System.Web.WebPages.Razor.RazorBuildProvider.CodeGenerationStarted">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。在代码生成启动时发生。</summary>
</member>
<member name="E:System.Web.WebPages.Razor.RazorBuildProvider.CompilingPath">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。在使用新的虚拟路径编译时发生。</summary>
</member>
<member name="M:System.Web.WebPages.Razor.RazorBuildProvider.CreateHost">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。根据 Web 配置创建 Razor 引擎主机实例。</summary>
<returns>Razor 引擎主机实例。</returns>
</member>
<member name="M:System.Web.WebPages.Razor.RazorBuildProvider.GenerateCode(System.Web.Compilation.AssemblyBuilder)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。使用提供的程序集生成器生成代码。</summary>
<param name="assemblyBuilder">程序集生成器。</param>
</member>
<member name="M:System.Web.WebPages.Razor.RazorBuildProvider.GetGeneratedType(System.CodeDom.Compiler.CompilerResults)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取所生成代码的类型。</summary>
<returns>所生成代码的类型。</returns>
<param name="results">代码编译的结果。</param>
</member>
<member name="M:System.Web.WebPages.Razor.RazorBuildProvider.GetHostFromConfig">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。根据 Web 配置创建 Razor 引擎主机实例。</summary>
<returns>Razor 引擎主机实例。</returns>
</member>
<member name="M:System.Web.WebPages.Razor.RazorBuildProvider.InternalOpenReader">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。打开内部文本读取器。</summary>
<returns>内部文本读取器。</returns>
</member>
<member name="M:System.Web.WebPages.Razor.RazorBuildProvider.OnBeforeCompilePath(System.Web.WebPages.Razor.CompilingPathEventArgs)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。引发 CompilingPath 事件。</summary>
<param name="args">为 CompilingPath 事件提供的数据。</param>
</member>
<member name="P:System.Web.WebPages.Razor.RazorBuildProvider.VirtualPath">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取源代码的虚拟路径。</summary>
<returns>源代码的虚拟路径。</returns>
</member>
<member name="P:System.Web.WebPages.Razor.RazorBuildProvider.VirtualPathDependencies">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取依赖项的虚拟路径的集合。</summary>
<returns>依赖项的虚拟路径的集合。</returns>
</member>
<member name="T:System.Web.WebPages.Razor.WebCodeRazorHost">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。表示网页的 Web 代码 Razor 主机。</summary>
</member>
<member name="M:System.Web.WebPages.Razor.WebCodeRazorHost.#ctor(System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。初始化 <see cref="T:System.Web.WebPages.Razor.WebCodeRazorHost" /> 类的新实例。</summary>
<param name="virtualPath">虚拟路径。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebCodeRazorHost.#ctor(System.String,System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。初始化 <see cref="T:System.Web.WebPages.Razor.WebCodeRazorHost" /> 类的新实例。</summary>
<param name="virtualPath">虚拟路径。</param>
<param name="physicalPath">物理路径。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebCodeRazorHost.GetClassName(System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。返回该实例的类名。</summary>
<returns>该实例的类名。</returns>
<param name="virtualPath">虚拟路径。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebCodeRazorHost.PostProcessGeneratedCode(System.Web.Razor.Generator.CodeGeneratorContext)">
<summary>生成 Web 代码 Razor 主机的后处理代码。</summary>
<param name="context">生成器代码上下文。</param>
</member>
<member name="T:System.Web.WebPages.Razor.WebPageRazorHost">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。表示网页中的 Razor 主机。</summary>
</member>
<member name="M:System.Web.WebPages.Razor.WebPageRazorHost.#ctor(System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。使用指定的虚拟文件路径初始化 <see cref="T:System.Web.WebPages.Razor.WebPageRazorHost" /> 类的新实例。</summary>
<param name="virtualPath">虚拟文件路径。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebPageRazorHost.#ctor(System.String,System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。使用指定的虚拟和物理文件路径初始化 <see cref="T:System.Web.WebPages.Razor.WebPageRazorHost" /> 类的新实例。</summary>
<param name="virtualPath">虚拟文件路径。</param>
<param name="physicalPath">物理文件路径。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebPageRazorHost.AddGlobalImport(System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。在网页上添加全局导入。</summary>
<param name="ns">通知服务名称。</param>
</member>
<member name="P:System.Web.WebPages.Razor.WebPageRazorHost.CodeLanguage">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取 <see cref="T:System.Web.Razor.RazorCodeLanguage" />。</summary>
<returns>
<see cref="T:System.Web.Razor.RazorCodeLanguage" />。</returns>
</member>
<member name="M:System.Web.WebPages.Razor.WebPageRazorHost.CreateMarkupParser">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。创建标记分析器。</summary>
<returns>标记分析器。</returns>
</member>
<member name="P:System.Web.WebPages.Razor.WebPageRazorHost.DefaultBaseClass">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取或设置 DefaultBaseClass 的值。</summary>
<returns>DefaultBaseClass 的值。</returns>
</member>
<member name="P:System.Web.WebPages.Razor.WebPageRazorHost.DefaultClassName">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取或设置默认类的名称。</summary>
<returns>默认类的名称。</returns>
</member>
<member name="P:System.Web.WebPages.Razor.WebPageRazorHost.DefaultDebugCompilation">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取或设置一个指示调试编译是否设置为默认值的值。</summary>
<returns>如果调试编译设置为默认值,则为 true否则为 false。</returns>
</member>
<member name="P:System.Web.WebPages.Razor.WebPageRazorHost.DefaultPageBaseClass">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取或设置默认页的基类。</summary>
<returns>默认页的基类。</returns>
</member>
<member name="M:System.Web.WebPages.Razor.WebPageRazorHost.GetClassName(System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。检索指定网页所属的类的名称。</summary>
<returns>指定网页所属的类的名称。</returns>
<param name="virtualPath">虚拟文件路径。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebPageRazorHost.GetCodeLanguage">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取在网页中指定的代码语言。</summary>
<returns>在网页中指定的代码语言。</returns>
</member>
<member name="M:System.Web.WebPages.Razor.WebPageRazorHost.GetGlobalImports">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取网页的全局导入。</summary>
<returns>网页的全局导入。</returns>
</member>
<member name="P:System.Web.WebPages.Razor.WebPageRazorHost.InstrumentedSourceFilePath">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取或设置检测到的源文件的文件路径。</summary>
<returns>检测到的源文件的文件路径。</returns>
</member>
<member name="P:System.Web.WebPages.Razor.WebPageRazorHost.IsSpecialPage">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取一个值,该值指示网页是否为特殊页。</summary>
<returns>如果网页是特殊页,则为 true否则为 false。</returns>
</member>
<member name="P:System.Web.WebPages.Razor.WebPageRazorHost.PhysicalPath">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取 Razor 主机的物理文件系统路径。</summary>
<returns>Razor 主机的物理文件系统路径。</returns>
</member>
<member name="M:System.Web.WebPages.Razor.WebPageRazorHost.PostProcessGeneratedCode(System.Web.Razor.Generator.CodeGeneratorContext)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取处理之后生成的代码。</summary>
<param name="context">
<see cref="T:System.Web.Razor.Generator.CodeGeneratorContext" />。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebPageRazorHost.RegisterSpecialFile(System.String,System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。使用指定文件名和基类型名称注册特殊文件。</summary>
<param name="fileName">文件名。</param>
<param name="baseTypeName">基类型名称。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebPageRazorHost.RegisterSpecialFile(System.String,System.Type)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。使用指定文件名和基类型注册特殊文件。</summary>
<param name="fileName">文件名。</param>
<param name="baseType">基文件的类型。</param>
</member>
<member name="P:System.Web.WebPages.Razor.WebPageRazorHost.VirtualPath">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。获取虚拟文件路径。</summary>
<returns>虚拟文件路径。</returns>
</member>
<member name="T:System.Web.WebPages.Razor.WebRazorHostFactory">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。创建主机文件的实例。</summary>
</member>
<member name="M:System.Web.WebPages.Razor.WebRazorHostFactory.#ctor">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。初始化 <see cref="T:System.Web.WebPages.Razor.WebRazorHostFactory" /> 类的新实例。</summary>
</member>
<member name="M:System.Web.WebPages.Razor.WebRazorHostFactory.ApplyConfigurationToHost(System.Web.WebPages.Razor.Configuration.RazorPagesSection,System.Web.WebPages.Razor.WebPageRazorHost)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。从配置文件加载服务描述信息并将这些信息应用到主机。</summary>
<param name="config">配置。</param>
<param name="host">网页 Razor 主机。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebRazorHostFactory.CreateDefaultHost(System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。使用指定的虚拟路径创建默认主机。</summary>
<returns>默认主机。</returns>
<param name="virtualPath">文件的虚拟路径。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebRazorHostFactory.CreateDefaultHost(System.String,System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。使用指定的虚拟路径和物理路径创建默认主机。</summary>
<returns>默认主机。</returns>
<param name="virtualPath">文件的虚拟路径。</param>
<param name="physicalPath">物理文件系统路径。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebRazorHostFactory.CreateHost(System.String,System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。创建 Razor 主机。</summary>
<returns>Razor 主机。</returns>
<param name="virtualPath">目标文件的虚拟路径。</param>
<param name="physicalPath">目标文件的物理路径。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebRazorHostFactory.CreateHostFromConfig(System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。创建配置中的主机。</summary>
<returns>配置中的主机。</returns>
<param name="virtualPath">目标文件的虚拟路径。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebRazorHostFactory.CreateHostFromConfig(System.String,System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。创建配置中的主机。</summary>
<returns>配置中的主机。</returns>
<param name="virtualPath">文件的虚拟路径。</param>
<param name="physicalPath">物理文件系统路径。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebRazorHostFactory.CreateHostFromConfig(System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup,System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。创建配置中的主机。</summary>
<returns>配置中的主机。</returns>
<param name="config">配置。</param>
<param name="virtualPath">文件的虚拟路径。</param>
</member>
<member name="M:System.Web.WebPages.Razor.WebRazorHostFactory.CreateHostFromConfig(System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup,System.String,System.String)">
<summary>此类型/成员支持 .NET Framework 基础结构,不能在代码中直接使用。创建配置中的主机。</summary>
<returns>配置中的主机。</returns>
<param name="config">配置。</param>
<param name="virtualPath">文件的虚拟路径。</param>
<param name="physicalPath">物理文件系统路径。</param>
</member>
<member name="T:System.Web.WebPages.Razor.Configuration.HostSection">
<summary>为 host 配置部分提供配置系统支持。</summary>
</member>
<member name="M:System.Web.WebPages.Razor.Configuration.HostSection.#ctor">
<summary>初始化 <see cref="T:System.Web.WebPages.Razor.Configuration.HostSection" /> 类的新实例。</summary>
</member>
<member name="P:System.Web.WebPages.Razor.Configuration.HostSection.FactoryType">
<summary>获取或设置宿主工厂。</summary>
<returns>宿主工厂。</returns>
</member>
<member name="F:System.Web.WebPages.Razor.Configuration.HostSection.SectionName">
<summary>表示 Razor 宿主环境的配置部分的名称。</summary>
</member>
<member name="T:System.Web.WebPages.Razor.Configuration.RazorPagesSection">
<summary>为 pages 配置部分提供配置系统支持。</summary>
</member>
<member name="M:System.Web.WebPages.Razor.Configuration.RazorPagesSection.#ctor">
<summary>初始化 <see cref="T:System.Web.WebPages.Razor.Configuration.RazorPagesSection" /> 类的新实例。</summary>
</member>
<member name="P:System.Web.WebPages.Razor.Configuration.RazorPagesSection.Namespaces">
<summary>获取或设置要添加到当前应用程序的 Web Pages 页的命名空间的集合。</summary>
<returns>命名空间的集合。</returns>
</member>
<member name="P:System.Web.WebPages.Razor.Configuration.RazorPagesSection.PageBaseType">
<summary>获取或设置页基类型类的名称。</summary>
<returns>页基类型类的名称。</returns>
</member>
<member name="F:System.Web.WebPages.Razor.Configuration.RazorPagesSection.SectionName">
<summary>表示 Razor 页配置部分的名称。</summary>
</member>
<member name="T:System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup">
<summary>为 system.web.webPages.razor 配置部分提供配置系统支持。</summary>
</member>
<member name="M:System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup.#ctor">
<summary>初始化 <see cref="T:System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup" /> 类的新实例。</summary>
</member>
<member name="F:System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup.GroupName">
<summary>表示 Razor Web 部分的配置部分的名称。包含静态的只读字符串“system.web.webPages.razor”。</summary>
</member>
<member name="P:System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup.Host">
<summary>获取或设置 system.web.webPages.razor 部分组的 host 值。</summary>
<returns>主机值。</returns>
</member>
<member name="P:System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup.Pages">
<summary>获取或设置 system.web.webPages.razor 部分的 pages 元素的值。</summary>
<returns>pages 元素的值。</returns>
</member>
</members>
</doc>

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Web;
namespace BLV_API
{
public static class Tools
{
public static string GetApplicationPath()
{
return AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
}
public static string MD5Encrypt(string strEnc)
{
string result;
try
{
MD5 md5Hasher = MD5.Create();
byte[] data = md5Hasher.ComputeHash(Encoding.Default.GetBytes(strEnc));
StringBuilder sBuilder = new StringBuilder();
int num;
for (int i = 0; i < data.Length; i = num + 1)
{
sBuilder.Append(data[i].ToString("x2"));
num = i;
}
result = sBuilder.ToString();
}
catch (Exception ex)
{
throw ex;
}
return result;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
<div class="jumbotron">
<h1>欢迎访问宝来威客控接口服务</h1>
@*<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS, and JavaScript.</p>
<p><a href="https://asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>*@
</div>
@*<div class="row">
<div class="col-md-4">
<h2>Getting started</h2>
<p>ASP.NET Web API is a framework that makes it easy to build HTTP services that reach
a broad range of clients, including browsers and mobile devices. ASP.NET Web API
is an ideal platform for building RESTful applications on the .NET Framework.</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301870">Learn more &raquo;</a></p>
</div>
<div class="col-md-4">
<h2>Get more libraries</h2>
<p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301871">Learn more &raquo;</a></p>
</div>
<div class="col-md-4">
<h2>Web Hosting</h2>
<p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301872">Learn more &raquo;</a></p>
</div>
</div>*@

View File

@@ -0,0 +1,326 @@
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:tns="http://www.blw.com/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://www.blw.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://www.blw.com/">
<s:element name="CheckIn">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="key" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="code" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="roomNumber" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="checkInDate" type="s:dateTime" />
<s:element minOccurs="0" maxOccurs="1" name="xmlString" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="errorMsg" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="phoneNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="idNumber" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CheckInResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="CheckInResult" type="s:boolean" />
<s:element minOccurs="0" maxOccurs="1" name="errorMsg" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CheckIn2">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="key" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="code" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="roomNumber" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="checkInDate" type="s:dateTime" />
<s:element minOccurs="0" maxOccurs="1" name="xmlString" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="errorMsg" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="checkInID" type="s:long" />
<s:element minOccurs="0" maxOccurs="1" name="phoneNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="idNumber" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CheckIn2Response">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="CheckIn2Result" type="s:boolean" />
<s:element minOccurs="0" maxOccurs="1" name="errorMsg" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="checkInID" type="s:long" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="UploadPhoto">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="key" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="code" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="checkInID" type="s:long" />
<s:element minOccurs="1" maxOccurs="1" name="idType" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="idCard" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="name" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="sex" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="birthday" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="photoUrl" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="photo" type="s:base64Binary" />
<s:element minOccurs="0" maxOccurs="1" name="errorMsg" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="UploadPhotoResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="UploadPhotoResult" type="s:boolean" />
<s:element minOccurs="0" maxOccurs="1" name="errorMsg" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ChangePhoneNumber">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="key" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="code" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="roomNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="phoneNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="idNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="errorMsg" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ChangePhoneNumberResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="ChangePhoneNumberResult" type="s:boolean" />
<s:element minOccurs="0" maxOccurs="1" name="errorMsg" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CheckOut">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="key" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="code" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="roomNumber" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="checkOutDate" type="s:dateTime" />
<s:element minOccurs="0" maxOccurs="1" name="errorMsg" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="CheckOutResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="CheckOutResult" type="s:boolean" />
<s:element minOccurs="0" maxOccurs="1" name="errorMsg" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="RentRoom">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="key" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="code" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="roomNumber" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="rentDate" type="s:dateTime" />
<s:element minOccurs="0" maxOccurs="1" name="errorMsg" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="RentRoomResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="RentRoomResult" type="s:boolean" />
<s:element minOccurs="0" maxOccurs="1" name="errorMsg" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="CheckInSoapIn">
<wsdl:part name="parameters" element="tns:CheckIn" />
</wsdl:message>
<wsdl:message name="CheckInSoapOut">
<wsdl:part name="parameters" element="tns:CheckInResponse" />
</wsdl:message>
<wsdl:message name="CheckIn2SoapIn">
<wsdl:part name="parameters" element="tns:CheckIn2" />
</wsdl:message>
<wsdl:message name="CheckIn2SoapOut">
<wsdl:part name="parameters" element="tns:CheckIn2Response" />
</wsdl:message>
<wsdl:message name="UploadPhotoSoapIn">
<wsdl:part name="parameters" element="tns:UploadPhoto" />
</wsdl:message>
<wsdl:message name="UploadPhotoSoapOut">
<wsdl:part name="parameters" element="tns:UploadPhotoResponse" />
</wsdl:message>
<wsdl:message name="ChangePhoneNumberSoapIn">
<wsdl:part name="parameters" element="tns:ChangePhoneNumber" />
</wsdl:message>
<wsdl:message name="ChangePhoneNumberSoapOut">
<wsdl:part name="parameters" element="tns:ChangePhoneNumberResponse" />
</wsdl:message>
<wsdl:message name="CheckOutSoapIn">
<wsdl:part name="parameters" element="tns:CheckOut" />
</wsdl:message>
<wsdl:message name="CheckOutSoapOut">
<wsdl:part name="parameters" element="tns:CheckOutResponse" />
</wsdl:message>
<wsdl:message name="RentRoomSoapIn">
<wsdl:part name="parameters" element="tns:RentRoom" />
</wsdl:message>
<wsdl:message name="RentRoomSoapOut">
<wsdl:part name="parameters" element="tns:RentRoomResponse" />
</wsdl:message>
<wsdl:portType name="blwwsSoap">
<wsdl:operation name="CheckIn">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">开房&lt;br/&gt;key验证码我方提供code编码我方提供roomNumber房号checkInDate入住日期xmlString客人信息errorMsg返回错误信息phoneNumber手机号码多个以英文逗号,隔开idNumber身份证号多个以英文逗号,隔开):获取微信登录验证码</wsdl:documentation>
<wsdl:input message="tns:CheckInSoapIn" />
<wsdl:output message="tns:CheckInSoapOut" />
</wsdl:operation>
<wsdl:operation name="CheckIn2">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">开房&lt;br/&gt;key验证码我方提供code编码我方提供roomNumber房号checkInDate入住日期xmlString客人信息errorMsg返回错误信息checkInID返回入住记录IDphoneNumber手机号码多个以英文逗号,隔开idNumber身份证号多个以英文逗号,隔开):获取微信登录验证码</wsdl:documentation>
<wsdl:input message="tns:CheckIn2SoapIn" />
<wsdl:output message="tns:CheckIn2SoapOut" />
</wsdl:operation>
<wsdl:operation name="UploadPhoto">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">上传入住人信息&lt;br/&gt;key验证码我方提供code编码我方提供checkInID入住记录IDidType证件类型(0身份证1护照2军官证3其他)idCard证件号码name姓名sex性别(0女1男2其他)birthday出生日期(1999-01-01)photoUrl图片路径与photo二选一photo图片二进制errorMsg错误信息</wsdl:documentation>
<wsdl:input message="tns:UploadPhotoSoapIn" />
<wsdl:output message="tns:UploadPhotoSoapOut" />
</wsdl:operation>
<wsdl:operation name="ChangePhoneNumber">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">变更手机号&lt;br/&gt;key验证码我方提供code编码我方提供roomNumber房号errorMsg错误信息phoneNumber手机号码多个以英文逗号,隔开idNumber身份证号获取验证码</wsdl:documentation>
<wsdl:input message="tns:ChangePhoneNumberSoapIn" />
<wsdl:output message="tns:ChangePhoneNumberSoapOut" />
</wsdl:operation>
<wsdl:operation name="CheckOut">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">退房&lt;br/&gt;key验证码我方提供code编码我方提供roomNumber房号checkOutDate退房日期errorMsg错误信息</wsdl:documentation>
<wsdl:input message="tns:CheckOutSoapIn" />
<wsdl:output message="tns:CheckOutSoapOut" />
</wsdl:operation>
<wsdl:operation name="RentRoom">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">待租&lt;br/&gt;key验证码我方提供code编码我方提供roomNumber房号rentDate变更待租日期errorMsg错误信息</wsdl:documentation>
<wsdl:input message="tns:RentRoomSoapIn" />
<wsdl:output message="tns:RentRoomSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="blwwsSoap" type="tns:blwwsSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="CheckIn">
<soap:operation soapAction="http://www.blw.com/CheckIn" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="CheckIn2">
<soap:operation soapAction="http://www.blw.com/CheckIn2" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="UploadPhoto">
<soap:operation soapAction="http://www.blw.com/UploadPhoto" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ChangePhoneNumber">
<soap:operation soapAction="http://www.blw.com/ChangePhoneNumber" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="CheckOut">
<soap:operation soapAction="http://www.blw.com/CheckOut" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="RentRoom">
<soap:operation soapAction="http://www.blw.com/RentRoom" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="blwwsSoap12" type="tns:blwwsSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="CheckIn">
<soap12:operation soapAction="http://www.blw.com/CheckIn" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="CheckIn2">
<soap12:operation soapAction="http://www.blw.com/CheckIn2" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="UploadPhoto">
<soap12:operation soapAction="http://www.blw.com/UploadPhoto" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ChangePhoneNumber">
<soap12:operation soapAction="http://www.blw.com/ChangePhoneNumber" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="CheckOut">
<soap12:operation soapAction="http://www.blw.com/CheckOut" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="RentRoom">
<soap12:operation soapAction="http://www.blw.com/RentRoom" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="blwws">
<wsdl:port name="blwwsSoap" binding="tns:blwwsSoap">
<soap:address location="http://pms.boonlive-rcu.com:89/blwws.asmx" />
</wsdl:port>
<wsdl:port name="blwwsSoap12" binding="tns:blwwsSoap12">
<soap12:address location="http://pms.boonlive-rcu.com:89/blwws.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@@ -0,0 +1,22 @@
using BLV_API.Dal;
using BLV_API.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace BLV_API.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Title = "宝来威客控与PMS对接API";
return View();
}
}
}

Some files were not shown because too many files have changed in this diff Show More