Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
code
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
solho
code
Commits
d468f47a
Commit
d468f47a
authored
Apr 15, 2021
by
solho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.架構調整
parent
edaf4ddb
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
108 additions
and
87 deletions
+108
-87
WebAPI/App_Start/RouteConfig.cs
WebAPI/App_Start/RouteConfig.cs
+1
-1
WebAPI/App_Start/WebApiConfig.cs
WebAPI/App_Start/WebApiConfig.cs
+7
-0
WebAPI/Controllers/Cur_hisController.cs
WebAPI/Controllers/Cur_hisController.cs
+1
-1
WebAPI/Controllers/FeeOfferConfigController.cs
WebAPI/Controllers/FeeOfferConfigController.cs
+1
-0
WebAPI/Models/CommonModel.cs
WebAPI/Models/CommonModel.cs
+1
-78
WebAPI/Models/Esn_Todos_FlowModel.cs
WebAPI/Models/Esn_Todos_FlowModel.cs
+7
-5
WebAPI/Tool/Common.cs
WebAPI/Tool/Common.cs
+84
-1
WebAPI/WebAPI.csproj
WebAPI/WebAPI.csproj
+6
-1
No files found.
WebAPI/App_Start/RouteConfig.cs
View file @
d468f47a
...
@@ -15,7 +15,7 @@ namespace WebAPI
...
@@ -15,7 +15,7 @@ namespace WebAPI
routes
.
MapRoute
(
routes
.
MapRoute
(
name
:
"Default"
,
name
:
"Default"
,
url
:
"
sol/
{controller}/{action}/{id}"
,
url
:
"{controller}/{action}/{id}"
,
defaults
:
new
{
controller
=
"Home"
,
action
=
"Index"
,
id
=
UrlParameter
.
Optional
}
defaults
:
new
{
controller
=
"Home"
,
action
=
"Index"
,
id
=
UrlParameter
.
Optional
}
);
);
}
}
...
...
WebAPI/App_Start/WebApiConfig.cs
View file @
d468f47a
...
@@ -21,6 +21,13 @@ namespace WebAPI
...
@@ -21,6 +21,13 @@ namespace WebAPI
routeTemplate
:
"api/{controller}/{id}"
,
routeTemplate
:
"api/{controller}/{id}"
,
defaults
:
new
{
id
=
RouteParameter
.
Optional
}
defaults
:
new
{
id
=
RouteParameter
.
Optional
}
);
);
config
.
Routes
.
MapHttpRoute
(
name
:
"solApi"
,
routeTemplate
:
"sol/{controller}/{id}"
,
defaults
:
new
{
id
=
RouteParameter
.
Optional
}
);
}
}
}
}
}
}
WebAPI/Controllers/Cur_hisController.cs
View file @
d468f47a
...
@@ -13,7 +13,7 @@ using System.Web;
...
@@ -13,7 +13,7 @@ using System.Web;
using
System.Web.Http
;
using
System.Web.Http
;
using
System.Web.Http.Cors
;
using
System.Web.Http.Cors
;
using
WebAPI.Models
;
using
WebAPI.Models
;
using
static
WebAPI
.
Models
.
CommonModel
;
using
static
WebAPI
.
Tool
.
Common
;
namespace
WebAPI.Controllers
namespace
WebAPI.Controllers
{
{
...
...
WebAPI/Controllers/FeeOfferConfigController.cs
View file @
d468f47a
...
@@ -12,6 +12,7 @@ using System.Web.Http;
...
@@ -12,6 +12,7 @@ using System.Web.Http;
using
System.Web.Http.Cors
;
using
System.Web.Http.Cors
;
using
WebAPI.Models
;
using
WebAPI.Models
;
using
static
WebAPI
.
Models
.
CommonModel
;
using
static
WebAPI
.
Models
.
CommonModel
;
using
static
WebAPI
.
Tool
.
Common
;
namespace
WebAPI.Controllers
namespace
WebAPI.Controllers
{
{
...
...
WebAPI/Models/CommonModel.cs
View file @
d468f47a
...
@@ -22,83 +22,6 @@ namespace WebAPI.Models
...
@@ -22,83 +22,6 @@ namespace WebAPI.Models
}
}
public
class
CommonModel
public
class
CommonModel
{
{
#
region
共用函式
public
static
DataSet
SqlToDs
(
SqlCommand
cmd
)
{
using
(
DataSet
ds
=
new
DataSet
())
{
SqlDataAdapter
da
=
new
SqlDataAdapter
{
SelectCommand
=
cmd
};
da
.
Fill
(
ds
);
return
ds
;
}
}
public
static
DataTable
SqlToDt
(
SqlCommand
cmd
)
{
using
(
DataTable
dt
=
new
DataTable
())
{
if
(
cmd
.
Connection
.
State
==
ConnectionState
.
Closed
)
cmd
.
Connection
.
Open
();
dt
.
Load
(
cmd
.
ExecuteReader
());
cmd
.
Connection
.
Close
();
return
dt
;
}
}
public
static
string
EastAsia_Format
(
string
Msg
)
{
Match
m
;
while
((
m
=
Regex
.
Match
(
Msg
,
"\\d+"
)).
Success
)
{
int
n
=
int
.
Parse
(
m
.
Value
);
string
t
=
EastAsiaNumericFormatter
.
FormatWithCulture
(
"Ln"
,
n
,
null
,
new
CultureInfo
(
"zh-TW"
));
Msg
=
Msg
.
Substring
(
0
,
m
.
Index
)
+
t
+
Msg
.
Substring
(
m
.
Index
+
m
.
Value
.
Length
);
}
return
Msg
;
}
#
region
簡轉繁
internal
const
int
LOCALE_SYSTEM_DEFAULT
=
0x0800
;
internal
const
int
LCMAP_SIMPLIFIED_CHINESE
=
0x02000000
;
internal
const
int
LCMAP_TRADITIONAL_CHINESE
=
0x04000000
;
[
DllImport
(
"kernel32"
,
CharSet
=
CharSet
.
Auto
,
SetLastError
=
true
)]
internal
static
extern
int
LCMapString
(
int
Locale
,
int
dwMapFlags
,
string
lpSrcStr
,
int
cchSrc
,
[
Out
]
string
lpDestStr
,
int
cchDest
);
[
DllImport
(
"kernel32.dll"
,
CharSet
=
CharSet
.
Unicode
,
SetLastError
=
true
)]
internal
static
extern
int
LCMapStringEx
(
string
lpLocaleName
,
// LPCWSTR lpLocaleName
uint
dwMapFlags
,
// DWORD dwMapFlags
string
lpSrcStr
,
// LPCWSTR lpSrcStr
int
cchSrc
,
// int cchSrc
[
Out
]
string
lpDestStr
,
// LPWSTR lpDestStr
int
cchDest
,
// int cchDest
IntPtr
lpVersionInformation
,
// LPNLSVERSIONINFO lpVersionInformation
IntPtr
lpReserved
,
// LPVOID lpReserved
IntPtr
sortHandle
);
// LPARAM sortHandle
public
static
string
ToSimplified
(
string
pSource
)
{
String
tTarget
=
new
String
(
' '
,
pSource
.
Length
);
int
tReturn
=
LCMapString
(
LOCALE_SYSTEM_DEFAULT
,
LCMAP_SIMPLIFIED_CHINESE
,
pSource
,
pSource
.
Length
,
tTarget
,
pSource
.
Length
);
return
tTarget
;
}
public
static
string
ToTraditional
(
string
pSource
)
{
String
tTarget
=
new
String
(
' '
,
pSource
.
Length
);
int
tReturn
=
LCMapStringEx
(
"zh-CN"
,
LCMAP_TRADITIONAL_CHINESE
,
pSource
,
pSource
.
Length
,
tTarget
,
pSource
.
Length
,
IntPtr
.
Zero
,
IntPtr
.
Zero
,
IntPtr
.
Zero
);
return
tTarget
;
}
#
endregion
#
endregion
}
}
}
}
\ No newline at end of file
WebAPI/Models/Esn_Todos_FlowModel.cs
View file @
d468f47a
...
@@ -3,16 +3,16 @@ using System.Collections.Generic;
...
@@ -3,16 +3,16 @@ using System.Collections.Generic;
namespace
WebAPI.Models
namespace
WebAPI.Models
{
{
/// <summary>
/// <summary>
/// 點數結算流程相關
/// 點數結算流程相關
/// </summary>
/// </summary>
public
class
MessageList_ETF
:
MessageList
public
class
MessageList_ETF
:
MessageList
{
{
public
List
<
Esn_Todos_Flow_his
>
FlowHislist
{
get
;
set
;
}
public
List
<
Esn_Todos_FlowModel
>
FlowHislist
{
get
;
set
;
}
}
}
public
class
Esn_Todos_Flow
_his
public
class
Esn_Todos_Flow
Model
{
{
public
DateTime
?
ConfirmTime
{
get
;
set
;
}
public
DateTime
?
ConfirmTime
{
get
;
set
;
}
public
String
ConfirmUserClass
{
get
;
set
;
}
public
String
ConfirmUserClass
{
get
;
set
;
}
public
String
ConfirmMethod
{
get
;
set
;
}
public
String
ConfirmMethod
{
get
;
set
;
}
...
@@ -23,5 +23,7 @@ namespace WebAPI.Models
...
@@ -23,5 +23,7 @@ namespace WebAPI.Models
public
String
To
{
get
;
set
;
}
public
String
To
{
get
;
set
;
}
public
String
Description
{
get
;
set
;
}
public
String
Description
{
get
;
set
;
}
public
String
Create_User_Name
{
get
;
set
;
}
public
String
Create_User_Name
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
WebAPI/Tool/Common.cs
View file @
d468f47a
using
MySql.Data.MySqlClient
;
using
Microsoft.International.Formatters
;
using
MySql.Data.MySqlClient
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System
;
...
@@ -6,10 +7,14 @@ using System.Collections;
...
@@ -6,10 +7,14 @@ using System.Collections;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Collections.Specialized
;
using
System.Collections.Specialized
;
using
System.Data
;
using
System.Data
;
using
System.Data.SqlClient
;
using
System.Globalization
;
using
System.Linq
;
using
System.Linq
;
using
System.Net
;
using
System.Net
;
using
System.Reflection
;
using
System.Reflection
;
using
System.Runtime.InteropServices
;
using
System.Text
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Web
;
using
System.Web
;
using
WebAPI.Models
;
using
WebAPI.Models
;
...
@@ -184,5 +189,83 @@ namespace WebAPI.Tool
...
@@ -184,5 +189,83 @@ namespace WebAPI.Tool
}
}
return
result
;
return
result
;
}
}
#
region
共用函式
public
static
DataSet
SqlToDs
(
SqlCommand
cmd
)
{
using
(
DataSet
ds
=
new
DataSet
())
{
SqlDataAdapter
da
=
new
SqlDataAdapter
{
SelectCommand
=
cmd
};
da
.
Fill
(
ds
);
return
ds
;
}
}
public
static
DataTable
SqlToDt
(
SqlCommand
cmd
)
{
using
(
DataTable
dt
=
new
DataTable
())
{
if
(
cmd
.
Connection
.
State
==
ConnectionState
.
Closed
)
cmd
.
Connection
.
Open
();
dt
.
Load
(
cmd
.
ExecuteReader
());
cmd
.
Connection
.
Close
();
return
dt
;
}
}
public
static
string
EastAsia_Format
(
string
Msg
)
{
Match
m
;
while
((
m
=
Regex
.
Match
(
Msg
,
"\\d+"
)).
Success
)
{
int
n
=
int
.
Parse
(
m
.
Value
);
string
t
=
EastAsiaNumericFormatter
.
FormatWithCulture
(
"Ln"
,
n
,
null
,
new
CultureInfo
(
"zh-TW"
));
Msg
=
Msg
.
Substring
(
0
,
m
.
Index
)
+
t
+
Msg
.
Substring
(
m
.
Index
+
m
.
Value
.
Length
);
}
return
Msg
;
}
#
region
簡轉繁
internal
const
int
LOCALE_SYSTEM_DEFAULT
=
0x0800
;
internal
const
int
LCMAP_SIMPLIFIED_CHINESE
=
0x02000000
;
internal
const
int
LCMAP_TRADITIONAL_CHINESE
=
0x04000000
;
[
DllImport
(
"kernel32"
,
CharSet
=
CharSet
.
Auto
,
SetLastError
=
true
)]
internal
static
extern
int
LCMapString
(
int
Locale
,
int
dwMapFlags
,
string
lpSrcStr
,
int
cchSrc
,
[
Out
]
string
lpDestStr
,
int
cchDest
);
[
DllImport
(
"kernel32.dll"
,
CharSet
=
CharSet
.
Unicode
,
SetLastError
=
true
)]
internal
static
extern
int
LCMapStringEx
(
string
lpLocaleName
,
// LPCWSTR lpLocaleName
uint
dwMapFlags
,
// DWORD dwMapFlags
string
lpSrcStr
,
// LPCWSTR lpSrcStr
int
cchSrc
,
// int cchSrc
[
Out
]
string
lpDestStr
,
// LPWSTR lpDestStr
int
cchDest
,
// int cchDest
IntPtr
lpVersionInformation
,
// LPNLSVERSIONINFO lpVersionInformation
IntPtr
lpReserved
,
// LPVOID lpReserved
IntPtr
sortHandle
);
// LPARAM sortHandle
public
static
string
ToSimplified
(
string
pSource
)
{
String
tTarget
=
new
String
(
' '
,
pSource
.
Length
);
int
tReturn
=
LCMapString
(
LOCALE_SYSTEM_DEFAULT
,
LCMAP_SIMPLIFIED_CHINESE
,
pSource
,
pSource
.
Length
,
tTarget
,
pSource
.
Length
);
return
tTarget
;
}
public
static
string
ToTraditional
(
string
pSource
)
{
String
tTarget
=
new
String
(
' '
,
pSource
.
Length
);
int
tReturn
=
LCMapStringEx
(
"zh-CN"
,
LCMAP_TRADITIONAL_CHINESE
,
pSource
,
pSource
.
Length
,
tTarget
,
pSource
.
Length
,
IntPtr
.
Zero
,
IntPtr
.
Zero
,
IntPtr
.
Zero
);
return
tTarget
;
}
#
endregion
#
endregion
}
}
}
}
\ No newline at end of file
WebAPI/WebAPI.csproj
View file @
d468f47a
...
@@ -177,6 +177,9 @@
...
@@ -177,6 +177,9 @@
<Reference
Include=
"Ubiety.Dns.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL"
>
<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>
<HintPath>
packages\MySql.Data.8.0.22\lib\net452\Ubiety.Dns.Core.dll
</HintPath>
</Reference>
</Reference>
<Reference
Include=
"WebActivator, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
packages\WebActivator.1.0.0.0\lib\WebActivator.dll
</HintPath>
</Reference>
<Reference
Include=
"WebGrease"
>
<Reference
Include=
"WebGrease"
>
<Private>
True
</Private>
<Private>
True
</Private>
<HintPath>
.\packages\WebGrease.1.6.0\lib\WebGrease.dll
</HintPath>
<HintPath>
.\packages\WebGrease.1.6.0\lib\WebGrease.dll
</HintPath>
...
@@ -196,13 +199,15 @@
...
@@ -196,13 +199,15 @@
</Reference>
</Reference>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Compile
Include=
"Controllers\Esn_Subitem\Esn_todosController.cs"
/>
<Compile
Include=
"Controllers\DictionaryController.cs"
/>
<Compile
Include=
"Controllers\DictionaryController.cs"
/>
<Compile
Include=
"Controllers\Esn_Todos_FlowController.cs"
/>
<Compile
Include=
"Controllers\Esn_
Subitem\Esn_
Todos_FlowController.cs"
/>
<Compile
Include=
"Controllers\FileController.cs"
/>
<Compile
Include=
"Controllers\FileController.cs"
/>
<Compile
Include=
"Controllers\InventorController.cs"
/>
<Compile
Include=
"Controllers\InventorController.cs"
/>
<Compile
Include=
"Controllers\SubProcInfoController.cs"
/>
<Compile
Include=
"Controllers\SubProcInfoController.cs"
/>
<Compile
Include=
"Controllers\ProcInfoController.cs"
/>
<Compile
Include=
"Controllers\ProcInfoController.cs"
/>
<Compile
Include=
"Models\Esn_Todos_FlowModel.cs"
/>
<Compile
Include=
"Models\Esn_Todos_FlowModel.cs"
/>
<Compile
Include=
"Models\Esn_TodosModel.cs"
/>
<Compile
Include=
"Models\ParamModel.cs"
/>
<Compile
Include=
"Models\ParamModel.cs"
/>
<Compile
Include=
"Models\CommonResponseMsg.cs"
/>
<Compile
Include=
"Models\CommonResponseMsg.cs"
/>
<Compile
Include=
"Tool\Common.cs"
/>
<Compile
Include=
"Tool\Common.cs"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment