Commit ee6f9d0d authored by charleslee's avatar charleslee

add tool

parent f1114459
......@@ -11,6 +11,7 @@ using System.Net.Http;
using System.Text;
using System.Web;
using System.Web.Http;
using System.Web.Http.Cors;
using WebAPI.Models;
using static WebAPI.Models.CommonModel;
......@@ -35,6 +36,8 @@ namespace WebAPI.Controllers
/// <param name="Get_cur_his_id"></param>
/// <returns></returns>
[Route("Get_cur_his")]
[EnableCors(origins: "http://120.78.73.107:8888,https://ipeasy.purplevineip.com,https://ipeasy.essenptl.com",
headers: "*", methods: "*", SupportsCredentials = true)]
[HttpPost]
[HttpGet]
public MessageList Get_cur_his(String Get_cur_his_id)
......@@ -124,6 +127,8 @@ namespace WebAPI.Controllers
/// <param name="trids"></param>
/// <returns></returns>
[Route("Download_cur_hiss_Excel")]
[EnableCors(origins: "http://120.78.73.107:8888,https://ipeasy.purplevineip.com,https://ipeasy.essenptl.com",
headers: "*", methods: "*", SupportsCredentials = true)]
[HttpPost]
[HttpGet]
public HttpResponse Download_cur_hiss_Excel(String trids)
......@@ -331,6 +336,8 @@ namespace WebAPI.Controllers
/// <param name="trids"></param>
/// <returns></returns>
[Route("Get_cur_hiss")]
[EnableCors(origins: "http://120.78.73.107:8888,https://ipeasy.purplevineip.com,https://ipeasy.essenptl.com",
headers: "*", methods: "*", SupportsCredentials = true)]
[HttpPost]
[HttpGet]
//[EnableCors(origins: "*", headers: "*", methods: "*")]
......@@ -430,6 +437,8 @@ namespace WebAPI.Controllers
}
[Route("Get_cur_hiss_test")]
[EnableCors(origins: "http://120.78.73.107:8888,https://ipeasy.purplevineip.com,https://ipeasy.essenptl.com",
headers: "*", methods: "*", SupportsCredentials = true)]
[HttpPost]
[HttpGet]
[HttpOptions]
......
using ExcelDataReader;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Web;
using System.Web.Http;
using System.Web.Http.Cors;
using WebAPI.Models;
using WebAPI.Tool;
using static WebAPI.Models.CommonModel;
namespace WebAPI.Controllers
{
public class DictionaryController : ApiController
{
public DictionaryController()
{
}
#region 獲取字典訊息
[Route("Dictionary")]
[CorsHandle]
[HttpGet]
public HttpResponseMessage GetDictionary(string name, string fields = null)
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
CommonResponseMsg response = new CommonResponseMsg();
try
{
if (string.IsNullOrWhiteSpace(name))
{
response.Code = "0";
response.Msg = "no name";
}
else
{
SqlServerHelper sql_server_helper = new SqlServerHelper();
string sql_fields = "";
if(string.IsNullOrWhiteSpace(fields))
{
sql_fields += "*";
}
else
{
sql_fields += fields.Trim();
}
DataTable dt = sql_server_helper.GetTable("select " + sql_fields + " FROM s_dictionary where dictionary_name = '" + name + "' order by seq");
response.Code = "1";
response.Msg = dt;
}
}
catch (Exception e)
{
response.Code = "0";
response.Msg = e.Message;
}
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
return result;
}
#endregion
}
}
\ No newline at end of file
......@@ -254,7 +254,7 @@ namespace WebAPI.Controllers
if (drTemp != null) ids.Add("config_type", drTemp["config_type"].ToString());
else
{
ids.Add("config_type", "AD");
ids.Add("config_type", "");
if (!String.IsNullOrWhiteSpace(FieldValue)) Noticemsg += "(無" + FieldName + ":" + FieldValue + "),";
}
#endregion
......
using ExcelDataReader;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Web;
using System.Web.Http;
using System.Web.Http.Cors;
using WebAPI.Models;
using WebAPI.Tool;
using static WebAPI.Models.CommonModel;
namespace WebAPI.Controllers
{
public class FileController : ApiController
{
public FileController()
{
}
#region 獲取文件信息
[Route("File/confidential")]
[CorsHandle]
[HttpPost]
public HttpResponseMessage GetInventor(ParamModel param)
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
CommonResponseMsg response = new CommonResponseMsg();
if (param != null && param.Input != null && !string.IsNullOrWhiteSpace((param.Input.ToString())))
{
JObject obj_input = JObject.Parse(param.Input.ToString());
try
{
SqlServerHelper sql_server_helper = new SqlServerHelper();
List<string> list_condition = new List<string>();
foreach (var jt in (JObject)obj_input["condition"])
{
if (jt.Value.Type == JTokenType.Integer || jt.Value.Type == JTokenType.Float)
{
list_condition.Add(jt.Key + " = " + jt.Value);
}
else
{
list_condition.Add(jt.Key + " = '" + jt.Value + "'");
}
}
if (list_condition.Count > 0)
{
//string sql = "UPDATE dbo.p_proc_info SET " + string.Join(",", list_fields.ToArray()) + " where proc_id = '" + id + "'";
string sql = string.Format(@"SELECT {0} FROM dbo.p_case_info pci
LEFT JOIN dbo.p_proc_info ppi ON ppi.case_id = pci.case_id
LEFT JOIN dbo.p_file_list pfl ON pfl.obj_id = ppi.proc_id
LEFT JOIN dbo.i_file_desc ifd ON pfl.file_desc_id = ifd.file_desc_id
WHERE {1} and ifd.file_desc_zh_tw LIKE '%保密%'", obj_input["field"].ToString(), string.Join(" and ", list_condition.ToArray()));
DataTable dt_inventor = sql_server_helper.GetTable(sql);
response.Code = "1";
response.Msg = dt_inventor;
}
else
{
response.Code = "0";
response.Msg = "no input";
}
}
catch (Exception e)
{
response.Code = "0";
response.Msg = e.Message;
}
}
else
{
response.Code = "0";
response.Msg = "no input";
}
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
return result;
}
#endregion
}
}
\ No newline at end of file
using ExcelDataReader;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Web;
using System.Web.Http;
using System.Web.Http.Cors;
using WebAPI.Models;
using WebAPI.Tool;
using static WebAPI.Models.CommonModel;
namespace WebAPI.Controllers
{
public class InventorController : ApiController
{
public InventorController()
{
}
#region 獲取發明人信息
[Route("Inventor")]
[CorsHandle]
[HttpPost]
public HttpResponseMessage GetInventor(ParamModel param)
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
CommonResponseMsg response = new CommonResponseMsg();
if (param != null && param.Input != null && !string.IsNullOrWhiteSpace((param.Input.ToString())))
{
JObject obj_input = JObject.Parse(param.Input.ToString());
try
{
SqlServerHelper sql_server_helper = new SqlServerHelper();
List<string> list_condition = new List<string>();
foreach (var jt in (JObject)obj_input["condition"])
{
if (jt.Value.Type == JTokenType.Integer || jt.Value.Type == JTokenType.Float)
{
list_condition.Add(jt.Key + " = " + jt.Value);
}
else
{
list_condition.Add(jt.Key + " = '" + jt.Value + "'");
}
}
if (list_condition.Count > 0)
{
//string sql = "UPDATE dbo.p_proc_info SET " + string.Join(",", list_fields.ToArray()) + " where proc_id = '" + id + "'";
string sql = string.Format(@"SELECT {0} FROM dbo.p_case_info pci
LEFT JOIN dbo.p_inventor_list pil ON pci.case_id = pil.obj_id
LEFT JOIN dbo.i_inventor ii ON pil.inventor_id = ii.inventor_id
WHERE {1}" , obj_input["field"].ToString(), string.Join(" and ", list_condition.ToArray()));
DataTable dt_inventor = sql_server_helper.GetTable(sql);
response.Code = "1";
response.Msg = dt_inventor;
}
else
{
response.Code = "0";
response.Msg = "no input";
}
}
catch (Exception e)
{
response.Code = "0";
response.Msg = e.Message;
}
}
else
{
response.Code = "0";
response.Msg = "no input";
}
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
return result;
}
#endregion
}
}
\ No newline at end of file
using ExcelDataReader;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Web;
using System.Web.Http;
using System.Web.Http.Cors;
using WebAPI.Models;
using WebAPI.Tool;
using static WebAPI.Models.CommonModel;
namespace WebAPI.Controllers
{
public class ProcInfoController : ApiController
{
public ProcInfoController()
{
}
#region 獲取處理事項訊息
[Route("ProcInfo")]
[CorsHandle]
[HttpGet]
public HttpResponseMessage GetProcInfo(string id, string fields)
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
CommonResponseMsg response = new CommonResponseMsg();
try
{
if (string.IsNullOrWhiteSpace(id))
{
response.Code = "0";
response.Msg = "no id";
}
else
{
SqlServerHelper sql_server_helper = new SqlServerHelper();
string sql_fields = "";
if(string.IsNullOrWhiteSpace(fields))
{
sql_fields += "*";
}
else
{
sql_fields += fields.Trim();
}
DataTable dt = sql_server_helper.GetTable("select " + sql_fields + " FROM dbo.p_proc_info where proc_id = '" + id + "'");
response.Code = "1";
response.Msg = dt;
}
}
catch (Exception e)
{
response.Code = "0";
response.Msg = e.Message;
}
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
return result;
}
#endregion
#region 更新處理事項訊息
[Route("ProcInfo")]
[CorsHandle]
[HttpPut]
public HttpResponseMessage UpdateProcInfo(string id, [FromBody]dynamic input)
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
string a = input.ToString();
CommonResponseMsg response = new CommonResponseMsg();
try
{
if (string.IsNullOrWhiteSpace((id)))
{
response.Code = "0";
response.Msg = "no id";
}
else
{
SqlServerHelper sql_server_helper = new SqlServerHelper();
JObject obj_input = JObject.Parse(input.ToString());
List<string> list_fields = new List<string>();
foreach (var jt in obj_input)
{
if (jt.Value.Type == JTokenType.Integer || jt.Value.Type == JTokenType.Float)
{
list_fields.Add(jt.Key + " = " + jt.Value);
}
else
{
list_fields.Add(jt.Key + " = '" + jt.Value + "'");
}
}
if (list_fields.Count > 0)
{
string sql = "UPDATE dbo.p_proc_info SET " + string.Join(",", list_fields.ToArray()) + " where proc_id = '" + id + "'";
int updated_count = sql_server_helper.ExecuteSqlCommand(sql);
response.Code = "1";
response.Msg = updated_count;
}
else
{
response.Code = "0";
response.Msg = "no input";
}
}
}
catch (Exception e)
{
response.Code = "0";
response.Msg = e.Message;
}
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
return result;
}
#endregion
#region 更新處理事項訊息
[Route("ProcInfo")]
[CorsHandle]
[HttpPost]
public HttpResponseMessage UpdateProcInfo_post(ParamModel param)
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
CommonResponseMsg response = new CommonResponseMsg();
string input = param.Input.ToString();
if (string.IsNullOrWhiteSpace((input)))
{
response.Code = "0";
response.Msg = "no input";
}
else
{
JObject obj_input = JObject.Parse(input.ToString());
try
{
string id = Common.isJTokenNull(obj_input["id"], "").ToString();
if (string.IsNullOrWhiteSpace(id))
{
response.Code = "0";
response.Msg = "no id";
}
else
{
SqlServerHelper sql_server_helper = new SqlServerHelper();
List<string> list_fields = new List<string>();
foreach (var jt in obj_input)
{
if (jt.Key != "id")
{
if (jt.Value.Type == JTokenType.Integer || jt.Value.Type == JTokenType.Float)
{
list_fields.Add(jt.Key + " = " + jt.Value);
}
else
{
list_fields.Add(jt.Key + " = '" + jt.Value + "'");
}
}
}
if (list_fields.Count > 0)
{
string sql = "UPDATE dbo.p_proc_info SET " + string.Join(",", list_fields.ToArray()) + " where proc_id = '" + id + "'";
int updated_count = sql_server_helper.ExecuteSqlCommand(sql);
response.Code = "1";
response.Msg = updated_count;
}
else
{
response.Code = "0";
response.Msg = "no input";
}
}
}
catch (Exception e)
{
response.Code = "0";
response.Msg = e.Message;
}
}
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
return result;
}
#endregion
}
}
\ No newline at end of file
using ExcelDataReader;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Web;
using System.Web.Http;
using System.Web.Http.Cors;
using WebAPI.Models;
using WebAPI.Tool;
using static WebAPI.Models.CommonModel;
namespace WebAPI.Controllers
{
public class SubProcInfoController : ApiController
{
public SubProcInfoController()
{
}
#region 獲取主管派點申請
[Route("SubProcInfo/SuggestPoints")]
[CorsHandle]
[HttpGet]
public HttpResponseMessage GetSuggestPoints(string id)
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
CommonResponseMsg response = new CommonResponseMsg();
try
{
if (string.IsNullOrWhiteSpace(id))
{
response.Code = "0";
response.Msg = "no id";
}
else
{
SqlServerHelper sql_server_helper = new SqlServerHelper();
DataTable dt = sql_server_helper.GetTable("select * FROM dbo.esn_OthData where oth_ID = '" + id + "'");
response.Code = "1";
response.Msg = dt;
}
}
catch (Exception e)
{
response.Code = "0";
response.Msg = e.Message;
}
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
return result;
}
#endregion
#region 更新主管派點申請
[Route("SubProcInfo/SuggestPoints")]
[CorsHandle]
[HttpPost]
public HttpResponseMessage UpdateProcInfo_post(ParamModel param)
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
CommonResponseMsg response = new CommonResponseMsg();
string input = param.Input.ToString();
if (string.IsNullOrWhiteSpace((input)))
{
response.Code = "0";
response.Msg = "no input";
}
else
{
JObject obj_input = JObject.Parse(input.ToString());
try
{
string id = Common.isJTokenNull(obj_input["oth_ID"], "").ToString();
if (string.IsNullOrWhiteSpace(id))
{
response.Code = "0";
response.Msg = "no id";
}
else
{
SqlServerHelper sql_server_helper = new SqlServerHelper();
if (obj_input.Count>0)
{
string sql = string.Format(@"UPDATE dbo.esn_OthData
SET FldValue = '{1}', FldMemo = '{2}', oth_Status = 'U', updateUser = '{3}', update_time = GETDATE()
WHERE oth_ID = '{0}';
IF(@@ROWCOUNT = 0)
BEGIN
INSERT INTO dbo.esn_OthData (oth_ID, FldName, FldValue, FldMemo, oth_Status, updateUser, update_time)
VALUES('{0}', 'SuggestPoints', '{1}', '{2}', 'I', '{3}', GETDATE())
END;", id, obj_input["FldValue"].ToString(), obj_input["FldMemo"].ToString(), obj_input["updateUser"].ToString());
//string sql = @"UPDATE dbo.p_proc_info SET " + string.Join(",", list_fields.ToArray()) + " where proc_id = '" + id + "'";
int updated_count = sql_server_helper.ExecuteSqlCommand(sql);
response.Code = "1";
response.Msg = updated_count;
}
else
{
response.Code = "0";
response.Msg = "no input";
}
}
}
catch (Exception e)
{
response.Code = "0";
response.Msg = e.Message;
}
}
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
return result;
}
#endregion
}
}
\ No newline at end of file
......@@ -19,5 +19,13 @@ namespace WebAPI
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
protected void Application_BeginRequest()
{
if (Request.Headers.AllKeys.Contains("Origin") && Request.HttpMethod == "OPTIONS")
{
Response.Flush();
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
[Serializable]
public class CommonResponseMsg
{
private string code = "0";
public string Code
{
get { return code; }
set { code = value; }
}
private object msg ="Failed";
public object Msg
{
get { return this.msg; }
set { this.msg = value; }
}
private string extraInfo="";
public string ExtraInfo
{
get { return this.extraInfo; }
set { this.extraInfo = value; }
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
[Serializable]
public class ParamModel
{
private object input = "";
public object Input
{
get { return this.input; }
set { this.input = value; }
}
}
}
\ No newline at end of file
using MySql.Data.MySqlClient;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Data;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;
using System.Web;
using WebAPI.Models;
namespace WebAPI.Tool
{
public class Common
{
static public DataTable LinqQueryToDataTable<T>(IEnumerable<T> query)
{
DataTable tbl = new DataTable();
PropertyInfo[] props = null;
foreach (T item in query)
{
if (props == null) //尚未初始化
{
Type t = item.GetType();
props = t.GetProperties();
foreach (PropertyInfo pi in props)
{
Type colType = pi.PropertyType;
//針對Nullable<>特別處理
if (colType.IsGenericType
&& colType.GetGenericTypeDefinition() == typeof(Nullable<>))
colType = colType.GetGenericArguments()[0];
//建立欄位
tbl.Columns.Add(pi.Name, colType);
}
}
DataRow row = tbl.NewRow();
foreach (PropertyInfo pi in props)
row[pi.Name] = pi.GetValue(item, null) ?? DBNull.Value;
tbl.Rows.Add(row);
}
return tbl;
}
public static Dictionary<string, object> objToDBInput(string type, object obj)
{
List<MySqlParameter> list = new List<MySqlParameter>();
Dictionary<string, object> output = new Dictionary<string, object>();
string colName = "";
string colNameAt = "";
string colInsert = "";
foreach (var prop in obj.GetType().GetProperties())
{
var propName = prop.Name;
var propValue = prop.GetValue(obj);
bool isInput = true;
if (propValue == null)
{
isInput = false;
}
else
{
if (propValue.GetType() == typeof(DateTime) && (DateTime)propValue == DateTime.MinValue)
{
isInput = false;
}
}
if (isInput)
{
list.Add(new MySqlParameter("@" + propName, propValue));
colName += propName + ",";
colNameAt += "@" + propName + ",";
colInsert += propName + "=" + "@" + propName + ",";
}
}
if (colName.Length > 0)
{
colName = colName.Substring(0, colName.Length - 1);
}
if (colNameAt.Length > 0)
{
colNameAt = colNameAt.Substring(0, colNameAt.Length - 1);
}
if (colInsert.Length > 0)
{
colInsert = colInsert.Substring(0, colInsert.Length - 1);
}
MySqlParameter[] parms = list.ToArray();
if (type == "insert")
{
output["sql"] = "(" + colName + ") values(" + colNameAt + ")";
}
else if (type == "update")
{
output["sql"] = colInsert;
}
output["parms"] = parms;
return output;
}
public static CommonResponseMsg post(string url, Dictionary<string, string> parameters)
{
CommonResponseMsg result = new CommonResponseMsg();
try
{
using (var client = new WebClient())
{
var values = new NameValueCollection();
foreach (string key in parameters.Keys)
{
values[key] = parameters[key];
}
var response = client.UploadValues(url, values);
var responseString = Encoding.UTF8.GetString(response);
responseString = System.Text.RegularExpressions.Regex.Unescape(responseString);
result.Code = "1";
result.Msg = responseString;
return result;
}
}
catch (Exception err)
{
result.Code = "0";
result.Msg = err.Message;
return result;
}
}
public static CommonResponseMsg post_json(string url, object parameters)
{
CommonResponseMsg result = new CommonResponseMsg();
try
{
using (WebClient webClient = new WebClient())
{
// 指定 WebClient 編碼
webClient.Encoding = Encoding.UTF8;
// 指定 WebClient 的 Content-Type header
webClient.Headers.Add(HttpRequestHeader.ContentType, "application/json");
// 指定 WebClient 的 authorization header
//webClient.Headers.Add("authorization", "token {apitoken}");
// 將 data 轉為 json
string json = JsonConvert.SerializeObject(parameters);
// 執行 post 動作
var result_post = webClient.UploadString(url, json);
result.Code = "1";
result.Msg = result_post;
return result;
}
}
catch (Exception err)
{
result.Code = "0";
result.Msg = err.Message;
return result;
}
}
public static List<object> objToList(Object obj)
{
return ((IEnumerable)obj).Cast<object>().ToList();
}
public static object isJTokenNull(JToken jToken, object output)
{
object result = jToken;
if (jToken == null)
{
result = output;
}
else
{
if (jToken.Type == JTokenType.Null)
{
result = output;
}
}
return result;
}
}
}
\ No newline at end of file
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Cors;
using System.Web.Http.Cors;
public class CorsHandle : Attribute, ICorsPolicyProvider
{
private CorsPolicy objProlicy;
public CorsHandle()
{
// 建立一個跨網域存取的原則物件
objProlicy = new CorsPolicy
{
SupportsCredentials = true,
};
// 在這裡透過資料庫或是設定的方式,可動態加入允許存取的來源網域清單
objProlicy.Origins.Add("http://120.78.73.107:8888");
objProlicy.Origins.Add("http://120.78.73.107:8088");
objProlicy.Origins.Add("https://ipeasy.purplevineip.com");
objProlicy.Origins.Add("https://ipeasy.essenptl.com");
objProlicy.Origins.Add("http://127.0.0.1");
objProlicy.Origins.Add("http://localhost");
objProlicy.Origins.Add("https://dev.essenptl.com");
objProlicy.Origins.Add("https://ite.essenptl.com");
objProlicy.Methods.Add("GET");
objProlicy.Methods.Add("POST");
objProlicy.Methods.Add("DELETE");
objProlicy.Methods.Add("PUT");
objProlicy.Methods.Add("OPTIONS");
objProlicy.Methods.Add("HEAD");
objProlicy.Headers.Add("Origin");
objProlicy.Headers.Add("Content-Type");
objProlicy.Headers.Add("X-Auth-Token");
}
public Task<CorsPolicy> GetCorsPolicyAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
return Task.FromResult(objProlicy);
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -16,7 +16,10 @@
-->
<connectionStrings>
<add name="DefaultConnection"
connectionString="Data Source=47.91.213.74,6002;Initial Catalog=IPEasy;Persist Security Info=True;User ID=ipeasy;Password=ipeasy.123" providerName="System.Data.SqlClient"
connectionString="Data Source=172.18.134.232,50608;Initial Catalog=IPEasy;Persist Security Info=True;User ID=ipeasy;Password=ipeasy.123" providerName="System.Data.SqlClient"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
<add name="eflow_cur"
connectionString="Data Source=172.18.134.232,50608;Initial Catalog=IPEasy;Persist Security Info=True;User ID=ipeasy;Password=ipeasy.123" providerName="System.Data.SqlClient"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
<system.web>
......
......@@ -8,7 +8,7 @@
<!--報價規則-->
<add name="DefaultConnection" connectionString="Data Source=47.91.213.74,6002;Initial Catalog=IPEasy_test;Persist Security Info=True;User ID=ipeasyTest;Password=ipeasy.123" providerName="System.Data.SqlClient" />
<!--核稿歷史-->
<add name="eflow_cur" connectionString="Data Source=47.91.213.74,6002;Initial Catalog=IPEasy;Persist Security Info=True;User ID=account;Password=accounttp" providerName="System.Data.SqlClient" />
<add name="eflow_cur" connectionString="Data Source=47.91.213.74,6002;Initial Catalog=IPEasy_test;Persist Security Info=True;User ID=ipeasyTest;Password=ipeasy.123" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
......@@ -25,19 +25,17 @@
<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" />
<remove name="WebDAV" />
<!--<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />-->
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*."
verb="GET,HEAD,POST,PUT,DELETE,OPTIONS"
type="System.Web.Handlers.TransferRequestHandler"
preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<modules>
<add name="HelloWorldModule" type="HelloWorldModule" />
<remove name="WebDAVModule" />
</modules>
<!--<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Methods" value="GET,PUT,POST,DELETE,OPTIONS" />
<add name="Access-Control-Allow-Headers" value="Content-Type,Accept" />
<add name="Access-Control-Allow-Credentials" value="true" />
</customHeaders>
</httpProtocol>-->
<staticContent>
<clientCache cacheControlCustom="public" />
</staticContent>
......@@ -74,6 +72,14 @@
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
......
......@@ -45,6 +45,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.3.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
<HintPath>packages\BouncyCastle.1.8.3.1\lib\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="ClosedXML, Version=0.95.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\ClosedXML.0.95.3\lib\net46\ClosedXML.dll</HintPath>
</Reference>
......@@ -63,12 +66,35 @@
<Reference Include="ExcelNumberFormat, Version=1.0.10.0, Culture=neutral, PublicKeyToken=23c6f5d73be07eca, processorArchitecture=MSIL">
<HintPath>packages\ExcelNumberFormat.1.0.10\lib\net20\ExcelNumberFormat.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf, Version=3.11.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>packages\Google.Protobuf.3.11.4\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4, Version=1.1.11.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>packages\K4os.Compression.LZ4.1.1.11\lib\net46\K4os.Compression.LZ4.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.1.11.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>packages\K4os.Compression.LZ4.Streams.1.1.11\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="MySql.Data, Version=8.0.22.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>packages\MySql.Data.8.0.22\lib\net452\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
<HintPath>packages\SSH.NET.2016.1.0\lib\net40\Renci.SshNet.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Buffers.4.5.1\lib\netstandard1.1\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
......@@ -78,6 +104,14 @@
<Reference Include="System.IO.Packaging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.IO.Packaging.4.0.0\lib\net46\System.IO.Packaging.dll</HintPath>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Memory.4.5.3\lib\netstandard1.1\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Transactions" />
<Reference Include="System.Web.Cors, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNet.Cors.5.2.7\lib\net45\System.Web.Cors.dll</HintPath>
</Reference>
......@@ -140,6 +174,9 @@
<Private>True</Private>
<HintPath>.\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="Ubiety.Dns.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>packages\MySql.Data.8.0.22\lib\net452\Ubiety.Dns.Core.dll</HintPath>
</Reference>
<Reference Include="WebGrease">
<Private>True</Private>
<HintPath>.\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
......@@ -149,6 +186,9 @@
<HintPath>.\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="Zstandard.Net, Version=1.1.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>packages\MySql.Data.8.0.22\lib\net452\Zstandard.Net.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
......@@ -156,6 +196,17 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Controllers\DictionaryController.cs" />
<Compile Include="Controllers\FileController.cs" />
<Compile Include="Controllers\InventorController.cs" />
<Compile Include="Controllers\SubProcInfoController.cs" />
<Compile Include="Controllers\ProcInfoController.cs" />
<Compile Include="Models\ParamModel.cs" />
<Compile Include="Models\CommonResponseMsg.cs" />
<Compile Include="Tool\Common.cs" />
<Compile Include="Tool\CorsHandle.cs" />
<Compile Include="Tool\MySqlHelper.cs" />
<Compile Include="Tool\SqlServerHelper.cs" />
<Content Include="App_Code\HelloWorldModule.cs" />
<Compile Include="App_Start\BundleConfig.cs" />
<Compile Include="App_Start\FilterConfig.cs" />
......
......@@ -2,13 +2,18 @@
<packages>
<package id="Antlr" version="3.5.0.2" targetFramework="net46" />
<package id="bootstrap" version="3.4.1" targetFramework="net46" />
<package id="BouncyCastle" version="1.8.3.1" targetFramework="net46" />
<package id="ClosedXML" version="0.95.3" targetFramework="net46" />
<package id="DocumentFormat.OpenXml" version="2.7.2" targetFramework="net46" />
<package id="EastAsiaNumericFormatter" version="1.0.0" targetFramework="net46" />
<package id="ExcelDataReader" version="3.6.0" targetFramework="net46" />
<package id="ExcelDataReader.DataSet" version="3.6.0" targetFramework="net46" />
<package id="ExcelNumberFormat" version="1.0.10" targetFramework="net46" />
<package id="Google.Protobuf" version="3.11.4" targetFramework="net46" />
<package id="jQuery" version="3.4.1" targetFramework="net46" />
<package id="K4os.Compression.LZ4" version="1.1.11" targetFramework="net46" />
<package id="K4os.Compression.LZ4.Streams" version="1.1.11" targetFramework="net46" />
<package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net46" />
<package id="Microsoft.AspNet.Cors" version="5.2.7" targetFramework="net46" />
<package id="Microsoft.AspNet.Mvc" version="5.2.7" targetFramework="net46" />
<package id="Microsoft.AspNet.Mvc.zh-Hant" version="5.2.7" targetFramework="net46" />
......@@ -31,8 +36,13 @@
<package id="Microsoft.CSharp" version="4.7.0" targetFramework="net46" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net46" />
<package id="Modernizr" version="2.8.3" targetFramework="net46" />
<package id="MySql.Data" version="8.0.22" targetFramework="net46" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net46" />
<package id="SSH.NET" version="2016.1.0" targetFramework="net46" />
<package id="System.Buffers" version="4.5.1" targetFramework="net46" />
<package id="System.IO.FileSystem.Primitives" version="4.0.1" targetFramework="net46" />
<package id="System.IO.Packaging" version="4.0.0" targetFramework="net46" />
<package id="System.Memory" version="4.5.3" targetFramework="net46" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net46" />
<package id="WebGrease" version="1.6.0" targetFramework="net46" />
</packages>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment