Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
DataEditorX
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
nanahira
DataEditorX
Commits
f714c892
Commit
f714c892
authored
May 20, 2014
by
247321453
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
6c47015a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
58 deletions
+34
-58
DataEditorX/DataEditForm.cs
DataEditorX/DataEditForm.cs
+31
-31
DataEditorX/MyMsg.cs
DataEditorX/MyMsg.cs
+2
-26
DataEditorX/Properties/AssemblyInfo.cs
DataEditorX/Properties/AssemblyInfo.cs
+1
-1
No files found.
DataEditorX/DataEditForm.cs
View file @
f714c892
...
...
@@ -460,7 +460,7 @@ public bool Check()
return
true
;
else
{
MyMsg
.
Warning
(
MyMsg
.
ERROR_NoSelectCDB
);
MyMsg
.
Warning
(
"请打开一个数据库!"
);
return
false
;
}
}
...
...
@@ -469,7 +469,7 @@ public bool Open(string cdbFile)
{
if
(!
File
.
Exists
(
cdbFile
))
{
MyMsg
.
Error
(
string
.
Format
(
MyMsg
.
ERROR_File_NotExisit
,
cdbFile
));
MyMsg
.
Error
(
string
.
Format
(
"文件不存在!\n{0}"
,
cdbFile
));
return
false
;
}
nowCdbFile
=
cdbFile
;
...
...
@@ -499,7 +499,7 @@ public void SetCards(Card[] cards, bool isfresh)
else
{
#
if
DEBUG
MyMsg
.
Warning
(
MyMsg
.
ERROR_NoCard
);
MyMsg
.
Warning
(
"没有卡片!"
);
#
endif
cardcount
=
0
;
page
=
1
;
...
...
@@ -538,24 +538,24 @@ public bool AddCard()
Card
c
=
GetCard
();
if
(
c
.
id
<=
0
)
{
MyMsg
.
Error
(
MyMsg
.
ERROR_CardCodeIsZero
);
MyMsg
.
Error
(
"卡片密码必须大于0!"
);
return
false
;
}
foreach
(
Card
ckey
in
cardlist
)
{
if
(
c
.
id
==
ckey
.
id
)
{
MyMsg
.
Warning
(
string
.
Format
(
MyMsg
.
ERROR_Card_IsExisit
,
ckey
.
ToString
()));
MyMsg
.
Warning
(
string
.
Format
(
"卡片已经存在!\n{0}"
,
ckey
.
ToString
()));
return
false
;
}
}
if
(
DataBase
.
Command
(
nowCdbFile
,
DataBase
.
GetInsertSQL
(
c
,
true
))>=
2
)
{
MyMsg
.
Show
(
string
.
Format
(
MyMsg
.
INFO_Addition_Card
,
c
.
ToString
()));
MyMsg
.
Show
(
string
.
Format
(
"添加 {0} 成功!"
,
c
.
ToString
()));
Search
(
srcCard
,
true
);
return
true
;
}
MyMsg
.
Error
(
MyMsg
.
ERROR_AdditionFail
);
MyMsg
.
Error
(
"修添加失败!"
);
return
false
;
}
//修改
...
...
@@ -567,22 +567,22 @@ public bool ModCard()
if
(
c
.
Equals
(
oldCard
))
{
MyMsg
.
Show
(
MyMsg
.
INFO_NoChanged
);
MyMsg
.
Show
(
"卡片没有被修改!"
);
return
false
;
}
if
(
c
.
id
<=
0
)
{
MyMsg
.
Error
(
MyMsg
.
ERROR_CardCodeIsZero
);
MyMsg
.
Error
(
"卡片密码必须大于0!"
);
return
false
;
}
string
sql
;
if
(
c
.
id
!=
oldCard
.
id
)
{
if
(
MyMsg
.
Question
(
string
.
Format
(
MyMsg
.
QUES_Delete_Card
,
oldCard
.
ToString
())))
if
(
MyMsg
.
Question
(
string
.
Format
(
"是否删除卡片?\n{0}"
,
oldCard
.
ToString
())))
{
if
(
DataBase
.
Command
(
nowCdbFile
,
DataBase
.
GetDeleteSQL
(
oldCard
))<
2
)
{
MyMsg
.
Error
(
MyMsg
.
ERROR_DeleteFail
);
MyMsg
.
Error
(
"删除失败!"
);
return
false
;
}
}
...
...
@@ -592,11 +592,11 @@ public bool ModCard()
sql
=
DataBase
.
GetUpdateSQL
(
c
);
if
(
DataBase
.
Command
(
nowCdbFile
,
sql
)>
0
)
{
MyMsg
.
Show
(
string
.
Format
(
MyMsg
.
INFO_Modifty_Card
,
c
.
ToString
()));
MyMsg
.
Show
(
string
.
Format
(
"修改 {0} 成功!"
,
c
.
ToString
()));
Search
(
srcCard
,
true
);
}
else
MyMsg
.
Error
(
MyMsg
.
ERROR_ModiftyFail
);
MyMsg
.
Error
(
"修改失败!"
);
return
false
;
}
//删除
...
...
@@ -605,9 +605,9 @@ public bool DelCards()
if
(!
Check
())
return
false
;
int
ic
=
lv_cardlist
.
SelectedItems
.
Count
;
if
(
ic
>
=
0
)
if
(
ic
=
=
0
)
return
false
;
if
(!
MyMsg
.
Question
(
string
.
Format
(
MyMsg
.
QUES_Delete_Cards
,
ic
)))
if
(!
MyMsg
.
Question
(
string
.
Format
(
"是否删除选择的{0}张卡?"
,
ic
)))
return
false
;
List
<
string
>
sql
=
new
List
<
string
>();
foreach
(
ListViewItem
lvitem
in
lv_cardlist
.
SelectedItems
)
...
...
@@ -621,13 +621,13 @@ public bool DelCards()
}
if
(
DataBase
.
Command
(
nowCdbFile
,
sql
.
ToArray
())>=(
sql
.
Count
*
2
))
{
MyMsg
.
Show
(
MyMsg
.
INFO_Delete
);
MyMsg
.
Show
(
"删除成功!"
);
Search
(
srcCard
,
true
);
return
true
;
}
else
{
MyMsg
.
Error
(
MyMsg
.
ERROR_DeleteFail
);
MyMsg
.
Error
(
"删除失败!"
);
Search
(
srcCard
,
true
);
}
...
...
@@ -641,7 +641,7 @@ public bool OpenScript()
string
lua
=
Path
.
Combine
(
LUAPTH
,
"c"
+
tb_cardcode
.
Text
+
".lua"
);
if
(!
File
.
Exists
(
lua
))
{
if
(
MyMsg
.
Question
(
string
.
Format
(
MyMsg
.
QUES_Create_Lua_
,
lua
)))
if
(
MyMsg
.
Question
(
string
.
Format
(
"是否创建脚本?\n{0}"
,
lua
)))
{
File
.
Create
(
lua
);
}
...
...
@@ -724,7 +724,7 @@ void Setscripttext(string str)
}
catch
{
index
=-
1
;
MyMsg
.
Error
(
MyMsg
.
ERROR_NoSeclectScriptText
);
MyMsg
.
Error
(
"请选中脚本文本"
);
}
if
(
index
>=
0
)
{
...
...
@@ -743,7 +743,7 @@ string Getscripttext()
}
catch
{
index
=-
1
;
MyMsg
.
Error
(
MyMsg
.
ERROR_NoSeclectScriptText
);
MyMsg
.
Error
(
"请选中脚本文本"
);
}
if
(
index
>=
0
)
return
strs
[
index
];
...
...
@@ -767,7 +767,7 @@ void Tb_edittextKeyPress(object sender, KeyPressEventArgs e)
#
region
帮助菜单
void
Menuitem_aboutClick
(
object
sender
,
EventArgs
e
)
{
MyMsg
.
Show
(
MyMsg
.
ABOUT
);
MyMsg
.
Show
(
"程序:DataEditorX\n作者:247321453\nE-mail:247321453@qq.com\n"
);
}
void
Menuitem_checkupdateClick
(
object
sender
,
EventArgs
e
)
...
...
@@ -785,8 +785,8 @@ void Menuitem_openClick(object sender, EventArgs e)
{
using
(
OpenFileDialog
dlg
=
new
OpenFileDialog
())
{
dlg
.
Title
=
MyMsg
.
STR_OpenCDB
;
dlg
.
Filter
=
MyMsg
.
STR_CDBFilter
;
dlg
.
Title
=
"选择卡片数据库(cdb文件)"
;
dlg
.
Filter
=
"cdb文件(*.cdb)|*.cdb|所有文件(*.*)|*.*"
;
if
(
dlg
.
ShowDialog
()==
DialogResult
.
OK
)
{
Open
(
dlg
.
FileName
);
...
...
@@ -797,8 +797,8 @@ void Menuitem_newClick(object sender, EventArgs e)
{
using
(
SaveFileDialog
dlg
=
new
SaveFileDialog
())
{
dlg
.
Title
=
MyMsg
.
STR_SaveCDB
;
dlg
.
Filter
=
MyMsg
.
STR_CDBFilter
;
dlg
.
Title
=
"选择卡片数据库(cdb文件)保存位置"
;
dlg
.
Filter
=
"cdb文件(*.cdb)|*.cdb|所有文件(*.*)|*.*"
;
if
(
dlg
.
ShowDialog
()==
DialogResult
.
OK
)
{
if
(
DataBase
.
Create
(
dlg
.
FileName
))
...
...
@@ -836,11 +836,11 @@ void CopyTo(bool onlyselect)
cards
.
AddRange
(
cardlist
.
ToArray
());
using
(
OpenFileDialog
dlg
=
new
OpenFileDialog
())
{
dlg
.
Title
=
MyMsg
.
STR_OpenCDB
;
dlg
.
Filter
=
MyMsg
.
STR_CDBFilter
;
dlg
.
Title
=
"选择卡片数据库(cdb文件)"
;
dlg
.
Filter
=
"cdb文件(*.cdb)|*.cdb|所有文件(*.*)|*.*"
;
if
(
dlg
.
ShowDialog
()==
DialogResult
.
OK
)
{
if
(
MyMsg
.
Question
(
MyMsg
.
QUES_ReplaceCard
))
if
(
MyMsg
.
Question
(
"是否覆盖已经存在的卡片?"
))
DataBase
.
CopyDB
(
dlg
.
FileName
,
false
,
cards
.
ToArray
());
else
DataBase
.
CopyDB
(
dlg
.
FileName
,
true
,
cards
.
ToArray
());
...
...
@@ -853,8 +853,8 @@ void Menuitem_readydkClick(object sender, EventArgs e)
return
;
using
(
OpenFileDialog
dlg
=
new
OpenFileDialog
())
{
dlg
.
Title
=
MyMsg
.
STR_Openydk
;
dlg
.
Filter
=
MyMsg
.
STR_ydkFilter
;
dlg
.
Title
=
"选择卡组文件(ydk文件)"
;
dlg
.
Filter
=
"ydk文件(*.ydk)|*.ydk|所有文件(*.*)|*.*"
;
if
(
dlg
.
ShowDialog
()==
DialogResult
.
OK
)
{
SetCards
(
DataBase
.
ReadYdk
(
nowCdbFile
,
dlg
.
FileName
),
false
);
...
...
@@ -868,7 +868,7 @@ void Menuitem_readimagesClick(object sender, EventArgs e)
return
;
using
(
FolderBrowserDialog
fdlg
=
new
FolderBrowserDialog
())
{
fdlg
.
Description
=
MyMsg
.
STR_SelectImages
;
fdlg
.
Description
=
"请选择卡片图像目录"
;
if
(
fdlg
.
ShowDialog
()==
DialogResult
.
OK
)
{
SetCards
(
DataBase
.
ReadImage
(
nowCdbFile
,
fdlg
.
SelectedPath
),
false
);
...
...
DataEditorX/MyMsg.cs
View file @
f714c892
...
...
@@ -11,34 +11,10 @@
namespace
DataEditorX
{
/// <summary>
///
Description of MyMsg.
///
消息
/// </summary>
public
static
class
MyMsg
{
public
static
readonly
string
ABOUT
=
"程序:DataEditorX\n作者:247321453\nE-mail:247321453@qq.com\n"
;
public
static
readonly
string
ERROR_NoSeclectScriptText
=
"请选中脚本文本"
;
public
static
readonly
string
INFO_Delete
=
"删除成功!"
;
public
static
readonly
string
INFO_Modifty_Card
=
"修改 {0} 成功!"
;
public
static
readonly
string
INFO_Addition_Card
=
"添加 {0} 成功!"
;
public
static
readonly
string
INFO_NoChanged
=
"卡片没有被修改!"
;
public
static
readonly
string
ERROR_NoCard
=
"没有卡片!"
;
public
static
readonly
string
ERROR_NoSelectCDB
=
"请打开一个数据库!"
;
public
static
readonly
string
ERROR_Card_IsExisit
=
"卡片已经存在!\n{0}"
;
public
static
readonly
string
ERROR_File_NotExisit
=
"文件不存在!\n{0}"
;
public
static
readonly
string
ERROR_ModiftyFail
=
"修改失败!"
;
public
static
readonly
string
ERROR_AdditionFail
=
"修添加失败!"
;
public
static
readonly
string
ERROR_CardCodeIsZero
=
"卡片密码必须大于0!"
;
public
static
readonly
string
ERROR_DeleteFail
=
"删除失败!"
;
public
static
readonly
string
QUES_Create_Lua_
=
"是否创建脚本?\n{0}"
;
public
static
readonly
string
QUES_Delete_Card
=
"是否删除卡片?\n{0}"
;
public
static
readonly
string
QUES_Delete_Cards
=
"是否删除选择的{0}张卡?"
;
public
static
readonly
string
QUES_ReplaceCard
=
"是否覆盖已经存在的卡片?"
;
public
static
readonly
string
STR_OpenCDB
=
"选择卡片数据库(cdb文件)"
;
public
static
readonly
string
STR_SaveCDB
=
"选择卡片数据库(cdb文件)保存位置"
;
public
static
readonly
string
STR_Openydk
=
"选择卡组文件(ydk文件)"
;
public
static
readonly
string
STR_SelectImages
=
"请选择卡片图像目录"
;
public
static
readonly
string
STR_CDBFilter
=
"cdb文件(*.cdb)|*.cdb|所有文件(*.*)|*.*"
;
public
static
readonly
string
STR_ydkFilter
=
"ydk文件(*.ydk)|*.ydk|所有文件(*.*)|*.*"
;
{
public
static
void
Show
(
string
strMsg
)
{
MessageBox
.
Show
(
strMsg
,
"提示"
,
...
...
DataEditorX/Properties/AssemblyInfo.cs
View file @
f714c892
...
...
@@ -28,4 +28,4 @@
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[
assembly
:
AssemblyVersion
(
"1.
0.*
"
)]
[
assembly
:
AssemblyVersion
(
"1.
1.0.2
"
)]
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