"
));
@@ -262,7 +326,6 @@ void CreateCmdLine()
""
));
-
this.Controls.Add(new LiteralControl(
" | "
));
@@ -271,7 +334,6 @@ void CreateCmdLine()
pageswitcher.ID = "pageswitcher";
this.Controls.Add(pageswitcher);
-
LinkButton firstpage = new LinkButton();
firstpage.ID = "first";
firstpage.Text = this.GetString("首页");
@@ -303,7 +365,6 @@ void CreateCmdLine()
" "
));
-
LinkButton nextpage = new LinkButton();
nextpage.ID = "next";
nextpage.Text = this.GetString("后页");
@@ -337,7 +398,6 @@ void CreateCmdLine()
literal.Text = " " + this.GetString("第") + " "; // " 第 "
pageswitcher.Controls.Add(literal);
-
TextBox textbox = new TextBox();
textbox.ID = "gotopageno";
textbox.Width = new Unit("40");
@@ -396,7 +456,6 @@ void lastpage_Click(object sender, EventArgs e)
this.StartIndex = (this.ResultCount / this.PageMaxLines) * this.PageMaxLines;
else
this.StartIndex = Math.Max(0, (this.ResultCount / this.PageMaxLines) * this.PageMaxLines - 1);
-
}
void nextpage_Click(object sender, EventArgs e)
@@ -420,169 +479,221 @@ void firstpage_Click(object sender, EventArgs e)
this.StartIndex = 0;
}
-
- protected override void Render(HtmlTextWriter writer)
+ class LineInfo
{
- int nRet = 0;
+ public string strBarcode { get; set; }
+ public string strRecPath { get; set; }
+ public string strBorrowDate { get; set; }
+ public string strBorrowPeriod { get; set; }
+ public string strBorrowOperator { get; set; } // 2016/1/1
+ public string strReturnDate { get; set; }
+ public string strNo { get; set; }
+ public string strRenewComment { get; set; }
+ public string strOperator { get; set; }
+
+ public LineInfo()
+ {
- string strError = "";
- // return:
- // -1 出错
- // 0 成功
- // 1 尚未登录
- nRet = this.LoadReaderXml(out strError);
- if (nRet == -1)
+ }
+
+ public LineInfo(XmlElement node)
{
- writer.Write(strError);
- return;
+ this.strBarcode = DomUtil.GetAttr(node, "barcode");
+ this.strRecPath = DomUtil.GetAttr(node, "recPath");
+ this.strBorrowDate = DateTimeUtil.LocalTime(DomUtil.GetAttr(node, "borrowDate"));
+ this.strBorrowPeriod = DomUtil.GetAttr(node, "borrowPeriod");
+ this.strReturnDate = DateTimeUtil.LocalTime(DomUtil.GetAttr(node, "returnDate"));
+ this.strNo = DomUtil.GetAttr(node, "no");
+ this.strRenewComment = DomUtil.GetAttr(node, "renewComment");
+ this.strOperator = DomUtil.GetAttr(node, "operator");
}
- if (nRet == 1)
+ public LineInfo(ChargingItemWrapper wrapper)
{
- sessioninfo.LoginCallStack.Push(this.Page.Request.RawUrl);
- this.Page.Response.Redirect("login.aspx", true);
- return;
+ this.strBarcode = wrapper.Item.ItemBarcode;
+ this.strRecPath = "";
+ this.strBorrowDate = wrapper.RelatedItem == null ? "" : wrapper.RelatedItem.OperTime;
+ this.strBorrowPeriod = wrapper.RelatedItem == null ? "" : wrapper.RelatedItem.Period;
+ this.strBorrowOperator = wrapper.RelatedItem == null ? "" : wrapper.RelatedItem.Operator;
+ this.strReturnDate = wrapper.Item.OperTime;
+ this.strNo = wrapper.RelatedItem == null ? "" : wrapper.RelatedItem.No;
+ if (this.strNo == "0")
+ this.strNo = "";
+
+ this.strRenewComment = "";
+ this.strOperator = wrapper.Item.Operator;
}
- int nPageNo = this.StartIndex / this.PageMaxLines;
+ public bool IsEmpty()
+ {
+ return (string.IsNullOrEmpty(this.strBarcode) == true);
+ }
+ }
+
+ protected override void Render(HtmlTextWriter writer)
+ {
+ int nRet = 0;
- XmlNodeList nodes = ReaderDom.DocumentElement.SelectNodes("borrowHistory/borrow");
+ string strError = "";
+ List infos = new List();
- SetResultInfo(nodes.Count);
+ int nPageNo = this.StartIndex / this.PageMaxLines;
- if (nodes.Count != 0)
+ if (this.DatabaseMode == false)
{
- OpacApplication app = (OpacApplication)this.Page.Application["app"];
- SessionInfo sessioninfo = (SessionInfo)this.Page.Session["sessioninfo"];
+ // return:
+ // -1 出错
+ // 0 成功
+ // 1 尚未登录
+ nRet = this.LoadReaderXml(out strError);
+ if (nRet == -1)
+ {
+ writer.Write(strError);
+ return;
+ }
+ if (nRet == 1)
+ {
+ sessioninfo.LoginCallStack.Push(this.Page.Request.RawUrl);
+ this.Page.Response.Redirect("login.aspx", true);
+ return;
+ }
+
+ XmlNodeList nodes = ReaderDom.DocumentElement.SelectNodes("borrowHistory/borrow");
+
+ SetResultInfo(nodes.Count);
- // 显示本页中的浏览行
for (int i = this.StartIndex; i < this.StartIndex + this.PageMaxLines; i++)
{
- /*
- string strBarcode = "";
- string strRecPath = "";
- string strBorrowDate = "";
- string strBorrowPeriod = "";
- string strReturnDate = "";
- string strNo = "";
- string strRenewComment = "";
- string strOperator = "";
- string strBarcodeLink = "";
- string strSummary = "";
- string strBiblioRecPath = "";
- * */
-
- string strResult = "";
-
if (i >= nodes.Count)
{
- string strTrClass = " class='dark content blank' ";
-
- if ((i % 2) == 1)
- strTrClass = " class='light content blank' ";
-
- strResult += "";
-
- strResult += "" + (i + 1).ToString() + " | ";
- strResult += " | ";
- strResult += " | ";
- strResult += " | ";
- strResult += "";
- strResult += " | ";
- strResult += " ";
-
+ infos.Add(new LineInfo());
}
else
{
-
XmlNode node = nodes[i];
- string strBarcode = DomUtil.GetAttr(node, "barcode");
- string strRecPath = DomUtil.GetAttr(node, "recPath");
- string strBorrowDate = DateTimeUtil.LocalTime(DomUtil.GetAttr(node, "borrowDate"));
- string strBorrowPeriod = DomUtil.GetAttr(node, "borrowPeriod");
- string strReturnDate = DateTimeUtil.LocalTime(DomUtil.GetAttr(node, "returnDate"));
- string strNo = DomUtil.GetAttr(node, "no");
- string strRenewComment = DomUtil.GetAttr(node, "renewComment");
- string strOperator = DomUtil.GetAttr(node, "operator");
-
- string strBarcodeLink = "" + strBarcode + "";
-
-#if NO
- // 获得摘要
- string strSummary = "";
- string strBiblioRecPath = "";
-
- long lRet = sessioninfo.Channel.GetBiblioSummary(
- null,
- strBarcode,
- null,
- null,
- out strBiblioRecPath,
- out strSummary,
- out strError);
- if (lRet == -1 || lRet == 0)
- strSummary = strError;
- /*
- LibraryServerResult result = app.GetBiblioSummary(
- sessioninfo,
- strBarcode,
- null,
- null,
- out strBiblioRecPath,
- out strSummary);
- if (result.Value == -1 || result.Value == 0)
- strSummary = result.ErrorInfo;
- */
-#endif
-
- string strTrClass = " class='dark content' ";
+ infos.Add(new LineInfo(node as XmlElement));
+ }
+ }
+ }
+ else
+ {
+ List results = null;
- if ((i % 2) == 1)
- strTrClass = " class='light content' ";
+ // return:
+ // -2 尚未登录
+ // -1 出错
+ // 其它 符合条件的事项总数
+ nRet = GetChargingHistory(nPageNo,
+ this.PageMaxLines,
+ out results,
+ out strError);
+ if (nRet == -1)
+ {
+ writer.Write(strError);
+ return;
+ }
+ if (nRet == -2)
+ {
+ sessioninfo.LoginCallStack.Push(this.Page.Request.RawUrl);
+ this.Page.Response.Redirect("login.aspx", true);
+ return;
+ }
+ SetResultInfo(nRet);
- strResult += "";
-
- strResult += "" + (i + 1).ToString() + " | ";
- strResult += "" + strBarcodeLink + " | ";
- strResult += "" + strBarcode + " | ";
-
- strBorrowPeriod = app.GetDisplayTimePeriodStringEx(strBorrowPeriod);
-
- strResult += ""
- + " "
- + this.GetString("续借次")
- + " :" + strNo + " "
- + ""
- + this.GetString("借阅日期")
- + ":" + strBorrowDate + " "
- + ""
- + this.GetString("期限")
- + ": " + strBorrowPeriod + " "
- + ""
- + this.GetString("还书日期")
- + ":" + strReturnDate + " "
- + " | ";
- strResult += "";
- strResult += "" + strOperator + " | ";
- strResult += " ";
+ for (int i = 0; i < this.PageMaxLines; i++)
+ {
+ if (i >= results.Count)
+ {
+ infos.Add(new LineInfo());
+ }
+ else
+ {
+ ChargingItemWrapper wrapper = results[i];
+ LineInfo info = new LineInfo(wrapper);
+ infos.Add(info);
}
+ }
+ }
- PlaceHolder line = (PlaceHolder)this.FindControl("line" + Convert.ToString(i));
- if (line == null)
+ if (infos.Count != 0)
+ {
+ //OpacApplication app = (OpacApplication)this.Page.Application["app"];
+ //SessionInfo sessioninfo = (SessionInfo)this.Page.Session["sessioninfo"];
+
+ // 显示本页中的浏览行
+ {
+ int i = 0;
+ foreach (LineInfo info in infos)
{
- PlaceHolder insertpoint = (PlaceHolder)this.FindControl("insertpoint");
- PlaceHolder content = (PlaceHolder)this.FindControl("content");
+ StringBuilder text = new StringBuilder();
- line = this.NewContentLine(content, i, insertpoint);
- }
+ string strBarcodeLink = "" + info.strBarcode + "";
- LiteralControl contentcontrol = (LiteralControl)this.FindControl("line" + Convert.ToString(i) + "_content");
+ string strTrClass = " class='dark content' ";
- contentcontrol.Text = strResult;
+ if ((i % 2) == 1)
+ strTrClass = " class='light content' ";
- } // end of for
+ text.Append("");
+
+ text.Append("" + (i + this.StartIndex + 1).ToString() + " | ");
+ text.Append("" + strBarcodeLink + " | ");
+ text.Append("" + info.strBarcode + " | ");
+
+ info.strBorrowPeriod = app.GetDisplayTimePeriodStringEx(info.strBorrowPeriod);
+
+ if (info.IsEmpty() == true)
+ text.Append("" + " | ");
+ else
+ {
+ text.Append(""
+ + " "
+ + this.GetString("续借次")
+ + " :" + info.strNo + " "
+ + ""
+ + this.GetString("借阅日期")
+ + ":" + info.strBorrowDate + " "
+ + ""
+ + this.GetString("期限")
+ + ": " + info.strBorrowPeriod + " "
+ + ""
+ + this.GetString("还书日期")
+ + ":" + info.strReturnDate + " "
+ + " | ");
+ }
+
+ text.Append("");
+
+ if (this.DatabaseMode == false || info.IsEmpty())
+ text.Append("" + info.strOperator + " | ");
+ else
+ text.Append(""
+ + " "
+ + this.GetString("借")
+ + ": " + info.strBorrowOperator + " "
+ + ""
+ + this.GetString("还")
+ + ": " + info.strOperator + " "
+ + " | ");
+
+ text.Append(" ");
+
+ PlaceHolder line = (PlaceHolder)this.FindControl("line" + Convert.ToString(i));
+ if (line == null)
+ {
+ PlaceHolder insertpoint = (PlaceHolder)this.FindControl("insertpoint");
+ PlaceHolder content = (PlaceHolder)this.FindControl("content");
+
+ line = this.NewContentLine(content, i, insertpoint);
+ }
+
+ LiteralControl contentcontrol = (LiteralControl)this.FindControl("line" + Convert.ToString(i) + "_content");
+ contentcontrol.Text = text.ToString();
+ i++;
+ } // end of for
+ }
this.LineCount = Math.Max(this.LineCount, this.PageMaxLines);
}
@@ -595,114 +706,9 @@ protected override void Render(HtmlTextWriter writer)
if (line == null)
continue;
}
-
}
base.Render(writer);
}
-
- /*
-
- */
- /*
- protected override void RenderContents(HtmlTextWriter output)
- {
- string strError = "";
- // return:
- // -1 出错
- // 0 成功
- // 1 尚未登录
- int nRet = this.LoadReaderXml(out strError);
- if (nRet == -1)
- {
- output.Write(strError);
- return;
- }
-
- if (nRet == 1)
- {
- sessioninfo.LoginCallStack.Push(this.Page.Request.RawUrl);
- this.Page.Response.Redirect("login.aspx", true);
- return;
- }
-
- string strResult = "";
-
- XmlNodeList nodes = ReaderDom.DocumentElement.SelectNodes("borrowHistory/borrow");
-
- strResult += this.GetPrefixString("借阅历史", null);
- strResult += "";
- strResult += "册条码号 | 书目摘要 | 借阅情况 | 续借注 | 操作者 | ";
-
- if (nodes.Count == 0)
- {
- strResult += "";
- strResult += "";
- strResult += " ";
- }
-
- for (int i = 0; i < nodes.Count; i++)
- {
- XmlNode node = nodes[i];
- string strBarcode = DomUtil.GetAttr(node, "barcode");
- string strRecPath = DomUtil.GetAttr(node, "recPath");
- string strBorrowDate = DateTimeUtil.LocalTime(DomUtil.GetAttr(node, "borrowDate"));
- string strBorrowPeriod = DomUtil.GetAttr(node, "borrowPeriod");
- string strReturnDate = DateTimeUtil.LocalTime(DomUtil.GetAttr(node, "returnDate"));
- string strNo = DomUtil.GetAttr(node, "no");
- string strRenewComment = DomUtil.GetAttr(node, "renewComment");
- string strOperator = DomUtil.GetAttr(node, "operator");
-
- string strBarcodeLink = "" + strBarcode + "";
-
- // 获得摘要
- string strSummary = "";
- string strBiblioRecPath = "";
- Result result = app.GetBiblioSummary(
- sessioninfo,
- strBarcode,
- null,
- null,
- out strBiblioRecPath,
- out strSummary);
- if (result.Value == -1 || result.Value == 0)
- strSummary = result.ErrorInfo;
-
-
- string strTrClass = " class='dark' ";
-
- if ((i % 2) == 1)
- strTrClass = " class='light' ";
-
- strResult += "";
- strResult += "" + strBarcodeLink + " | ";
- strResult += "" + strSummary + " | ";
- strResult += ""
- + " 续借次 :" + strNo + " "
- + "借阅日期:" + strBorrowDate + " "
- + "期限: " + strBorrowPeriod + " "
- + "还书日期:" + strReturnDate + " "
- + " | ";
- strResult += "";
- strResult += "" + strOperator + " | ";
- strResult += " ";
-
- }
-
- strResult += " ";
-
- strResult += this.GetPostfixString();
-
- output.Write(strResult);
- }
- * */
}
}
diff --git a/DigitalPlatform.OPAC.Web/FooterBarControl.cs b/DigitalPlatform.OPAC.Web/FooterBarControl.cs
index 83b23af92..25955a747 100644
--- a/DigitalPlatform.OPAC.Web/FooterBarControl.cs
+++ b/DigitalPlatform.OPAC.Web/FooterBarControl.cs
@@ -61,7 +61,6 @@ int GetParentCount()
return nCount;
}
-
protected override void RenderContents(HtmlTextWriter output)
{
int nParentCount = GetParentCount();
@@ -74,7 +73,6 @@ protected override void RenderContents(HtmlTextWriter output)
EndIndentor.Write(output);
output.Write(" | ");
-
// 底部图像表格 开始
NormalIndentor.Write(output);
@@ -96,12 +94,20 @@ protected override void RenderContents(HtmlTextWriter output)
// 中
NormalIndentor.Write(output);
+#if NO
output.Write(""
+ this.GetString("dp2图书馆集成系统")
+ " V2 - " + this.GetString("版权所有") + " © 2006-2015 "
+ this.GetString("数字平台(北京)软件有限责任公司")
+ ""
+ " | ");
+#endif
+ output.Write(""
+ + this.GetString("dp2 图书馆集成系统")
+ + " V2 - "
+ + "开源的图书馆管理系统"
+ + ""
+ + " | ");
// 右
NormalIndentor.Write(output);
diff --git a/DigitalPlatform.OPAC.Web/LoginControl.cs b/DigitalPlatform.OPAC.Web/LoginControl.cs
index 25d813bb6..066b89a24 100644
--- a/DigitalPlatform.OPAC.Web/LoginControl.cs
+++ b/DigitalPlatform.OPAC.Web/LoginControl.cs
@@ -1202,7 +1202,7 @@ public int DoAnonymouseLogin(out string strError)
// -1 error
// 0 登录未成功
// 1 登录成功
- string strParameters = "location=#opac@" + sessioninfo.ClientIP + ",type=worker";
+ string strParameters = "location=#opac@" + sessioninfo.ClientIP + ",type=worker,client=dp2OPAC|" + OpacApplication.ClientVersion;
long lRet = sessioninfo.Login("public",
"",
strParameters,
@@ -1247,7 +1247,7 @@ public int DoLogin(
sessioninfo.Clear();
long lRet = 0;
- string strParameters = "location=#opac@" + sessioninfo.ClientIP + "";
+ string strParameters = "location=#opac@" + sessioninfo.ClientIP + ",client=dp2OPAC|" + OpacApplication.ClientVersion;
if (strUserType == "librarian")
{
@@ -1501,7 +1501,7 @@ public int DoLogin(string strLibraryCode,
}
long lRet = 0;
- string strParameters = "location=#opac@" + sessioninfo.ClientIP + "";
+ string strParameters = "location=#opac@" + sessioninfo.ClientIP + ",client=dp2OPAC|" + OpacApplication.ClientVersion;
if (this.ActiveLoginColumn == LoginColumn.ID)
{
diff --git a/DigitalPlatform.OPAC.Web/res/BorrowHistoryControl.cs.en-US.resx b/DigitalPlatform.OPAC.Web/res/BorrowHistoryControl.cs.en-US.resx
index 14d627fd8..c536da8b7 100644
--- a/DigitalPlatform.OPAC.Web/res/BorrowHistoryControl.cs.en-US.resx
+++ b/DigitalPlatform.OPAC.Web/res/BorrowHistoryControl.cs.en-US.resx
@@ -112,10 +112,10 @@
2.0
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
({0} pages.)
@@ -124,6 +124,9 @@
Item Information
栏目标题
+
+ Loan
+
Borrow History
面板标题
@@ -186,6 +189,9 @@
Jump to
按钮
+
+ Return
+
Return Date
栏目内容小标题
diff --git a/DigitalPlatform.OPAC.Web/res/BorrowHistoryControl.cs.zh-CN.resx b/DigitalPlatform.OPAC.Web/res/BorrowHistoryControl.cs.zh-CN.resx
index d5a37d559..bb508d22c 100644
--- a/DigitalPlatform.OPAC.Web/res/BorrowHistoryControl.cs.zh-CN.resx
+++ b/DigitalPlatform.OPAC.Web/res/BorrowHistoryControl.cs.zh-CN.resx
@@ -112,10 +112,10 @@
2.0
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
(共 {0} 页)
@@ -124,6 +124,9 @@
书目摘要
栏目标题
+
+ 借
+
借阅历史
面板标题
@@ -186,6 +189,9 @@
跳到
按钮
+
+ 还
+
还书日期
栏目内容小标题
diff --git a/DigitalPlatform.OPAC.Web/res/ItemControl.cs.en-US.resx b/DigitalPlatform.OPAC.Web/res/ItemControl.cs.en-US.resx
index bce055615..719093b1e 100644
--- a/DigitalPlatform.OPAC.Web/res/ItemControl.cs.en-US.resx
+++ b/DigitalPlatform.OPAC.Web/res/ItemControl.cs.en-US.resx
@@ -145,7 +145,7 @@
Publish time
- Volumn
+ Volume
Reference ID
diff --git a/DigitalPlatform.rms.Client/RmsChannel.cs b/DigitalPlatform.rms.Client/RmsChannel.cs
index d1fd245cc..fd0a8c829 100644
--- a/DigitalPlatform.rms.Client/RmsChannel.cs
+++ b/DigitalPlatform.rms.Client/RmsChannel.cs
@@ -5071,7 +5071,6 @@ public long GetRes(string strPath,
out string strOutputResPath,
out string strError)
{
-
strMetaData = "";
strResult = "";
strError = "";
@@ -5105,7 +5104,6 @@ public long GetRes(string strPath,
REDO:
try
{
-
// string strStyle = "content,data";
IAsyncResult soapresult = this.ws.BeginGetRes(strPath,
lStart,
@@ -5181,12 +5179,9 @@ public long GetRes(string strPath,
return -1;
}
-
-
if (StringUtil.IsInList("data", strStyle) != true)
break;
-
baTotal = ByteArray.Add(baTotal, baContent);
// bytes.AddRange(baContent);
diff --git a/DigitalPlatform.rms.db/KernelApplication.cs b/DigitalPlatform.rms.db/KernelApplication.cs
index a697738a7..b0e6b5892 100644
--- a/DigitalPlatform.rms.db/KernelApplication.cs
+++ b/DigitalPlatform.rms.db/KernelApplication.cs
@@ -17,7 +17,7 @@
namespace DigitalPlatform.rms
{
// 全局信息
- public partial class KernelApplication
+ public partial class KernelApplication
{
// private string m_strLogFileName = ""; //日志文件名称
private string m_strDebugFileName = ""; //
@@ -149,7 +149,7 @@ public void ThreadMain()
eventFinished.Set();
}
- catch(Exception ex)
+ catch (Exception ex)
{
this.WriteErrorLog("管理线程异常(线程已退出):" + ExceptionUtil.GetDebugText(ex));
}
@@ -287,7 +287,7 @@ void CleanSessionDir(string strSessionDir)
}
}
}
- catch(Exception ex)
+ catch (Exception ex)
{
this.WriteErrorLog("删除 session 下级目录时出错: " + ExceptionUtil.GetDebugText(ex));
}
@@ -332,7 +332,7 @@ public int Initial(string strDataDir,
}
this.LogDir = strLogDir;
-
+
// this.m_strLogFileName = strLogDir + "\\log.txt";
this.m_strDebugFileName = strLogDir + "\\debug.txt";
@@ -431,7 +431,7 @@ public int Initial(string strDataDir,
void CleanResultSetDir(string strResultSetDir)
{
if (PathUtil.TryClearDir(strResultSetDir) == false)
- this.WriteErrorLog("清除 结果集目录 "+strResultSetDir+" 时出错");
+ this.WriteErrorLog("清除 结果集目录 " + strResultSetDir + " 时出错");
}
// 整数返回值转换为ErrorCode
@@ -477,7 +477,6 @@ public string GetCopyRightString()
+ "\r\n" + myAssembly.FullName;
return strResult;
-
}
// 关闭
@@ -668,7 +667,7 @@ public Result()
public Result(
string strError,
- ErrorCodeValue errorcode,
+ ErrorCodeValue errorcode,
int nValue)
{
this.ErrorCode = errorcode;
diff --git a/DigitalPlatform.rms.db/SessionInfo.cs b/DigitalPlatform.rms.db/SessionInfo.cs
index 5478df410..e473afbaf 100644
--- a/DigitalPlatform.rms.db/SessionInfo.cs
+++ b/DigitalPlatform.rms.db/SessionInfo.cs
@@ -587,8 +587,6 @@ public long API_GetRecords(
strID = strText;
* */
-
-
if (bHasID == true)
{
// GetCaptionSafety()函数先找到指定语言的库名;
diff --git a/DigitalPlatform.rms.db/SqlDatabase.cs b/DigitalPlatform.rms.db/SqlDatabase.cs
index bc8a899c2..7d1767c6b 100644
--- a/DigitalPlatform.rms.db/SqlDatabase.cs
+++ b/DigitalPlatform.rms.db/SqlDatabase.cs
@@ -6279,7 +6279,6 @@ public override long GetXml(string strRecordID,
byte[] baWholeXml = null;
byte[] baPreamble = null;
-
string strXml = null;
XmlDocument dom = null;
@@ -6449,7 +6448,7 @@ public override long GetXml(string strRecordID,
} // if (StringUtil.IsInList("withresmetadata", strStyle) == true)
// 通过xpath找片断的情况
- if (strXPath != null && strXPath != "")
+ if (string.IsNullOrEmpty(strXPath) == false)
{
if (dom != null)
{
@@ -6523,7 +6522,7 @@ public override long GetXml(string strRecordID,
destBuffer = new byte[0];
}
- return 0;
+ return destBuffer.Length; // 2016/1/3
} // end if (strXPath != null && strXPath != "")
if (dom != null)
@@ -14944,11 +14943,12 @@ public int ModifyKeys(Connection connection,
keynumParam.Value = oneKey.Num;
#else
+ // 2016/1/6 加入 N
strCommand.Append(" DELETE FROM " + strKeysTableName
- + " WHERE keystring = '" + MySqlHelper.EscapeString(oneKey.Key)
- + "' AND fromstring = '" + MySqlHelper.EscapeString(oneKey.FromValue)
- + "' AND idstring = '" + MySqlHelper.EscapeString(oneKey.RecordID)
- + "' AND keystringnum = '" + MySqlHelper.EscapeString(oneKey.Num) + "' ;\n");
+ + " WHERE keystring = N'" + MySqlHelper.EscapeString(oneKey.Key)
+ + "' AND fromstring = N'" + MySqlHelper.EscapeString(oneKey.FromValue)
+ + "' AND idstring = N'" + MySqlHelper.EscapeString(oneKey.RecordID)
+ + "' AND keystringnum = N'" + MySqlHelper.EscapeString(oneKey.Num) + "' ;\n");
#endif
@@ -14959,7 +14959,7 @@ public int ModifyKeys(Connection connection,
command.CommandText = "use " + this.m_strSqlDbName + " ;\n"
+ strCommand
#if !PARAMETERS
- + " ;\n"
+ // + " ;\n"
#endif
;
try
@@ -15037,21 +15037,23 @@ public int ModifyKeys(Connection connection,
if (strCommand.Length == 0
|| strKeysTableName != strPrevSqlTableName)
{
- if (strCommand.Length > 0)
+ if (strCommand.Length > 0 && i > 0) // 2016/1/6 增加 i>0 限制。否则会多产生一个分号,导致 SQL 语法错误
strCommand.Append(" ; ");
+ // 2016/1/6 加入 N
strCommand.Append(" INSERT INTO " + strKeysTableName
+ " (keystring,fromstring,idstring,keystringnum) "
- + " VALUES ('" + MySqlHelper.EscapeString(oneKey.Key) + "','"
- + MySqlHelper.EscapeString(oneKey.FromValue) + "','"
- + MySqlHelper.EscapeString(oneKey.RecordID) + "','"
+ + " VALUES (N'" + MySqlHelper.EscapeString(oneKey.Key) + "',N'"
+ + MySqlHelper.EscapeString(oneKey.FromValue) + "',N'"
+ + MySqlHelper.EscapeString(oneKey.RecordID) + "',N'"
+ MySqlHelper.EscapeString(oneKey.Num) + "') ");
}
else
{
- strCommand.Append(", ('" + MySqlHelper.EscapeString(oneKey.Key) + "','"
- + MySqlHelper.EscapeString(oneKey.FromValue) + "','"
- + MySqlHelper.EscapeString(oneKey.RecordID) + "','"
+ // 2016/1/6 加入 N
+ strCommand.Append(", (N'" + MySqlHelper.EscapeString(oneKey.Key) + "',N'"
+ + MySqlHelper.EscapeString(oneKey.FromValue) + "',N'"
+ + MySqlHelper.EscapeString(oneKey.RecordID) + "',N'"
+ MySqlHelper.EscapeString(oneKey.Num) + "') ");
}
@@ -15074,6 +15076,7 @@ public int ModifyKeys(Connection connection,
catch (Exception ex)
{
strError = "创建检索点出错,偏移 " + (nExecuted).ToString() + ",记录路径'" + this.GetCaption("zh-CN") + "/" + strRecordID + ",原因:" + ex.Message;
+ this.container.KernelApplication.WriteErrorLog(strError + "\r\n\r\nSQL 语句: " + command.CommandText);
return -1;
}
strCommand.Clear();
@@ -15104,6 +15107,7 @@ public int ModifyKeys(Connection connection,
catch (Exception ex)
{
strError = "创建检索点出错,偏移 " + (nExecuted).ToString() + ",记录路径'" + this.GetCaption("zh-CN") + "/" + strRecordID + ",原因:" + ex.Message;
+ this.container.KernelApplication.WriteErrorLog(strError + "\r\n\r\nSQL 语句: " + command.CommandText);
return -1;
}
diff --git a/DigitalPlatform/ListViewUtil.cs b/DigitalPlatform/ListViewUtil.cs
index 1a01ed174..d0e0a1d3b 100644
--- a/DigitalPlatform/ListViewUtil.cs
+++ b/DigitalPlatform/ListViewUtil.cs
@@ -82,6 +82,33 @@ public static bool MoveItemEnabled(
}
}
+ public static bool MoveSelectedUpDown(
+ ListView list,
+ bool bUp)
+ {
+ if (list.SelectedItems.Count == 0)
+ return false;
+
+ int index = list.SelectedIndices[0];
+
+ if (bUp)
+ {
+ index--;
+ if (index < 0)
+ return false;
+ }
+ else
+ {
+ index++;
+ if (index >= list.Items.Count)
+ return false;
+ }
+
+ list.SelectedItems.Clear();
+ list.Items[index].Selected = true;
+ return true;
+ }
+
// parameters:
// indices ƶ漰±λáһԪƶǰλãڶԪƶλ
public static int MoveItemUpDown(
@@ -210,7 +237,7 @@ public static string GetColumnWidthListStringExt(ListView list)
{
string strResult = "";
int nEndIndex = list.Columns.Count;
- for (int i = list.Columns.Count-1; i >= 0; i--)
+ for (int i = list.Columns.Count - 1; i >= 0; i--)
{
ColumnHeader header = list.Columns[i];
if (String.IsNullOrEmpty(header.Text) == false)
@@ -235,7 +262,7 @@ public static void SetColumnHeaderWidth(ListView list,
string strWidthList,
bool bExpandColumnCount)
{
- string[] parts = strWidthList.Split(new char[] {','});
+ string[] parts = strWidthList.Split(new char[] { ',' });
if (bExpandColumnCount == true)
EnsureColumns(list, parts.Length, 100);
@@ -467,7 +494,7 @@ public static void OnColumnContextMenuClick(ListView list,
ToolStripMenuItem menuItem = null;
ToolStripMenuItem subMenuItem = null;
-// list.Columns[nClickColumn].Text
+ // list.Columns[nClickColumn].Text
menuItem = new ToolStripMenuItem("ʽ");
contextMenu.Items.Add(menuItem);
@@ -503,7 +530,7 @@ static string GetSortStyleCaption(ColumnSortStyle style)
return "[None]";
// call_number ̬תΪ CallNumber ̬
- string[] parts = strName.Split(new char[] {'_'}, StringSplitOptions.RemoveEmptyEntries);
+ string[] parts = strName.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries);
StringBuilder text = new StringBuilder(4096);
foreach (string s in parts)
{
@@ -725,7 +752,6 @@ public static void SelectLine(ListViewItem item,
{
item.Focused = true;
}
-
}
}
@@ -799,7 +825,7 @@ public ColumnSortStyle GetSortStyle(ListView list, int nColumn)
if (this.SortStyles.Count <= nColumn)
{
}
- else
+ else
result = SortStyles[nColumn];
if (result == null || result == ColumnSortStyle.None)
@@ -950,7 +976,7 @@ public class ColumnProperty
///
public string Convert = ""; // ַת 2015/8/27
- public ColumnProperty(string strTitle,
+ public ColumnProperty(string strTitle,
string strType = "",
string strXPath = "",
string strConvert = "")
@@ -972,8 +998,8 @@ public class ColumnPropertyCollection : List
///
///
///
- public void Add(string strTitle,
- string strType = "",
+ public void Add(string strTitle,
+ string strType = "",
string strXPath = "",
string strConvert = "")
{
@@ -1004,7 +1030,7 @@ public int FindColumnByType(string strType)
{
if (col.Type == strType)
return index;
- index ++;
+ index++;
}
return -1;
}
diff --git a/DigitalPlatform/LocationCollection.cs b/DigitalPlatform/LocationCollection.cs
index 4e8055752..fb5c4650b 100644
--- a/DigitalPlatform/LocationCollection.cs
+++ b/DigitalPlatform/LocationCollection.cs
@@ -13,7 +13,6 @@ public class Location
public class LocationCollection : List
{
-
// 解析馆藏地名字字符串
// 例如“海淀分馆/阅览室”拆分为左右两个部分。“阅览室”会被认为是第二部分;"海淀分馆/"会被人为是第一部分
public static void ParseLocationName(string strName,
@@ -143,12 +142,12 @@ public virtual int GetArrivedCopy()
public virtual List GetRefIDs()
{
List results = new List();
- foreach(Location location in this)
+ foreach (Location location in this)
{
if (String.IsNullOrEmpty(location.RefID) == true)
continue;
- string[] parts = location.RefID.Split(new char [] {'|'});
+ string[] parts = location.RefID.Split(new char[] { '|' });
results.AddRange(parts);
}
@@ -241,7 +240,6 @@ public int Build(string value,
strLocationString = strSection.Substring(0, nRet).Trim();
string strCount = strSection.Substring(nRet + 1);
-
nRet = strCount.IndexOf("{");
if (nRet != -1)
{
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 000000000..8dada3eda
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright {yyyy} {name of copyright owner}
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/ZipUtil.exe b/ZipUtil.exe
index 98a332fcb..4d2d24727 100644
Binary files a/ZipUtil.exe and b/ZipUtil.exe differ
diff --git a/dp2Catalog/MainForm/FirstRunDialog.cs b/dp2Catalog/MainForm/FirstRunDialog.cs
index 7dc92c4cb..1ec1bc7b3 100644
--- a/dp2Catalog/MainForm/FirstRunDialog.cs
+++ b/dp2Catalog/MainForm/FirstRunDialog.cs
@@ -205,6 +205,7 @@ internal void Channel_BeforeLogin(object sender,
{
e.UserName = this.textBox_server_userName.Text;
e.Password = this.textBox_server_password.Text;
+ e.Parameters += ",client=dp2catalog|" + Program.ClientVersion;
if (String.IsNullOrEmpty(e.UserName) == false)
return; // 立即返回, 以便作第一次 不出现 对话框的自动登录
@@ -258,7 +259,7 @@ int TouchServer(bool bPrepareSearch,
// 1 登录成功
lRet = this.Channel.Login(this.textBox_server_userName.Text,
this.textBox_server_password.Text,
- "type=worker",
+ "type=worker,client=dp2catalog|" + Program.ClientVersion,
out strError);
if (lRet == -1)
{
diff --git a/dp2Catalog/MainForm/FirstRunDialog.designer.cs b/dp2Catalog/MainForm/FirstRunDialog.designer.cs
index 22b1c549d..f0ec80bc6 100644
--- a/dp2Catalog/MainForm/FirstRunDialog.designer.cs
+++ b/dp2Catalog/MainForm/FirstRunDialog.designer.cs
@@ -127,7 +127,8 @@ private void InitializeComponent()
this.label_welcome.Name = "label_welcome";
this.label_welcome.Size = new System.Drawing.Size(435, 201);
this.label_welcome.TabIndex = 0;
- this.label_welcome.Text = "欢迎使用\r\ndp2 编目 (dp2Catalog)\r\n这是一个图书馆业务前端软件\r\n\r\n(C)2006-2015 版权所有 数字平台(北京)软件有限责任公司";
+ this.label_welcome.Text = "欢迎使用\r\ndp2 编目 (dp2Catalog)\r\n这是一个图书馆业务前端软件\r\n\r\n(C)2006-2015 版权所有 数字平台(北京)软件有限责任公司\r\n2" +
+ "015 年以 Apache License Version 2.0 方式开源";
this.label_welcome.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tabPage_license
diff --git a/dp2Catalog/SaveRecordDlg.Designer.cs b/dp2Catalog/SaveRecordDlg.Designer.cs
index 2f9d754f6..ad8dd8714 100644
--- a/dp2Catalog/SaveRecordDlg.Designer.cs
+++ b/dp2Catalog/SaveRecordDlg.Designer.cs
@@ -28,6 +28,7 @@ protected override void Dispose(bool disposing)
///
private void InitializeComponent()
{
+ this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SaveRecordDlg));
this.button_OK = new System.Windows.Forms.Button();
this.button_Cancel = new System.Windows.Forms.Button();
@@ -56,6 +57,7 @@ private void InitializeComponent()
//
// button_OK
//
+ this.button_OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button_OK.Location = new System.Drawing.Point(284, 238);
this.button_OK.Margin = new System.Windows.Forms.Padding(2);
this.button_OK.Name = "button_OK";
@@ -67,6 +69,7 @@ private void InitializeComponent()
//
// button_Cancel
//
+ this.button_Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button_Cancel.Location = new System.Drawing.Point(344, 238);
this.button_Cancel.Margin = new System.Windows.Forms.Padding(2);
this.button_Cancel.Name = "button_Cancel";
@@ -78,9 +81,9 @@ private void InitializeComponent()
//
// tabControl_main
//
- this.tabControl_main.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ this.tabControl_main.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.tabControl_main.Controls.Add(this.tabPage_DTLP);
this.tabControl_main.Controls.Add(this.tabPage_dp2);
this.tabControl_main.Controls.Add(this.tabPage_unionCatalog);
@@ -132,9 +135,9 @@ private void InitializeComponent()
//
// dtlpResDirControl1
//
- this.dtlpResDirControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ this.dtlpResDirControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.dtlpResDirControl1.BackColor = System.Drawing.SystemColors.Window;
this.dtlpResDirControl1.HideSelection = false;
this.dtlpResDirControl1.ImageIndex = 0;
@@ -150,8 +153,8 @@ private void InitializeComponent()
//
// textBox_dtlpRecPath
//
- this.textBox_dtlpRecPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ this.textBox_dtlpRecPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.textBox_dtlpRecPath.Location = new System.Drawing.Point(86, 174);
this.textBox_dtlpRecPath.Margin = new System.Windows.Forms.Padding(2);
this.textBox_dtlpRecPath.Name = "textBox_dtlpRecPath";
@@ -199,9 +202,9 @@ private void InitializeComponent()
//
// dp2ResTree1
//
- this.dp2ResTree1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ this.dp2ResTree1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.dp2ResTree1.HideSelection = false;
this.dp2ResTree1.ImageIndex = 0;
this.dp2ResTree1.Location = new System.Drawing.Point(5, 24);
@@ -224,8 +227,8 @@ private void InitializeComponent()
//
// textBox_dp2RecPath
//
- this.textBox_dp2RecPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ this.textBox_dp2RecPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.textBox_dp2RecPath.Location = new System.Drawing.Point(86, 174);
this.textBox_dp2RecPath.Margin = new System.Windows.Forms.Padding(2);
this.textBox_dp2RecPath.Name = "textBox_dp2RecPath";
@@ -270,8 +273,8 @@ private void InitializeComponent()
//
// textBox_unionCatalogRecPath
//
- this.textBox_unionCatalogRecPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
+ this.textBox_unionCatalogRecPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.textBox_unionCatalogRecPath.Location = new System.Drawing.Point(86, 174);
this.textBox_unionCatalogRecPath.Margin = new System.Windows.Forms.Padding(2);
this.textBox_unionCatalogRecPath.Name = "textBox_unionCatalogRecPath";
diff --git a/dp2Catalog/dp2Catalog.csproj b/dp2Catalog/dp2Catalog.csproj
index f4c0e1350..e9e08da63 100644
--- a/dp2Catalog/dp2Catalog.csproj
+++ b/dp2Catalog/dp2Catalog.csproj
@@ -50,7 +50,7 @@
dp2 V2
true
publish.htm
- 2
+ 4
2.5.0.%2a
false
true
diff --git a/dp2Circulation/CopyrightDlg.cs b/dp2Circulation/AboutDlg.cs
similarity index 93%
rename from dp2Circulation/CopyrightDlg.cs
rename to dp2Circulation/AboutDlg.cs
index c2b33de27..142c58018 100644
--- a/dp2Circulation/CopyrightDlg.cs
+++ b/dp2Circulation/AboutDlg.cs
@@ -14,12 +14,14 @@ namespace dp2Circulation
///
/// 版权 对话框
///
- internal class CopyrightDlg : System.Windows.Forms.Form
+ internal class AboutDlg : System.Windows.Forms.Form
{
+#if NO
///
/// 框架窗口
///
public MainForm MainForm = null;
+#endif
private System.Windows.Forms.Label label1;
private System.Windows.Forms.LinkLabel linkLabel1;
@@ -31,7 +33,7 @@ internal class CopyrightDlg : System.Windows.Forms.Form
///
private System.ComponentModel.Container components = null;
- public CopyrightDlg()
+ public AboutDlg()
{
//
// Required for Windows Form Designer support
@@ -67,7 +69,7 @@ protected override void Dispose(bool disposing)
///
private void InitializeComponent()
{
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CopyrightDlg));
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutDlg));
this.label1 = new System.Windows.Forms.Label();
this.label_copyright = new System.Windows.Forms.Label();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
@@ -84,7 +86,7 @@ private void InitializeComponent()
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(461, 17);
this.label1.TabIndex = 0;
- this.label1.Text = "dp2内务/流通 dp2Circulation V2.10";
+ this.label1.Text = "dp2 内务/流通 dp2Circulation V2.11";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label_copyright
@@ -109,7 +111,7 @@ private void InitializeComponent()
this.linkLabel1.Size = new System.Drawing.Size(459, 36);
this.linkLabel1.TabIndex = 2;
this.linkLabel1.TabStop = true;
- this.linkLabel1.Text = "http://www.dp2003.com";
+ this.linkLabel1.Text = "https://github.com/DigitalPlatform/dp2";
this.linkLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
@@ -156,9 +158,9 @@ private void InitializeComponent()
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
- this.Name = "CopyrightDlg";
+ this.Name = "About";
this.ShowInTaskbar = false;
- this.Text = "版权 Copyright";
+ this.Text = "关于 About";
this.Load += new System.EventHandler(this.CopyrightDlg_Load);
this.ResumeLayout(false);
this.PerformLayout();
@@ -194,14 +196,14 @@ private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabe
private void CopyrightDlg_Load(object sender, System.EventArgs e)
{
- label_copyright.Text = "(C) 版权所有 2006-2015 数字平台(北京)软件有限责任公司\r\nDigital Platform (Beijing) Software Corp. Ltd.";
+ label_copyright.Text = "(C) 版权所有 2006-2015 数字平台(北京)软件有限责任公司\r\n2015 年以 Apache License Version 2.0 方式开源";
Assembly myAssembly = Assembly.GetAssembly(this.GetType());
AssemblyName name = myAssembly.GetName();
textBox_environment.Text = "版本和环境:"
+ "\r\n本软件: "+name.Name+" " + name.Version.ToString() // .FullName
- + "\r\n当前连接的 dp2Library (位于 " + this.MainForm.LibraryServerUrl + "): " + this.MainForm.ServerVersion.ToString() + " UID:" + this.MainForm.ServerUID
+ + "\r\n当前连接的 dp2Library (位于 " + Program.MainForm.LibraryServerUrl + "): " + Program.MainForm.ServerVersion.ToString() + " UID:" + Program.MainForm.ServerUID
+ "\r\n本机 .NET Framework 版本: " + myAssembly.ImageRuntimeVersion
+ "\r\n\r\n本机 MAC 地址: " + StringUtil.MakePathList(SerialCodeForm.GetMacAddress())
+ "\r\n是否安装 KB2468871: " + Global.IsKbInstalled("KB2468871")
diff --git a/dp2Circulation/CopyrightDlg.resx b/dp2Circulation/AboutDlg.resx
similarity index 100%
rename from dp2Circulation/CopyrightDlg.resx
rename to dp2Circulation/AboutDlg.resx
diff --git a/dp2Circulation/BatchTaskForm.cs b/dp2Circulation/BatchTaskForm.cs
index 6c2a2ce76..f077a8228 100644
--- a/dp2Circulation/BatchTaskForm.cs
+++ b/dp2Circulation/BatchTaskForm.cs
@@ -350,6 +350,8 @@ int StartBatchTask(string strTaskName,
{
StartLogRecoverDlg dlg = new StartLogRecoverDlg();
MainForm.SetControlFont(dlg, this.Font, false);
+ dlg.Text = "启动 创建 MongoDB 日志库 任务";
+ dlg.TaskName = "创建 MongoDB 日志库";
dlg.StartInfo = startinfo;
dlg.ShowDialog(this);
if (dlg.DialogResult != DialogResult.OK)
@@ -719,7 +721,6 @@ void DoRefresh()
// this.EnableControls(false);
try
{
-
string strError = "";
stop.OnStop += new StopEventHandler(this.DoStop);
@@ -891,7 +892,6 @@ private void ToolStripMenuItem_progress_Click(object sender, EventArgs e)
this.MessageStyle -= MessageStyle.Progress;
else
this.MessageStyle |= MessageStyle.Progress;
-
}
// 刷新
diff --git a/dp2Circulation/ChangePasswordForm.cs b/dp2Circulation/ChangePasswordForm.cs
index 9b91590c8..f2b313211 100644
--- a/dp2Circulation/ChangePasswordForm.cs
+++ b/dp2Circulation/ChangePasswordForm.cs
@@ -236,7 +236,7 @@ private void button_worker_changePassword_Click(object sender, EventArgs e)
// 1 登录成功
lRet = Channel.Login(this.textBox_worker_userName.Text,
this.textBox_worker_oldPassword.Text,
- "type=worker",
+ "type=worker,client=dp2circulation|" + Program.ClientVersion,
out strError);
if (lRet == -1)
{
diff --git a/dp2Circulation/Charging/ChargingForm.Designer.cs b/dp2Circulation/Charging/ChargingForm.Designer.cs
index d99ed9585..0a7b8cb24 100644
--- a/dp2Circulation/Charging/ChargingForm.Designer.cs
+++ b/dp2Circulation/Charging/ChargingForm.Designer.cs
@@ -34,6 +34,7 @@ private void InitializeComponent()
this.toolStripMenuItem_borrow = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem_return = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem_verifyReturn = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem_renew = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem_verifyRenew = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem_lost = new System.Windows.Forms.ToolStripMenuItem();
this.splitContainer_main = new System.Windows.Forms.SplitContainer();
@@ -74,7 +75,6 @@ private void InitializeComponent()
this.contextMenuStrip_verifyReaderPassword = new System.Windows.Forms.ContextMenuStrip(this.components);
this.MenuItem_verifyReaderPassword = new System.Windows.Forms.ToolStripMenuItem();
this.panel_main = new System.Windows.Forms.Panel();
- this.toolStripMenuItem_renew = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip_selectFunc.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer_main)).BeginInit();
this.splitContainer_main.Panel1.SuspendLayout();
@@ -104,40 +104,47 @@ private void InitializeComponent()
this.toolStripMenuItem_verifyRenew,
this.toolStripMenuItem_lost});
this.contextMenuStrip_selectFunc.Name = "contextMenuStrip_selectFunc";
- this.contextMenuStrip_selectFunc.Size = new System.Drawing.Size(153, 158);
+ this.contextMenuStrip_selectFunc.Size = new System.Drawing.Size(125, 136);
//
// toolStripMenuItem_borrow
//
this.toolStripMenuItem_borrow.Name = "toolStripMenuItem_borrow";
- this.toolStripMenuItem_borrow.Size = new System.Drawing.Size(152, 22);
+ this.toolStripMenuItem_borrow.Size = new System.Drawing.Size(124, 22);
this.toolStripMenuItem_borrow.Text = "";
this.toolStripMenuItem_borrow.Click += new System.EventHandler(this.toolStripMenuItem_borrow_Click);
//
// toolStripMenuItem_return
//
this.toolStripMenuItem_return.Name = "toolStripMenuItem_return";
- this.toolStripMenuItem_return.Size = new System.Drawing.Size(152, 22);
+ this.toolStripMenuItem_return.Size = new System.Drawing.Size(124, 22);
this.toolStripMenuItem_return.Text = "";
this.toolStripMenuItem_return.Click += new System.EventHandler(this.toolStripMenuItem_return_Click);
//
// toolStripMenuItem_verifyReturn
//
this.toolStripMenuItem_verifyReturn.Name = "toolStripMenuItem_verifyReturn";
- this.toolStripMenuItem_verifyReturn.Size = new System.Drawing.Size(152, 22);
+ this.toolStripMenuItem_verifyReturn.Size = new System.Drawing.Size(124, 22);
this.toolStripMenuItem_verifyReturn.Text = "֤";
this.toolStripMenuItem_verifyReturn.Click += new System.EventHandler(this.toolStripMenuItem_verifyReturn_Click);
//
+ // toolStripMenuItem_renew
+ //
+ this.toolStripMenuItem_renew.Name = "toolStripMenuItem_renew";
+ this.toolStripMenuItem_renew.Size = new System.Drawing.Size(124, 22);
+ this.toolStripMenuItem_renew.Text = "";
+ this.toolStripMenuItem_renew.Click += new System.EventHandler(this.toolStripMenuItem_renew_Click);
+ //
// toolStripMenuItem_verifyRenew
//
this.toolStripMenuItem_verifyRenew.Name = "toolStripMenuItem_verifyRenew";
- this.toolStripMenuItem_verifyRenew.Size = new System.Drawing.Size(152, 22);
+ this.toolStripMenuItem_verifyRenew.Size = new System.Drawing.Size(124, 22);
this.toolStripMenuItem_verifyRenew.Text = "֤";
this.toolStripMenuItem_verifyRenew.Click += new System.EventHandler(this.toolStripMenuItem_verifyRenew_Click);
//
// toolStripMenuItem_lost
//
this.toolStripMenuItem_lost.Name = "toolStripMenuItem_lost";
- this.toolStripMenuItem_lost.Size = new System.Drawing.Size(152, 22);
+ this.toolStripMenuItem_lost.Size = new System.Drawing.Size(124, 22);
this.toolStripMenuItem_lost.Text = "ʧ";
this.toolStripMenuItem_lost.Click += new System.EventHandler(this.toolStripMenuItem_lost_Click);
//
@@ -236,18 +243,18 @@ private void InitializeComponent()
this.toolStripDropDownButton_itemBarcodeNavigate.Size = new System.Drawing.Size(29, 22);
this.toolStripDropDownButton_itemBarcodeNavigate.ToolTipText = "ſٵ";
//
- // ToolStripMenuItem_openEntityForm
+ // toolStripMenuItem_openEntityForm
//
this.toolStripMenuItem_openEntityForm.Enabled = false;
- this.toolStripMenuItem_openEntityForm.Name = "ToolStripMenuItem_openEntityForm";
+ this.toolStripMenuItem_openEntityForm.Name = "toolStripMenuItem_openEntityForm";
this.toolStripMenuItem_openEntityForm.Size = new System.Drawing.Size(112, 22);
this.toolStripMenuItem_openEntityForm.Text = "ֲᴰ";
this.toolStripMenuItem_openEntityForm.Click += new System.EventHandler(this.toolStripMenuItem_openEntityForm_Click);
//
- // ToolStripMenuItem_openItemInfoForm
+ // toolStripMenuItem_openItemInfoForm
//
this.toolStripMenuItem_openItemInfoForm.Enabled = false;
- this.toolStripMenuItem_openItemInfoForm.Name = "ToolStripMenuItem_openItemInfoForm";
+ this.toolStripMenuItem_openItemInfoForm.Name = "toolStripMenuItem_openItemInfoForm";
this.toolStripMenuItem_openItemInfoForm.Size = new System.Drawing.Size(112, 22);
this.toolStripMenuItem_openItemInfoForm.Text = "ʵ崰";
this.toolStripMenuItem_openItemInfoForm.Click += new System.EventHandler(this.toolStripMenuItem_openItemInfoForm_Click);
@@ -267,42 +274,42 @@ private void InitializeComponent()
this.toolStripDropDownButton_readerBarcodeNavigate.Size = new System.Drawing.Size(29, 22);
this.toolStripDropDownButton_readerBarcodeNavigate.ToolTipText = "֤ſٵ";
//
- // ToolStripMenuItem_naviToAmerceForm
+ // toolStripMenuItem_naviToAmerceForm
//
this.toolStripMenuItem_naviToAmerceForm.Enabled = false;
- this.toolStripMenuItem_naviToAmerceForm.Name = "ToolStripMenuItem_naviToAmerceForm";
+ this.toolStripMenuItem_naviToAmerceForm.Name = "toolStripMenuItem_naviToAmerceForm";
this.toolStripMenuItem_naviToAmerceForm.Size = new System.Drawing.Size(144, 22);
this.toolStripMenuItem_naviToAmerceForm.Text = "Ѵ";
this.toolStripMenuItem_naviToAmerceForm.Click += new System.EventHandler(this.toolStripMenuItem_naviToAmerceForm_Click);
//
- // ToolStripMenuItem_naviToReaderInfoForm
+ // toolStripMenuItem_naviToReaderInfoForm
//
this.toolStripMenuItem_naviToReaderInfoForm.Enabled = false;
- this.toolStripMenuItem_naviToReaderInfoForm.Name = "ToolStripMenuItem_naviToReaderInfoForm";
+ this.toolStripMenuItem_naviToReaderInfoForm.Name = "toolStripMenuItem_naviToReaderInfoForm";
this.toolStripMenuItem_naviToReaderInfoForm.Size = new System.Drawing.Size(144, 22);
this.toolStripMenuItem_naviToReaderInfoForm.Text = "ߴ";
this.toolStripMenuItem_naviToReaderInfoForm.Click += new System.EventHandler(this.toolStripMenuItem_naviToReaderInfoForm_Click);
//
- // ToolStripMenuItem_naviToActivateForm_old
+ // toolStripMenuItem_naviToActivateForm_old
//
this.toolStripMenuItem_naviToActivateForm_old.Enabled = false;
- this.toolStripMenuItem_naviToActivateForm_old.Name = "ToolStripMenuItem_naviToActivateForm_old";
+ this.toolStripMenuItem_naviToActivateForm_old.Name = "toolStripMenuItem_naviToActivateForm_old";
this.toolStripMenuItem_naviToActivateForm_old.Size = new System.Drawing.Size(144, 22);
this.toolStripMenuItem_naviToActivateForm_old.Text = "(Դ)";
this.toolStripMenuItem_naviToActivateForm_old.Click += new System.EventHandler(this.toolStripMenuItem_naviToActivateForm_old_Click);
//
- // ToolStripMenuItem_openReaderManageForm
+ // toolStripMenuItem_openReaderManageForm
//
this.toolStripMenuItem_openReaderManageForm.Enabled = false;
- this.toolStripMenuItem_openReaderManageForm.Name = "ToolStripMenuItem_openReaderManageForm";
+ this.toolStripMenuItem_openReaderManageForm.Name = "toolStripMenuItem_openReaderManageForm";
this.toolStripMenuItem_openReaderManageForm.Size = new System.Drawing.Size(144, 22);
this.toolStripMenuItem_openReaderManageForm.Text = "ͣ贰";
this.toolStripMenuItem_openReaderManageForm.Click += new System.EventHandler(this.toolStripMenuItem_openReaderManageForm_Click);
//
- // ToolStripMenuItem_naviToActivateForm_new
+ // toolStripMenuItem_naviToActivateForm_new
//
this.toolStripMenuItem_naviToActivateForm_new.Enabled = false;
- this.toolStripMenuItem_naviToActivateForm_new.Name = "ToolStripMenuItem_naviToActivateForm_new";
+ this.toolStripMenuItem_naviToActivateForm_new.Name = "toolStripMenuItem_naviToActivateForm_new";
this.toolStripMenuItem_naviToActivateForm_new.Size = new System.Drawing.Size(144, 22);
this.toolStripMenuItem_naviToActivateForm_new.Text = "(Ŀ)";
this.toolStripMenuItem_naviToActivateForm_new.Click += new System.EventHandler(this.toolStripMenuItem_naviToActivateForm_new_Click);
@@ -652,13 +659,6 @@ private void InitializeComponent()
this.panel_main.Size = new System.Drawing.Size(442, 392);
this.panel_main.TabIndex = 7;
//
- // ToolStripMenuItem_renew
- //
- this.toolStripMenuItem_renew.Name = "ToolStripMenuItem_renew";
- this.toolStripMenuItem_renew.Size = new System.Drawing.Size(152, 22);
- this.toolStripMenuItem_renew.Text = "";
- this.toolStripMenuItem_renew.Click += new System.EventHandler(this.toolStripMenuItem_renew_Click);
- //
// ChargingForm
//
this.AllowDrop = true;
diff --git a/dp2Circulation/Charging/ChargingForm.cs b/dp2Circulation/Charging/ChargingForm.cs
index 1816aedf3..41a0d0dd0 100644
--- a/dp2Circulation/Charging/ChargingForm.cs
+++ b/dp2Circulation/Charging/ChargingForm.cs
@@ -168,7 +168,7 @@ public string PatronRenderFormat
if (this.DisplayState == DisplayState.TEXT)
return "text";
- if (this.NoBorrowHistory == true
+ if (this.NoBorrowHistory == true
&& StringUtil.CompareVersion(this.MainForm.ServerVersion, "2.21") >= 0)
return "html:noborrowhistory";
@@ -929,7 +929,7 @@ public void Reload()
}
if (strBarcode != this.textBox_readerBarcode.Text)
- this.textBox_readerBarcode.Text = strBarcode;
+ this.textBox_readerBarcode.Text = strBarcode;
}
@@ -1090,7 +1090,7 @@ int LoadReaderRecord(ref string strBarcode,
stop.SetMessage("正在装入读者记录 " + strBarcode + " ...");
string[] results = null;
- byte [] baTimestamp = null;
+ byte[] baTimestamp = null;
string strRecPath = "";
long lRet = Channel.GetReaderInfo(
stop,
@@ -1948,7 +1948,7 @@ public int DoItemAction()
string strFastInputText = "";
string strTemp = this.textBox_itemBarcode.Text;
- if ( ( this.UseIsbnBorrow == true && QuickChargingForm.IsISBN(ref strTemp) == true)
+ if ((this.UseIsbnBorrow == true && QuickChargingForm.IsISBN(ref strTemp) == true)
|| strTemp.ToLower() == "?b"
|| string.IsNullOrEmpty(strTemp) == true)
{
@@ -2095,7 +2095,6 @@ public int DoItemAction()
strOperName = "续借";
}
-
stop.OnStop += new StopEventHandler(this.DoStop);
stop.Initial("正在进行" + strOperName + "操作: " + this.textBox_readerBarcode.Text
+ " " + strOperName + " " + this.textBox_itemBarcode.Text + " ...");
@@ -2161,7 +2160,7 @@ public int DoItemAction()
lRet = Channel.Borrow(
stop,
bRenew,
- this.FuncState == dp2Circulation.FuncState.Renew? "" : this.textBox_readerBarcode.Text,
+ this.FuncState == dp2Circulation.FuncState.Renew ? "" : this.textBox_readerBarcode.Text,
this.textBox_itemBarcode.Text,
strConfirmItemRecPath,
this.Force,
@@ -3423,9 +3422,15 @@ public enum FuncState
/// 盘点图书
///
InventoryBook = 10, // 盘点图书 2015/8/16
+
+ ///
+ /// 读过
+ ///
+ Read = 11, // 读过 2016/1/8
}
- /*public*/ class BarcodeAndTime
+ /*public*/
+ class BarcodeAndTime
{
public string Barcode = "";
public DateTime Time = DateTime.Now;
diff --git a/dp2Circulation/Charging/ChargingForm.resx b/dp2Circulation/Charging/ChargingForm.resx
index 27d69c6c9..4fe206650 100644
--- a/dp2Circulation/Charging/ChargingForm.resx
+++ b/dp2Circulation/Charging/ChargingForm.resx
@@ -123,10 +123,34 @@
566, 17
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFJSURBVDhPYwCB8PYH/8Pa7v0HsYObb/0ParwBZsOAd8XZ
+ /56lp+BiTrkH/jtk70WoAWkObbkLFgBpDqy/hmIASLN78XG4GEizXcZOhBqQ5pDm22ABkGb/2ssoBoA0
+ uxYcgYuBNNukbkWoQXY2SLNv1QUUA1wLDv8HORvKZQBptkrehFAD0hwAdTZIM8jPYAkocM5D9bNl0qb/
+ 5gnrEGpAmmHORg8wEED3s3nC+v+msasRapCdjR5gIIDuZ5Bm4+gVCDXIzkYPMBBA9zNIs2HEUoQaZGeD
+ AgzkZ7AEFIA0I/sZpFk/bBFCDbKz0QMMBND9rB+66L9u8HyEGoizD4MFMBIJEKD7GaRZJ3AOQg1yPGMk
+ EiBA97M2ULOW/ywUNZQBh+w9cNNgoQ3zM8xmkLNBNoPYIKDuMxXOBjsbRKNHFZQJBjg1UwYYGACfxwQX
+ +x/RKgAAAABJRU5ErkJggg==
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAARCAYAAADUryzEAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFlSURBVDhPY8AFNjcp/0fGUGHiAEjDkwMt/5+dmvn/6dHe
+ /7s6tP8vLhYhzpC1HXb/9/cZ/7++POj/w52l/48uivsPEiPJgAuTdcGGPFtk8///Zt//L1c4gb0RHRlE
+ 2BCQAf93h6JioCHHulVJMGC1K1gTGIPYQLyzUZp4A34utoVrBLF/zjb9Xx1NpAEg8KpPE6wJhP9MN/q/
+ v0qEOM0ePd7/QbgmjeH/sRoxMN5czPs/sESRsAFOS5z+g3D3/e7/Vdt6/u+/uf//ho3z/1tVWYHFtbK0
+ 8BtgMtPkf8rplP/Nt5v/B83O+P/3////PXv6/8fujgWLu2xw+e9d4Y3bEOke6f8xJ2L+Z5/L/g8y7MDT
+ y2CbQXyQASabTf7Llcvh9kpaWtp/zWma/0MOhYAN0KnXAWsEYevt1mADZBtk8YcFyBDjJGOwTbKpsv9B
+ rgJhkEaQmEG4AXGxATIIF4YqGTSAgQEAJj8jgyEu8bgAAAAASUVORK5CYII=
+
+
True
-
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
@@ -169,33 +193,6 @@
SCROJCJ9KhVphjTcNqQg2ZiM2PlYCFdE4K/x4bPuC49Vd7iaXOHU7ewAcDu4JyEDPEQMiSEZkUDCfJQY
XSyi9dEQGoQIMfPhb/HDVcs1uM25wVnvDKc2juMr2w63wVVfooDmIOK3hVBIeyjx2/kU/DyY/Dv9yUvj
RR4aD+J2c8mly4U4rU5k2LWwraeAU8jFApy/n1yziq0LErEAAAAASUVORK5CYII=
-
-
-
- 566, 17
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFJSURBVDhPYwCB8PYH/8Pa7v0HsYObb/0ParwBZsOAd8XZ
- /56lp+BiTrkH/jtk70WoAWkObbkLFgBpDqy/hmIASLN78XG4GEizXcZOhBqQ5pDm22ABkGb/2ssoBoA0
- uxYcgYuBNNukbkWoQXY2SLNv1QUUA1wLDv8HORvKZQBptkrehFAD0hwAdTZIM8jPYAkocM5D9bNl0qb/
- 5gnrEGpAmmHORg8wEED3s3nC+v+msasRapCdjR5gIIDuZ5Bm4+gVCDXIzkYPMBBA9zNIs2HEUoQaZGeD
- AgzkZ7AEFIA0I/sZpFk/bBFCDbKz0QMMBND9rB+66L9u8HyEGoizD4MFMBIJEKD7GaRZJ3AOQg1yPGMk
- EiBA97M2ULOW/ywUNZQBh+w9cNNgoQ3zM8xmkLNBNoPYIKDuMxXOBjsbRKNHFZQJBjg1UwYYGACfxwQX
- +x/RKgAAAABJRU5ErkJggg==
-
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAABAAAAARCAYAAADUryzEAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFlSURBVDhPY8AFNjcp/0fGUGHiAEjDkwMt/5+dmvn/6dHe
- /7s6tP8vLhYhzpC1HXb/9/cZ/7++POj/w52l/48uivsPEiPJgAuTdcGGPFtk8///Zt//L1c4gb0RHRlE
- 2BCQAf93h6JioCHHulVJMGC1K1gTGIPYQLyzUZp4A34utoVrBLF/zjb9Xx1NpAEg8KpPE6wJhP9MN/q/
- v0qEOM0ePd7/QbgmjeH/sRoxMN5czPs/sESRsAFOS5z+g3D3/e7/Vdt6/u+/uf//ho3z/1tVWYHFtbK0
- 8BtgMtPkf8rplP/Nt5v/B83O+P/3////PXv6/8fujgWLu2xw+e9d4Y3bEOke6f8xJ2L+Z5/L/g8y7MDT
- y2CbQXyQASabTf7Llcvh9kpaWtp/zWma/0MOhYAN0KnXAWsEYevt1mADZBtk8YcFyBDjJGOwTbKpsv9B
- rgJhkEaQmEG4AXGxATIIF4YqGTSAgQEAJj8jgyEu8bgAAAAASUVORK5CYII=
diff --git a/dp2Circulation/Charging/ChargingTask.cs b/dp2Circulation/Charging/ChargingTask.cs
index 54d651255..c5f063b73 100644
--- a/dp2Circulation/Charging/ChargingTask.cs
+++ b/dp2Circulation/Charging/ChargingTask.cs
@@ -137,6 +137,10 @@ public void RefreshDisplay(DpRow row)
{
strText = GetOperText("盘点");
}
+ else if (this.Action == "read")
+ {
+ strText = GetOperText("读过");
+ }
if (string.IsNullOrEmpty(this.ErrorInfo) == false)
strText += "\r\n===\r\n" + this.ErrorInfo;
@@ -198,7 +202,6 @@ string GetOperText(string strOperName)
return this.ReaderBarcode + " " + this.ReaderName + " " + strOperName + " " + this.ItemBarcode + strSummary;
else
return strOperName + " " + this.ItemBarcode + strSummary;
-
}
// 任务是否完成
@@ -337,7 +340,8 @@ public override void Worker()
|| task.Action == "verify_return"
|| task.Action == "lost"
|| task.Action == "verify_lost"
- || task.Action == "inventory")
+ || task.Action == "inventory"
+ || task.Action == "read")
{
Return(task);
}
@@ -922,6 +926,16 @@ void Return(ChargingTask task)
if (task.Action == "inventory")
strOperText = task.ReaderBarcode + " 盘点 " + task.ItemBarcode;
+ else if (task.Action == "read")
+ {
+ if (StringUtil.CompareVersion(Program.MainForm.ServerVersion, "2.68") < 0)
+ {
+ task.ErrorInfo = "操作未能进行。“读过”功能要求 dp2library 版本在 2.68 或以上";
+ goto ERROR1;
+ }
+
+ strOperText = task.ReaderBarcode + " 读过 " + task.ItemBarcode;
+ }
else
strOperText = task.ReaderBarcode + " 还 " + task.ItemBarcode;
@@ -971,6 +985,16 @@ void Return(ChargingTask task)
}
strAction = "inventory";
}
+ else if (task.Action == "read")
+ {
+ if (string.IsNullOrEmpty(strReaderBarcode) == true)
+ {
+ strError = "尚未输入读者证条码号";
+ task.ErrorInfo = strError;
+ goto ERROR1;
+ }
+ strAction = "read";
+ }
else
{
strReaderBarcode = "";
@@ -1192,7 +1216,6 @@ void Return(ChargingTask task)
times.Add(DateTime.Now);
LogOperTime("return", times, strOperText);
-
return;
ERROR1:
diff --git a/dp2Circulation/Charging/QuickChargingForm.Designer.cs b/dp2Circulation/Charging/QuickChargingForm.Designer.cs
index 5f83c6023..38bcd711c 100644
--- a/dp2Circulation/Charging/QuickChargingForm.Designer.cs
+++ b/dp2Circulation/Charging/QuickChargingForm.Designer.cs
@@ -45,7 +45,7 @@ private void InitializeComponent()
this.toolStripMenuItem_verifyLost = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItem_loadPatronInfo = new System.Windows.Forms.ToolStripMenuItem();
- this.ToolStripMenuItem_inventoryBook = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem_inventoryBook = new System.Windows.Forms.ToolStripMenuItem();
this.dpColumn_color = new DigitalPlatform.CommonControl.DpColumn();
this.dpColumn_state = new DigitalPlatform.CommonControl.DpColumn();
this.dpColumn_content = new DigitalPlatform.CommonControl.DpColumn();
@@ -69,6 +69,7 @@ private void InitializeComponent()
this.toolStripButton_selectItem = new System.Windows.Forms.ToolStripButton();
this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
this.ToolStripMenuItem_inventoryFromFile = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem_read = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip_selectFunc.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer_main)).BeginInit();
this.splitContainer_main.Panel1.SuspendLayout();
@@ -103,100 +104,101 @@ private void InitializeComponent()
this.toolStripMenuItem_verifyLost,
this.toolStripSeparator4,
this.toolStripMenuItem_loadPatronInfo,
- this.ToolStripMenuItem_inventoryBook});
+ this.toolStripMenuItem_inventoryBook,
+ this.toolStripMenuItem_read});
this.contextMenuStrip_selectFunc.Name = "contextMenuStrip_selectFunc";
- this.contextMenuStrip_selectFunc.Size = new System.Drawing.Size(149, 248);
+ this.contextMenuStrip_selectFunc.Size = new System.Drawing.Size(153, 292);
this.contextMenuStrip_selectFunc.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip_selectFunc_Opening);
//
// toolStripMenuItem_borrow
//
this.toolStripMenuItem_borrow.Name = "toolStripMenuItem_borrow";
- this.toolStripMenuItem_borrow.Size = new System.Drawing.Size(148, 22);
+ this.toolStripMenuItem_borrow.Size = new System.Drawing.Size(152, 22);
this.toolStripMenuItem_borrow.Text = "借";
this.toolStripMenuItem_borrow.Click += new System.EventHandler(this.toolStripMenuItem_borrow_Click);
//
// toolStripMenuItem_continueBorrow
//
this.toolStripMenuItem_continueBorrow.Name = "toolStripMenuItem_continueBorrow";
- this.toolStripMenuItem_continueBorrow.Size = new System.Drawing.Size(148, 22);
+ this.toolStripMenuItem_continueBorrow.Size = new System.Drawing.Size(152, 22);
this.toolStripMenuItem_continueBorrow.Text = "同一读者借";
this.toolStripMenuItem_continueBorrow.Click += new System.EventHandler(this.toolStripMenuItem_continueBorrow_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
- this.toolStripSeparator1.Size = new System.Drawing.Size(145, 6);
+ this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
//
// toolStripMenuItem_return
//
this.toolStripMenuItem_return.Name = "toolStripMenuItem_return";
- this.toolStripMenuItem_return.Size = new System.Drawing.Size(148, 22);
+ this.toolStripMenuItem_return.Size = new System.Drawing.Size(152, 22);
this.toolStripMenuItem_return.Text = "还";
this.toolStripMenuItem_return.Click += new System.EventHandler(this.toolStripMenuItem_return_Click);
//
// toolStripMenuItem_verifyReturn
//
this.toolStripMenuItem_verifyReturn.Name = "toolStripMenuItem_verifyReturn";
- this.toolStripMenuItem_verifyReturn.Size = new System.Drawing.Size(148, 22);
+ this.toolStripMenuItem_verifyReturn.Size = new System.Drawing.Size(152, 22);
this.toolStripMenuItem_verifyReturn.Text = "验证还";
this.toolStripMenuItem_verifyReturn.Click += new System.EventHandler(this.toolStripMenuItem_verifyReturn_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
- this.toolStripSeparator2.Size = new System.Drawing.Size(145, 6);
+ this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6);
//
// toolStripMenuItem_renew
//
this.toolStripMenuItem_renew.Name = "toolStripMenuItem_renew";
- this.toolStripMenuItem_renew.Size = new System.Drawing.Size(148, 22);
+ this.toolStripMenuItem_renew.Size = new System.Drawing.Size(152, 22);
this.toolStripMenuItem_renew.Text = "续借";
this.toolStripMenuItem_renew.Click += new System.EventHandler(this.toolStripMenuItem_renew_Click);
//
// toolStripMenuItem_verifyRenew
//
this.toolStripMenuItem_verifyRenew.Name = "toolStripMenuItem_verifyRenew";
- this.toolStripMenuItem_verifyRenew.Size = new System.Drawing.Size(148, 22);
+ this.toolStripMenuItem_verifyRenew.Size = new System.Drawing.Size(152, 22);
this.toolStripMenuItem_verifyRenew.Text = "验证续借";
this.toolStripMenuItem_verifyRenew.Click += new System.EventHandler(this.toolStripMenuItem_verifyRenew_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
- this.toolStripSeparator3.Size = new System.Drawing.Size(145, 6);
+ this.toolStripSeparator3.Size = new System.Drawing.Size(149, 6);
//
// toolStripMenuItem_lost
//
this.toolStripMenuItem_lost.Name = "toolStripMenuItem_lost";
- this.toolStripMenuItem_lost.Size = new System.Drawing.Size(148, 22);
+ this.toolStripMenuItem_lost.Size = new System.Drawing.Size(152, 22);
this.toolStripMenuItem_lost.Text = "丢失";
this.toolStripMenuItem_lost.Click += new System.EventHandler(this.toolStripMenuItem_lost_Click);
//
// toolStripMenuItem_verifyLost
//
this.toolStripMenuItem_verifyLost.Name = "toolStripMenuItem_verifyLost";
- this.toolStripMenuItem_verifyLost.Size = new System.Drawing.Size(148, 22);
+ this.toolStripMenuItem_verifyLost.Size = new System.Drawing.Size(152, 22);
this.toolStripMenuItem_verifyLost.Text = "验证丢失";
this.toolStripMenuItem_verifyLost.Click += new System.EventHandler(this.toolStripMenuItem_verifyLost_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
- this.toolStripSeparator4.Size = new System.Drawing.Size(145, 6);
+ this.toolStripSeparator4.Size = new System.Drawing.Size(149, 6);
//
// toolStripMenuItem_loadPatronInfo
//
this.toolStripMenuItem_loadPatronInfo.Name = "toolStripMenuItem_loadPatronInfo";
- this.toolStripMenuItem_loadPatronInfo.Size = new System.Drawing.Size(148, 22);
+ this.toolStripMenuItem_loadPatronInfo.Size = new System.Drawing.Size(152, 22);
this.toolStripMenuItem_loadPatronInfo.Text = "装载读者信息";
this.toolStripMenuItem_loadPatronInfo.Click += new System.EventHandler(this.toolStripMenuItem_loadPatronInfo_Click);
//
// ToolStripMenuItem_inventoryBook
//
- this.ToolStripMenuItem_inventoryBook.Name = "ToolStripMenuItem_inventoryBook";
- this.ToolStripMenuItem_inventoryBook.Size = new System.Drawing.Size(148, 22);
- this.ToolStripMenuItem_inventoryBook.Text = "盘点图书";
- this.ToolStripMenuItem_inventoryBook.Click += new System.EventHandler(this.ToolStripMenuItem_inventoryBook_Click);
+ this.toolStripMenuItem_inventoryBook.Name = "ToolStripMenuItem_inventoryBook";
+ this.toolStripMenuItem_inventoryBook.Size = new System.Drawing.Size(152, 22);
+ this.toolStripMenuItem_inventoryBook.Text = "盘点图书";
+ this.toolStripMenuItem_inventoryBook.Click += new System.EventHandler(this.ToolStripMenuItem_inventoryBook_Click);
//
// dpColumn_color
//
@@ -488,6 +490,13 @@ private void InitializeComponent()
this.ToolStripMenuItem_inventoryFromFile.Text = "从文件导入盘点 ...";
this.ToolStripMenuItem_inventoryFromFile.Click += new System.EventHandler(this.ToolStripMenuItem_inventoryFromFile_Click);
//
+ // ToolStripMenuItem_read
+ //
+ this.toolStripMenuItem_read.Name = "ToolStripMenuItem_read";
+ this.toolStripMenuItem_read.Size = new System.Drawing.Size(152, 22);
+ this.toolStripMenuItem_read.Text = "读过";
+ this.toolStripMenuItem_read.Click += new System.EventHandler(this.ToolStripMenuItem_read_Click);
+ //
// QuickChargingForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -558,8 +567,9 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripButton toolStripButton_selectItem;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_renew;
private System.Windows.Forms.ToolStripButton toolStripButton_upperInput;
- private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_inventoryBook;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_inventoryBook;
private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_inventoryFromFile;
+ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_read;
}
}
\ No newline at end of file
diff --git a/dp2Circulation/Charging/QuickChargingForm.cs b/dp2Circulation/Charging/QuickChargingForm.cs
index b3156e3e7..6cac0ee04 100644
--- a/dp2Circulation/Charging/QuickChargingForm.cs
+++ b/dp2Circulation/Charging/QuickChargingForm.cs
@@ -3,6 +3,7 @@
using System.ComponentModel;
using System.Data;
using System.Drawing;
+using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
@@ -10,16 +11,15 @@
using System.Threading;
using System.Diagnostics;
using System.Xml;
-using System.Drawing.Drawing2D;
using DigitalPlatform;
+using DigitalPlatform.Xml;
+using DigitalPlatform.Script;
using DigitalPlatform.CommonControl;
using DigitalPlatform.Text;
using DigitalPlatform.IO;
using DigitalPlatform.CirculationClient;
using DigitalPlatform.LibraryClient.localhost;
-using DigitalPlatform.Script;
-using DigitalPlatform.Xml;
namespace dp2Circulation
{
@@ -504,6 +504,12 @@ internal int SelectOneItem(
dlg.FunctionType = "inventory";
dlg.Text = "请选择要盘点的册";
}
+ else if (func == dp2Circulation.FuncState.Read)
+ {
+ dlg.FunctionType = "read";
+ dlg.VerifyBorrower = this._taskList.CurrentReaderBarcode;
+ dlg.Text = "请选择要读过的册";
+ }
dlg.AutoOperSingleItem = this.AutoOperSingleItem;
dlg.AutoSearch = true;
@@ -1586,6 +1592,21 @@ void _doAction(FuncState func,
task.ItemBarcode = strText;
task.Action = "verify_lost";
}
+ else if (func == dp2Circulation.FuncState.Read)
+ {
+ if (string.IsNullOrEmpty(this._taskList.CurrentReaderBarcode) == true)
+ {
+ WillLoadReaderInfo = true;
+ // 提示请输入读者证条码号
+ // TODO: 这里直接出现对话框搜集读者证条码号
+ MessageBox.Show(this, "请先输入读者证条码号,然后再输入册条码号");
+ this.textBox_input.SelectAll();
+ return;
+ }
+ task.ReaderBarcode = this._taskList.CurrentReaderBarcode;
+ task.ItemBarcode = strText;
+ task.Action = "read";
+ }
this.textBox_input.SelectAll();
@@ -1691,6 +1712,11 @@ private void ToolStripMenuItem_inventoryBook_Click(object sender, EventArgs e)
this.FuncState = FuncState.InventoryBook;
}
+ private void ToolStripMenuItem_read_Click(object sender, EventArgs e)
+ {
+ this.FuncState = FuncState.Read;
+ }
+
#region 各种配置参数
// 加快响应的记忆变量
@@ -1751,7 +1777,7 @@ public string PatronRenderFormat
string strFormat = "";
if (_cardControl != null)
{
- if (this.NoBorrowHistory == true
+ if (this.NoBorrowHistory == true
&& StringUtil.CompareVersion(this.MainForm.ServerVersion, "2.25") >= 0)
{
styles.Add("noborrowhistory");
@@ -1896,7 +1922,8 @@ FuncState FuncState
this.toolStripMenuItem_verifyLost.Checked = false;
this.toolStripMenuItem_loadPatronInfo.Checked = false;
this.toolStripMenuItem_continueBorrow.Checked = false;
- this.ToolStripMenuItem_inventoryBook.Checked = false;
+ this.toolStripMenuItem_inventoryBook.Checked = false;
+ this.toolStripMenuItem_read.Checked = false;
if (this.AutoClearTextbox == true)
{
@@ -1957,9 +1984,13 @@ FuncState FuncState
}
else if (_funcstate == FuncState.InventoryBook)
{
- this.ToolStripMenuItem_inventoryBook.Checked = true;
+ this.toolStripMenuItem_inventoryBook.Checked = true;
WillLoadReaderInfo = false;
}
+ else if (_funcstate == FuncState.Read)
+ {
+ this.toolStripMenuItem_read.Checked = true;
+ }
// SetInputMessage();
}
}
@@ -3179,7 +3210,11 @@ string GetUpperCase(string strText)
if (string.IsNullOrEmpty(strText) == true)
return strText;
if (this.toolStripButton_upperInput.Checked == true)
+ {
+ if (strText.ToLower().StartsWith("@bibliorecpath:") == true)
+ return strText; // 特殊地,不要转为大写
return strText.ToUpper();
+ }
return strText;
}
@@ -3234,6 +3269,8 @@ private void pictureBox_action_Paint(object sender, PaintEventArgs e)
strText = "自";
else if (_funcstate == FuncState.InventoryBook)
strText = "盘";
+ else if (_funcstate == FuncState.Read)
+ strText = "读";
else
strText = "?";
@@ -3402,6 +3439,7 @@ public int DoReturn(List barcode_list,
return 0;
}
+
}
///
diff --git a/dp2Circulation/Charging/QuickChargingForm.resx b/dp2Circulation/Charging/QuickChargingForm.resx
index e781aaec0..e69a4d68b 100644
--- a/dp2Circulation/Charging/QuickChargingForm.resx
+++ b/dp2Circulation/Charging/QuickChargingForm.resx
@@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC4
- CQAAAk1TRnQBSQFMAgEBAgEAAUwBAAFMAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
+ CQAAAk1TRnQBSQFMAgEBAgEAAVQBAAFUAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -189,7 +189,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB2
- IQAAAk1TRnQBSQFMAgEBBQEAAUwBAAFMAQABQAEAAUABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
+ IQAAAk1TRnQBSQFMAgEBBQEAAVQBAAFUAQABQAEAAUABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
BAABAQIAAYADAAEBAQABCAYAAYAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -342,7 +342,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAs
- DwAAAk1TRnQBSQFMAgEBBQEAAUwBAAFMAQABGAEAARgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
+ DwAAAk1TRnQBSQFMAgEBBQEAAVQBAAFUAQABGAEAARgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABYAMAATADAAEBAQABCAYAARIYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
diff --git a/dp2Circulation/Charging/SelectItemDialog.Designer.cs b/dp2Circulation/Charging/SelectItemDialog.Designer.cs
index 1edc2805c..59c648980 100644
--- a/dp2Circulation/Charging/SelectItemDialog.Designer.cs
+++ b/dp2Circulation/Charging/SelectItemDialog.Designer.cs
@@ -37,7 +37,7 @@ private void InitializeComponent()
this.dpColumn_itemBarcode = new DigitalPlatform.CommonControl.DpColumn();
this.dpColumn_borrowInfo = new DigitalPlatform.CommonControl.DpColumn();
this.dpColumn_summary = new DigitalPlatform.CommonControl.DpColumn();
- this.dpColumn_volumn = new DigitalPlatform.CommonControl.DpColumn();
+ this.dpColumn_volume = new DigitalPlatform.CommonControl.DpColumn();
this.dpColumn_location = new DigitalPlatform.CommonControl.DpColumn();
this.dpColumn_price = new DigitalPlatform.CommonControl.DpColumn();
this.dpColumn_itemRecPath = new DigitalPlatform.CommonControl.DpColumn();
@@ -94,7 +94,7 @@ private void InitializeComponent()
this.dpTable_items.Columns.Add(this.dpColumn_itemBarcode);
this.dpTable_items.Columns.Add(this.dpColumn_borrowInfo);
this.dpTable_items.Columns.Add(this.dpColumn_summary);
- this.dpTable_items.Columns.Add(this.dpColumn_volumn);
+ this.dpTable_items.Columns.Add(this.dpColumn_volume);
this.dpTable_items.Columns.Add(this.dpColumn_location);
this.dpTable_items.Columns.Add(this.dpColumn_price);
this.dpTable_items.Columns.Add(this.dpColumn_itemRecPath);
@@ -156,14 +156,14 @@ private void InitializeComponent()
this.dpColumn_summary.Text = "书目摘要";
this.dpColumn_summary.Width = 200;
//
- // dpColumn_volumn
+ // dpColumn_volume
//
- this.dpColumn_volumn.Alignment = System.Drawing.StringAlignment.Near;
- this.dpColumn_volumn.BackColor = System.Drawing.Color.Transparent;
- this.dpColumn_volumn.Font = null;
- this.dpColumn_volumn.ForeColor = System.Drawing.Color.Transparent;
- this.dpColumn_volumn.Text = "卷册";
- this.dpColumn_volumn.Width = 50;
+ this.dpColumn_volume.Alignment = System.Drawing.StringAlignment.Near;
+ this.dpColumn_volume.BackColor = System.Drawing.Color.Transparent;
+ this.dpColumn_volume.Font = null;
+ this.dpColumn_volume.ForeColor = System.Drawing.Color.Transparent;
+ this.dpColumn_volume.Text = "卷册";
+ this.dpColumn_volume.Width = 50;
//
// dpColumn_location
//
@@ -292,7 +292,7 @@ private void InitializeComponent()
private DigitalPlatform.CommonControl.DpColumn dpColumn_itemBarcode;
private DigitalPlatform.CommonControl.DpColumn dpColumn_borrowInfo;
private DigitalPlatform.CommonControl.DpColumn dpColumn_summary;
- private DigitalPlatform.CommonControl.DpColumn dpColumn_volumn;
+ private DigitalPlatform.CommonControl.DpColumn dpColumn_volume;
private DigitalPlatform.CommonControl.DpColumn dpColumn_location;
private DigitalPlatform.CommonControl.DpColumn dpColumn_price;
private DigitalPlatform.CommonControl.DpColumn dpColumn_itemRecPath;
diff --git a/dp2Circulation/Charging/SelectItemDialog.cs b/dp2Circulation/Charging/SelectItemDialog.cs
index 77cc43b41..d64fe7525 100644
--- a/dp2Circulation/Charging/SelectItemDialog.cs
+++ b/dp2Circulation/Charging/SelectItemDialog.cs
@@ -17,6 +17,8 @@
// using DigitalPlatform.LibraryClient.localhost;
using DigitalPlatform.LibraryClient;
using DigitalPlatform.LibraryClient.localhost;
+using System.Collections;
+using DigitalPlatform.Marc;
namespace dp2Circulation
{
@@ -42,7 +44,7 @@ public partial class SelectItemDialog : MyForm
/// 功能类型
/// 根据它决定某些事项显示为灰色文字
///
- public string FunctionType = "borrow"; // borrow/return/renew
+ public string FunctionType = "borrow"; // borrow/return/renew/inventory/read。在 read 状态时,除了显示册记录行,还要显示书目记录行
///
/// 验证还书时的读者证条码号
@@ -132,11 +134,24 @@ string GetBiblioDbNames()
{
foreach (BiblioDbProperty prop in this.MainForm.BiblioDbProperties)
{
- if (string.IsNullOrEmpty(prop.DbName) == false &&
- string.IsNullOrEmpty(prop.ItemDbName) == false)
+ if (string.IsNullOrEmpty(prop.DbName) == true)
+ continue; // 很罕见的情况下,数据库组可能不包含书目库
+
+#if NO
+ if (this.FunctionType == "read")
{
+ // “读过”功能要检索所有书目库
results.Add(prop.DbName);
}
+ else
+#endif
+ {
+ if (string.IsNullOrEmpty(prop.DbName) == false &&
+ string.IsNullOrEmpty(prop.ItemDbName) == false)
+ {
+ results.Add(prop.DbName);
+ }
+ }
}
}
@@ -144,6 +159,7 @@ string GetBiblioDbNames()
}
int m_nInSearching = 0;
+ Hashtable _biblioXmlTable = new Hashtable(); // biblioRecPath --> xml
private void button_search_Click(object sender, EventArgs e)
{
@@ -158,6 +174,7 @@ private void button_search_Click(object sender, EventArgs e)
goto ERROR1;
}
+ this._biblioXmlTable.Clear();
this._biblioRecPaths.Clear();
this.dpTable_items.Rows.Clear();
@@ -280,7 +297,7 @@ private void button_search_Click(object sender, EventArgs e)
null, // strResultSetName
lStart,
lPerCount,
- "id", // "id,cols",
+ this.FunctionType == "read" ? "id,xml" : "id", // "id,cols",
this.Lang,
out searchresults,
out strError);
@@ -305,6 +322,9 @@ private void button_search_Click(object sender, EventArgs e)
foreach (DigitalPlatform.LibraryClient.localhost.Record record in searchresults)
{
this._biblioRecPaths.Add(record.Path);
+ // 存储书目记录 XML
+ if (this.FunctionType == "read" && record.RecordBody != null)
+ this._biblioXmlTable[record.Path] = record.RecordBody.Xml;
}
lStart += searchresults.Length;
@@ -428,6 +448,11 @@ int LoadBiblioSubItems(
Progress.SetMessage("正在装入书目记录 '" + strBiblioRecPath + "' 下属的册记录 ...");
+ if (this.FunctionType == "read")
+ {
+ AddBiblioLine(strBiblioRecPath);
+ }
+
int nCount = 0;
long lPerCount = 100; // 每批获得多少个
@@ -577,9 +602,9 @@ int LoadBiblioSubItems(
row.Add(cell);
// 卷册
- string strVolumn = DomUtil.GetElementText(dom.DocumentElement, "volumn");
+ string strVolume = DomUtil.GetElementText(dom.DocumentElement, "volume");
cell = new DpCell();
- cell.Text = strVolumn;
+ cell.Text = strVolume;
row.Add(cell);
// 地点
@@ -614,6 +639,7 @@ int LoadBiblioSubItems(
lCount = lResultCount - lStart;
}
+ // 分割行
if (lStart > 0)
{
DpRow row = new DpRow();
@@ -624,11 +650,165 @@ int LoadBiblioSubItems(
return nCount;
}
+ void GetVolume(string strBiblioRecPath,
+ out string strVolume,
+ out string strPrice)
+ {
+ strVolume = "";
+ strPrice = "";
+
+ string strXml = (string)this._biblioXmlTable[strBiblioRecPath];
+ if (string.IsNullOrEmpty(strXml) == true)
+ return;
+
+ string strOutMarcSyntax = "";
+ string strMARC = "";
+ string strError = "";
+ int nRet = MarcUtil.Xml2Marc(strXml,
+ false,
+ "",
+ out strOutMarcSyntax,
+ out strMARC,
+ out strError);
+ if (nRet == -1)
+ return;
+ if (string.IsNullOrEmpty(strMARC) == true)
+ return;
+ MarcRecord record = new MarcRecord(strMARC);
+ if (strOutMarcSyntax == "unimarc")
+ {
+ string h = record.select("field[@name='200']/subfield[@name='h']").FirstContent;
+ string i = record.select("field[@name='200']/subfield[@name='h']").FirstContent;
+ if (string.IsNullOrEmpty(h) == false && string.IsNullOrEmpty(i) == false)
+ strVolume = h + " . " + i;
+ else
+ {
+ if (h == null)
+ h = "";
+ strVolume = h + i;
+ }
+
+ strPrice = record.select("field[@name='010']/subfield[@name='d']").FirstContent;
+ }
+ else if (strOutMarcSyntax == "usmarc")
+ {
+ string n = record.select("field[@name='200']/subfield[@name='n']").FirstContent;
+ string p = record.select("field[@name='200']/subfield[@name='p']").FirstContent;
+ if (string.IsNullOrEmpty(n) == false && string.IsNullOrEmpty(p) == false)
+ strVolume = n + " . " + p;
+ else
+ {
+ if (n == null)
+ n = "";
+ strVolume = n + p;
+ }
+
+ strPrice = record.select("field[@name='020']/subfield[@name='c']").FirstContent;
+ }
+ else
+ {
+
+ }
+
+ }
+
+ // 加入书目行
+ void AddBiblioLine(string strBiblioRecPath)
+ {
+ string strError = "";
+
+ string strVolume = "";
+ string strPrice = "";
+
+ GetVolume(strBiblioRecPath,
+ out strVolume,
+ out strPrice);
+
+ Color colorBack = Color.LightGreen;
+
+ DpRow row = new DpRow();
+#if NO
+ // 设为灰色行
+ SetGrayText(row);
+#endif
+
+ // 状态
+ DpCell cell = new DpCell();
+ cell.BackColor = colorBack;
+ cell.Text = "";
+ row.Add(cell);
+
+ // 册条码号
+ cell = new DpCell();
+ cell.BackColor = colorBack;
+ cell.Text = "@biblioRecPath:" + strBiblioRecPath;
+ row.Add(cell);
+
+ // 在借情况
+ cell = new DpCell();
+ cell.BackColor = colorBack;
+#if NO
+ {
+ if (IsGray(row) == true)
+ cell.BackColor = Color.FromArgb(220, 220, 0);
+ else
+ cell.BackColor = Color.FromArgb(180, 180, 0);
+
+ cell.ForeColor = Color.FromArgb(255, 255, 255);
+ cell.Alignment = DpTextAlignment.Center;
+ cell.Text = "";
+ }
+#endif
+ row.Add(cell);
+
+ // 书目摘要
+ string strSummary = "";
+ {
+ int nRet = this.MainForm.GetBiblioSummary("@bibliorecpath:" + strBiblioRecPath,
+ "",
+ false,
+ out strSummary,
+ out strError);
+ if (nRet == -1)
+ strSummary = strError;
+ }
+ cell = new DpCell();
+ cell.BackColor = colorBack;
+ cell.Text = strSummary;
+ row.Add(cell);
+
+ // 卷册
+ cell = new DpCell();
+ cell.BackColor = colorBack;
+ cell.Text = strVolume;
+ row.Add(cell);
+
+ // 地点
+ cell = new DpCell();
+ cell.BackColor = colorBack;
+ cell.Text = "";
+ row.Add(cell);
+
+ // 价格
+ cell = new DpCell();
+ cell.BackColor = colorBack;
+ cell.Text = strPrice;
+ row.Add(cell);
+
+ // 册记录路径
+ cell = new DpCell();
+ cell.BackColor = colorBack;
+ cell.Text = strBiblioRecPath;
+ row.Add(cell);
+
+ this.dpTable_items.Rows.Add(row);
+ }
+
const int COLUMN_STATE = 0;
const int COLUMN_ITEMBARCODE = 1;
const int COLUMN_BORROWINFO = 2;
const int COLUMN_SUMMARY = 3;
- const int COLUMN_VOLUMN = 4;
+ const int COLUMN_VOLUME = 4;
const int COLUMN_LOCATION = 5;
const int COLUMN_PRICE = 6;
const int COLUMN_ITEMRECPATH = 7;
@@ -689,7 +869,7 @@ private void dpTable_items_DoubleClick(object sender, EventArgs e)
// 检查是否为灰色文字
if (Control.ModifierKeys == Keys.Control)
{
- // 按下 Control 键盘的时候灰色事项也可以操作
+ // 按下 Control 键的时候灰色事项也可以操作
}
else
{
@@ -1012,6 +1192,7 @@ static string GetRowText(DpRow row)
return text.ToString();
}
+
// 打开到 册窗
void menuItem_loadToItemInfoForm_Click(object sender, EventArgs e)
{
@@ -1030,6 +1211,12 @@ void menuItem_loadToItemInfoForm_Click(object sender, EventArgs e)
strError = "所选定的册事项不具备册条码号信息";
goto ERROR1;
}
+ if (strItemBarcode.StartsWith("@biblioRecPath:") == true)
+ {
+ strError = "所选定的行是书目行,不具备册条码号信息";
+ goto ERROR1;
+ }
+
ItemInfoForm form = this.MainForm.EnsureItemInfoForm();
Global.Activate(form);
@@ -1064,7 +1251,10 @@ void menuItem_loadToEntityForm_Click(object sender, EventArgs e)
EntityForm form = this.MainForm.EnsureEntityForm();
Global.Activate(form);
- form.LoadItemByBarcode(strItemBarcode, false);
+ if (strItemBarcode.StartsWith("@biblioRecPath:") == true)
+ form.LoadRecordOld(strItemBarcode.Substring("@biblioRecPath:".Length), "", true);
+ else
+ form.LoadItemByBarcode(strItemBarcode, false);
this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Close();
@@ -1072,7 +1262,6 @@ void menuItem_loadToEntityForm_Click(object sender, EventArgs e)
ERROR1:
MessageBox.Show(this, strError);
}
-
}
#if NO
diff --git a/dp2Circulation/Charging/SelectItemDialog.resx b/dp2Circulation/Charging/SelectItemDialog.resx
index 3921f011c..cbb8baf95 100644
--- a/dp2Circulation/Charging/SelectItemDialog.resx
+++ b/dp2Circulation/Charging/SelectItemDialog.resx
@@ -145,7 +145,7 @@
211, 17
-
+
385, 17
diff --git a/dp2Circulation/Charging/SummaryList.cs b/dp2Circulation/Charging/SummaryList.cs
index 0c44397ba..7b73179bd 100644
--- a/dp2Circulation/Charging/SummaryList.cs
+++ b/dp2Circulation/Charging/SummaryList.cs
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Threading;
using DigitalPlatform;
-using System.Threading;
using DigitalPlatform.CirculationClient;
using DigitalPlatform.CommonControl;
diff --git a/dp2Circulation/Entity/BookItem.cs b/dp2Circulation/Entity/BookItem.cs
index f1cc197e8..729d6ee68 100644
--- a/dp2Circulation/Entity/BookItem.cs
+++ b/dp2Circulation/Entity/BookItem.cs
@@ -58,7 +58,7 @@ public class BookItem : BookItemBase
///
/// ListView 栏目下标:卷册信息
///
- public const int COLUMN_VOLUMN = 8;
+ public const int COLUMN_VOLUME = 8;
///
/// ListView 栏目下标:索取号
///
@@ -157,7 +157,7 @@ public void SetColumnText(int nCol, string strText)
this.Source = strText;
else if (nCol == COLUMN_PRICE)
this.Price = strText;
- else if (nCol == COLUMN_VOLUMN)
+ else if (nCol == COLUMN_VOLUME)
this.Volume = strText;
else if (nCol == COLUMN_ACCESSNO)
this.AccessNo = strText;
@@ -658,7 +658,7 @@ public override void SetItemColumns(ListViewItem item)
this.Price);
ListViewUtil.ChangeItemText(item,
- COLUMN_VOLUMN,
+ COLUMN_VOLUME,
this.Volume);
ListViewUtil.ChangeItemText(item,
COLUMN_ACCESSNO,
diff --git a/dp2Circulation/Entity/BookItemBase.cs b/dp2Circulation/Entity/BookItemBase.cs
index b417a8a3b..f11ffbb72 100644
--- a/dp2Circulation/Entity/BookItemBase.cs
+++ b/dp2Circulation/Entity/BookItemBase.cs
@@ -102,7 +102,7 @@ public string ErrorInfo
///
public EntityInfo Error = null;
-
+
///
/// 构造函数
///
@@ -274,91 +274,6 @@ public bool Changed
/// 刚加入的 ListViewItem
public ListViewItem AddToListView(ListView list)
{
-#if NO
- ListViewItem item = new ListViewItem(this.Barcode, 0);
-
- // 2009/10/11 changed
- ListViewUtil.ChangeItemText(item,
- COLUMN_ERRORINFO,
- this.ErrorInfo);
-
- ListViewUtil.ChangeItemText(item,
- COLUMN_STATE,
- this.State);
- ListViewUtil.ChangeItemText(item,
- COLUMN_PUBLISHTIME,
- this.PublishTime);
- ListViewUtil.ChangeItemText(item,
- COLUMN_LOCATION,
- this.Location);
-
- ListViewUtil.ChangeItemText(item,
- COLUMN_SELLER,
- this.Seller);
- ListViewUtil.ChangeItemText(item,
- COLUMN_SOURCE,
- this.Source);
-
- ListViewUtil.ChangeItemText(item,
- COLUMN_PRICE,
- this.Price);
-
- ListViewUtil.ChangeItemText(item,
- COLUMN_VOLUMN,
- this.Volume);
- ListViewUtil.ChangeItemText(item,
- COLUMN_ACCESSNO,
- this.AccessNo);
-
- ListViewUtil.ChangeItemText(item,
- COLUMN_BOOKTYPE,
- this.BookType);
- ListViewUtil.ChangeItemText(item,
- COLUMN_REGISTERNO,
- this.RegisterNo);
- ListViewUtil.ChangeItemText(item,
- COLUMN_COMMENT,
- this.Comment);
- ListViewUtil.ChangeItemText(item,
- COLUMN_MERGECOMMENT,
- this.MergeComment);
- ListViewUtil.ChangeItemText(item,
- COLUMN_BATCHNO,
- this.BatchNo);
-
- ListViewUtil.ChangeItemText(item,
- COLUMN_BORROWER,
- this.Borrower);
- ListViewUtil.ChangeItemText(item,
- COLUMN_BORROWDATE,
- this.BorrowDate);
- ListViewUtil.ChangeItemText(item,
- COLUMN_BORROWPERIOD,
- this.BorrowPeriod);
-
- ListViewUtil.ChangeItemText(item,
- COLUMN_INTACT,
- this.Intact);
- ListViewUtil.ChangeItemText(item,
- COLUMN_BINDINGCOST,
- this.BindingCost);
- ListViewUtil.ChangeItemText(item,
- COLUMN_BINDING,
- this.Binding);
-
- // 2013/1/18 增补 以前缺乏的情况是个bug
- ListViewUtil.ChangeItemText(item,
- COLUMN_OPERATIONS,
- this.Binding);
-
-
- ListViewUtil.ChangeItemText(item,
- COLUMN_RECPATH,
- this.RecPath);
- ListViewUtil.ChangeItemText(item,
- COLUMN_REFID,
- this.RefID);
-#endif
ListViewItem item = new ListViewItem();
item.ImageIndex = 0;
diff --git a/dp2Circulation/Entity/GenerateData.cs b/dp2Circulation/Entity/GenerateData.cs
index 8c04414f3..ad07858f4 100644
--- a/dp2Circulation/Entity/GenerateData.cs
+++ b/dp2Circulation/Entity/GenerateData.cs
@@ -629,7 +629,8 @@ public void AutoGenerate(object sender,
// TODO: 报错是否要直接显示在 dpTable 中?
// MessageBox.Show(this._myForm, strError);
DisplayAutoGenMenuWindow(false);
- this.m_genDataViewer.DisplayError(strError);
+ if (this.m_genDataViewer != null)
+ this.m_genDataViewer.DisplayError(strError);
}
finally
{
diff --git a/dp2Circulation/Entity/InventoryForm.cs b/dp2Circulation/Entity/InventoryForm.cs
index bca9e84fb..cf717470b 100644
--- a/dp2Circulation/Entity/InventoryForm.cs
+++ b/dp2Circulation/Entity/InventoryForm.cs
@@ -2837,7 +2837,7 @@ void FillOperLogHtml()
///
public void ClearHtml()
{
- string strCssUrl = Path.Combine(this.MainForm.DataDir, "default\\inventory.css");
+ string strCssUrl = Path.Combine(this.MainForm.DataDir, "default\\inventory.css"); // ?? 还是用的 default 目录的文件啊,没有用用户目录的同名文件。似乎启动时不用拷贝了
string strLink = "";
string strJs = "";
@@ -3894,7 +3894,8 @@ void menu_loadSelectedBaseListItemsToItemSearchForm_Click(object sender, EventAr
ItemSearchForm form = this.MainForm.OpenItemSearchForm("item");
// form.Activate();
int nRet = form.ImportFromRecPathFile(strTempFileName,
- out strError);
+ "clear",
+ out strError);
if (nRet == -1)
goto ERROR1;
}
diff --git a/dp2Circulation/Entity/ItemBarcodeLoader.cs b/dp2Circulation/Entity/ItemBarcodeLoader.cs
index b942ac0e9..511a2274f 100644
--- a/dp2Circulation/Entity/ItemBarcodeLoader.cs
+++ b/dp2Circulation/Entity/ItemBarcodeLoader.cs
@@ -7,15 +7,14 @@
using DigitalPlatform;
using DigitalPlatform.Text;
-using DigitalPlatform.CirculationClient;
-// using DigitalPlatform.LibraryClient.localhost;
+// using DigitalPlatform.CirculationClient;
using DigitalPlatform.LibraryClient;
using DigitalPlatform.LibraryClient.localhost;
namespace dp2Circulation
{
// 通过册条码号获得册记录路径的枚举器
- public class ItemBarcodeLoader : IEnumerable
+ public class ItemBarcodeLoader : IEnumerable
{
///
/// 提示框事件
@@ -50,14 +49,13 @@ public Stop Stop
public IEnumerator GetEnumerator()
{
-
List batch = new List();
for (int index = 0; index < m_barcodes.Count; index++)
{
string s = m_barcodes[index];
if (string.IsNullOrEmpty(s) == true)
- throw new Exception("册条码号字符串不允许为空 (index="+index.ToString()+")");
+ throw new Exception("册条码号字符串不允许为空 (index=" + index.ToString() + ")");
batch.Add(s);
diff --git a/dp2Circulation/EntityForm/EntityForm.cs b/dp2Circulation/EntityForm/EntityForm.cs
index c640074b8..1101067a9 100644
--- a/dp2Circulation/EntityForm/EntityForm.cs
+++ b/dp2Circulation/EntityForm/EntityForm.cs
@@ -147,7 +147,7 @@ public bool AcceptMode
BrowseSearchResultForm browseWindow = null;
- int m_nInSearching = 0;
+ //// int m_nInSearching = 0;
// string m_strTempBiblioRecPath = "";
RegisterType m_registerType = RegisterType.Register;
@@ -4544,232 +4544,235 @@ public int MaxSearchResultCount
private void button_search_Click(object sender, EventArgs e)
{
string strError = "";
- int nRet = 0;
- bool bDisplayClickableError = false;
- long lHitCount = 0;
- _willCloseBrowseWindow = false;
- // _browseWindowSelected = false;
+ this._processing++;
+ try
+ {
+ int nRet = 0;
+ bool bDisplayClickableError = false;
+ long lHitCount = 0;
- ActivateBrowseWindow(false);
+ _willCloseBrowseWindow = false;
+ // _browseWindowSelected = false;
- this.browseWindow.RecordsList.Items.Clear();
+ ActivateBrowseWindow(false);
- LibraryChannel channel = this.GetChannel();
+ this.browseWindow.RecordsList.Items.Clear();
- Progress.Style = StopStyle.EnableHalfStop;
- Progress.OnStop += new StopEventHandler(this.DoStop);
- Progress.Initial("正在检索 ...");
- Progress.BeginLoop();
+ LibraryChannel channel = this.GetChannel();
- this.ShowMessage("正在检索 ...");
+ Progress.Style = StopStyle.EnableHalfStop;
+ Progress.OnStop += new StopEventHandler(this.DoStop);
+ Progress.Initial("正在检索 ...");
+ Progress.BeginLoop();
- this.browseWindow.stop = Progress;
+ this.ShowMessage("正在检索 ...");
- //this.button_search.Enabled = false;
- this.EnableControls(false);
+ this.browseWindow.stop = Progress;
- m_nInSearching++;
-
- try
- {
- if (this.comboBox_from.Text == "")
- {
- strError = "尚未选定检索途径";
- goto ERROR1;
- }
- string strFromStyle = "";
+ //this.button_search.Enabled = false;
+ this.EnableControls(false);
+ ////m_nInSearching++;
try
{
- strFromStyle = this.MainForm.GetBiblioFromStyle(this.comboBox_from.Text);
- }
- catch (Exception ex)
- {
- strError = "GetBiblioFromStyle() exception:" + ExceptionUtil.GetAutoText(ex);
- goto ERROR1;
- }
-
- if (String.IsNullOrEmpty(strFromStyle) == true)
- {
- strError = "GetFromStyle()没有找到 '" + this.comboBox_from.Text + "' 对应的style字符串";
- goto ERROR1;
- }
-
- string strMatchStyle = BiblioSearchForm.GetCurrentMatchStyle(this.comboBox_matchStyle.Text);
- if (this.textBox_queryWord.Text == "")
- {
- if (strMatchStyle == "null")
+ if (this.comboBox_from.Text == "")
{
- this.textBox_queryWord.Text = "";
-
- // 专门检索空值
- strMatchStyle = "exact";
+ strError = "尚未选定检索途径";
+ goto ERROR1;
}
- else
+ string strFromStyle = "";
+
+ try
{
- // 为了在检索词为空的时候,检索出全部的记录
- strMatchStyle = "left";
+ strFromStyle = this.MainForm.GetBiblioFromStyle(this.comboBox_from.Text);
}
- }
- else
- {
- // 2009/11/5
- if (strMatchStyle == "null")
+ catch (Exception ex)
{
- strError = "检索空值的时候,请保持检索词为空";
+ strError = "GetBiblioFromStyle() exception:" + ExceptionUtil.GetAutoText(ex);
goto ERROR1;
}
- }
- string strQueryWord = GetBiblioQueryString();
+ if (String.IsNullOrEmpty(strFromStyle) == true)
+ {
+ strError = "GetFromStyle()没有找到 '" + this.comboBox_from.Text + "' 对应的style字符串";
+ goto ERROR1;
+ }
- bool bNeedShareSearch = false;
- if (this.SearchShareBiblio == true
- && this.MainForm != null && this.MainForm.MessageHub != null
- && this.MainForm.MessageHub.ShareBiblio == true)
- {
- bNeedShareSearch = true;
- }
+ string strMatchStyle = BiblioSearchForm.GetCurrentMatchStyle(this.comboBox_matchStyle.Text);
+ if (this.textBox_queryWord.Text == "")
+ {
+ if (strMatchStyle == "null")
+ {
+ this.textBox_queryWord.Text = "";
- if (bNeedShareSearch == true)
- {
- // 开始检索共享书目
- // return:
- // -1 出错
- // 0 没有检索目标
- // 1 成功启动检索
- nRet = BeginSearchShareBiblio(
- this.textBox_queryWord.Text,
- strFromStyle,
- strMatchStyle,
- out strError);
- if (nRet == -1)
+ // 专门检索空值
+ strMatchStyle = "exact";
+ }
+ else
+ {
+ // 为了在检索词为空的时候,检索出全部的记录
+ strMatchStyle = "left";
+ }
+ }
+ else
{
- // 显示错误信息
- this.ShowMessage(strError, "red", true);
- bDisplayClickableError = true;
+ // 2009/11/5
+ if (strMatchStyle == "null")
+ {
+ strError = "检索空值的时候,请保持检索词为空";
+ goto ERROR1;
+ }
}
- }
-
- string strQueryXml = "";
- long lRet = channel.SearchBiblio(Progress,
- this.checkedComboBox_biblioDbNames.Text, // "<全部>",
- strQueryWord, // this.textBox_queryWord.Text,
- this.MaxSearchResultCount, // 1000
- strFromStyle,
- strMatchStyle,
- this.Lang,
- null, // strResultSetName
- "", // strSearchStyle
- "", // strOutputStyle
- out strQueryXml,
- out strError);
- if (lRet == -1)
- goto ERROR1;
- // TODO: 最多检索1000条的限制,可以作为参数配置?在CfgDlg中
+ string strQueryWord = GetBiblioQueryString();
- lHitCount = lRet;
+ bool bNeedShareSearch = false;
+ if (this.SearchShareBiblio == true
+ && this.MainForm != null && this.MainForm.MessageHub != null
+ && this.MainForm.MessageHub.ShareBiblio == true)
+ {
+ bNeedShareSearch = true;
+ }
- if (lHitCount == 0)
- {
- // strError = "从途径 '" + strFromStyle + "' 检索 '" + strQueryWord + "' 没有命中";
- // goto ERROR1;
- }
- else
- {
- if (Progress != null && Progress.State != 0)
+ if (bNeedShareSearch == true)
{
- strError = "用户中断";
- goto ERROR1;
+ // 开始检索共享书目
+ // return:
+ // -1 出错
+ // 0 没有检索目标
+ // 1 成功启动检索
+ nRet = BeginSearchShareBiblio(
+ this.textBox_queryWord.Text,
+ strFromStyle,
+ strMatchStyle,
+ out strError);
+ if (nRet == -1)
+ {
+ // 显示错误信息
+ this.ShowMessage(strError, "red", true);
+ bDisplayClickableError = true;
+ }
}
- if (lHitCount > 1)
- this.ShowBrowseWindow(-1);
+ string strQueryXml = "";
+ long lRet = channel.SearchBiblio(Progress,
+ this.checkedComboBox_biblioDbNames.Text, // "<全部>",
+ strQueryWord, // this.textBox_queryWord.Text,
+ this.MaxSearchResultCount, // 1000
+ strFromStyle,
+ strMatchStyle,
+ this.Lang,
+ null, // strResultSetName
+ "", // strSearchStyle
+ "", // strOutputStyle
+ out strQueryXml,
+ out strError);
+ if (lRet == -1)
+ goto ERROR1;
- // 从此位置以后,_willCloseBrowseWindow 如果变为 true 则表示要立即终止循环和处理
+ // TODO: 最多检索1000条的限制,可以作为参数配置?在CfgDlg中
- long lStart = 0;
- long lPerCount = Math.Min(50, lHitCount);
- DigitalPlatform.LibraryClient.localhost.Record[] searchresults = null;
+ lHitCount = lRet;
- // 装入浏览格式
- for (; ; )
+ if (lHitCount == 0)
{
- Application.DoEvents(); // 出让界面控制权
-
- if ((Progress != null && Progress.State != 0)
- || _willCloseBrowseWindow)
+ // strError = "从途径 '" + strFromStyle + "' 检索 '" + strQueryWord + "' 没有命中";
+ // goto ERROR1;
+ }
+ else
+ {
+ if (Progress != null && Progress.State != 0)
{
- // MessageBox.Show(this, "用户中断");
- break; // 已经装入的还在
+ strError = "用户中断";
+ goto ERROR1;
}
- Progress.SetMessage("正在装入浏览信息 " + (lStart + 1).ToString() + " - " + (lStart + lPerCount).ToString() + " (命中 " + lHitCount.ToString() + " 条记录) ...");
+ if (lHitCount > 1)
+ this.ShowBrowseWindow(-1);
- lRet = channel.GetSearchResult(
- Progress,
- null, // strResultSetName
- lStart,
- lPerCount,
- "id,cols",
- this.Lang,
- out searchresults,
- out strError);
- if (lRet == -1)
+ // 从此位置以后,_willCloseBrowseWindow 如果变为 true 则表示要立即终止循环和处理
+
+ long lStart = 0;
+ long lPerCount = Math.Min(50, lHitCount);
+ DigitalPlatform.LibraryClient.localhost.Record[] searchresults = null;
+
+ // 装入浏览格式
+ for (; ; )
{
- if (this.browseWindow == null
- || (Progress != null && Progress.State != 0)
+ Application.DoEvents(); // 出让界面控制权
+
+ if ((Progress != null && Progress.State != 0)
|| _willCloseBrowseWindow)
{
// MessageBox.Show(this, "用户中断");
- break;
+ break; // 已经装入的还在
}
- goto ERROR1;
- }
+ Progress.SetMessage("正在装入浏览信息 " + (lStart + 1).ToString() + " - " + (lStart + lPerCount).ToString() + " (命中 " + lHitCount.ToString() + " 条记录) ...");
- if (lRet == 0)
- {
- MessageBox.Show(this, "未命中");
- return;
- }
+ lRet = channel.GetSearchResult(
+ Progress,
+ null, // strResultSetName
+ lStart,
+ lPerCount,
+ "id,cols",
+ this.Lang,
+ out searchresults,
+ out strError);
+ if (lRet == -1)
+ {
+ if (this.browseWindow == null
+ || (Progress != null && Progress.State != 0)
+ || _willCloseBrowseWindow)
+ {
+ // MessageBox.Show(this, "用户中断");
+ break;
+ }
- // 处理浏览结果
- for (int i = 0; i < searchresults.Length; i++)
- {
- if (this.browseWindow == null)
+ goto ERROR1;
+ }
+
+ if (lRet == 0)
+ {
+ MessageBox.Show(this, "未命中");
+ return;
+ }
+
+ // 处理浏览结果
+ for (int i = 0; i < searchresults.Length; i++)
+ {
+ if (this.browseWindow == null)
+ break;
+ Global.AppendNewLine(
+ this.browseWindow.RecordsList,
+ searchresults[i].Path,
+ searchresults[i].Cols);
+ }
+
+ lStart += searchresults.Length;
+ // lCount -= searchresults.Length;
+ if (lStart >= lHitCount || lPerCount <= 0)
break;
- Global.AppendNewLine(
- this.browseWindow.RecordsList,
- searchresults[i].Path,
- searchresults[i].Cols);
}
-
- lStart += searchresults.Length;
- // lCount -= searchresults.Length;
- if (lStart >= lHitCount || lPerCount <= 0)
- break;
}
- }
- if (bNeedShareSearch == true)
- {
- this.ShowMessage("等待共享检索响应 ...");
- // 结束检索共享书目
- // return:
- // -1 出错
- // >=0 命中记录个数
- nRet = EndSearchShareBiblio(out strError);
- if (nRet == -1)
- {
- // 显示错误信息
- this.ShowMessage(strError, "red", true);
- bDisplayClickableError = true;
- }
- else
+ if (bNeedShareSearch == true)
{
+ this.ShowMessage("等待共享检索响应 ...");
+ // 结束检索共享书目
+ // return:
+ // -1 出错
+ // >=0 命中记录个数
+ nRet = EndSearchShareBiblio(out strError);
+ if (nRet == -1)
+ {
+ // 显示错误信息
+ this.ShowMessage(strError, "red", true);
+ bDisplayClickableError = true;
+ }
+ else
+ {
#if NO
if (_searchParam._searchCount > 0)
{
@@ -4777,13 +4780,13 @@ private void button_search_Click(object sender, EventArgs e)
this._floatingMessage.DelayClear(new TimeSpan(0, 0, 3));
}
#endif
- }
+ }
- lHitCount += _searchParam._searchCount;
- }
+ lHitCount += _searchParam._searchCount;
+ }
- if (this.browseWindow == null)
- goto END1;
+ if (this.browseWindow == null)
+ goto END1;
#if NO
if ((Progress != null && Progress.State != 0)
@@ -4809,63 +4812,69 @@ private void button_search_Click(object sender, EventArgs e)
this.label_message.Text = "检索共命中 " + lHitCount.ToString() + " 条书目记录,已全部装入";
#endif
- // MessageBox.Show(this, Convert.ToString(lRet) + " : " + strError);
- }
- finally
- {
- if (bDisplayClickableError == false
- && this._floatingMessage.InDelay() == false)
- this.ClearMessage();
+ // MessageBox.Show(this, Convert.ToString(lRet) + " : " + strError);
+ }
+ finally
+ {
+ if (bDisplayClickableError == false
+ && this._floatingMessage.InDelay() == false)
+ this.ClearMessage();
- if (this.MainForm.MessageHub != null)
- this.MainForm.MessageHub.SearchResponseEvent -= MessageHub_SearchResponseEvent;
+ if (this.MainForm.MessageHub != null)
+ this.MainForm.MessageHub.SearchResponseEvent -= MessageHub_SearchResponseEvent;
- Progress.EndLoop();
- Progress.OnStop -= new StopEventHandler(this.DoStop);
- Progress.Initial("");
- Progress.Style = StopStyle.None;
+ Progress.EndLoop();
+ Progress.OnStop -= new StopEventHandler(this.DoStop);
+ Progress.Initial("");
+ Progress.Style = StopStyle.None;
- this.ReturnChannel(channel);
+ this.ReturnChannel(channel);
- // this.button_search.Enabled = true;
- this.EnableControls(true);
+ // this.button_search.Enabled = true;
+ this.EnableControls(true);
- m_nInSearching--;
- }
+ //// m_nInSearching--;
+ }
- if (lHitCount > 1)
- this.ShowBrowseWindow(lHitCount);
+ if (lHitCount > 1)
+ this.ShowBrowseWindow(lHitCount);
- if (lHitCount == 1)
- {
- this.browseWindow.LoadFirstDetail(true); // 不会触发 closed 事件
- this.CloseBrowseWindow();
- }
- else
- {
- if (lHitCount == 0)
+ if (lHitCount == 1)
{
- this.ShowMessage("未命中", "yellow", true);
- bDisplayClickableError = true;
+ this.browseWindow.LoadFirstDetail(true); // 不会触发 closed 事件
+ this.CloseBrowseWindow();
+ }
+ else
+ {
+ if (lHitCount == 0)
+ {
+ this.ShowMessage("未命中", "yellow", true);
+ bDisplayClickableError = true;
+ }
}
- }
- if (_willCloseBrowseWindow == true)
- CloseBrowseWindow();
+ if (_willCloseBrowseWindow == true)
+ CloseBrowseWindow();
- END1:
- this.textBox_queryWord.SelectAll();
+ END1:
+ this.textBox_queryWord.SelectAll();
- // 焦点切换到条码textbox
- /*
- this.textBox_itemBarcode.SelectAll();
- this.textBox_itemBarcode.Focus();
- * */
- this.SwitchFocus(ITEM_BARCODE);
+ // 焦点切换到条码textbox
+ /*
+ this.textBox_itemBarcode.SelectAll();
+ this.textBox_itemBarcode.Focus();
+ * */
+ this.SwitchFocus(ITEM_BARCODE);
+
+ DoPendingList(); // 2015/11/29
+ return;
+ }
+ finally
+ {
+ this._processing--;
+ }
- DoPendingList(); // 2015/11/29
- return;
ERROR1:
CloseBrowseWindow();
MessageBox.Show(this, strError);
@@ -9989,13 +9998,48 @@ public void Logout()
private void toolStripButton_prev_Click(object sender, EventArgs e)
{
- // TODO: 可以改进为调用Safe...,这样就不必在意Disable按钮来防止重入了
- this.LoadRecordOld(this.BiblioRecPath, "prev", true);
+ if (Control.ModifierKeys == Keys.Control)
+ {
+ this.ClearMessage();
+ string strRecPath = GetPrevNextRecPath("prev");
+ if (string.IsNullOrEmpty(strRecPath))
+ this.ShowMessage("无法移动", "yellow", true);
+ else
+ this.LoadRecordOld(strRecPath, "", true);
+ }
+ else
+ {
+ // TODO: 可以改进为调用Safe...,这样就不必在意Disable按钮来防止重入了
+ this.LoadRecordOld(this.BiblioRecPath, "prev", true);
+ }
}
private void toolStripButton_next_Click(object sender, EventArgs e)
{
- this.LoadRecordOld(this.BiblioRecPath, "next", true);
+ if (Control.ModifierKeys == Keys.Control)
+ {
+ this.ClearMessage();
+ string strRecPath = GetPrevNextRecPath("next");
+ if (string.IsNullOrEmpty(strRecPath))
+ this.ShowMessage("无法移动", "yellow", true);
+ else
+ this.LoadRecordOld(strRecPath, "", true);
+ }
+ else
+ {
+ this.LoadRecordOld(this.BiblioRecPath, "next", true);
+ }
+ }
+
+ static string GetPrevNextRecPath(string strStyle)
+ {
+ BiblioSearchForm form = Program.MainForm.GetTopChildWindow();
+ if (form == null)
+ return "";
+ ListViewItem item = form.MoveSelectedItem(strStyle);
+ if (item == null)
+ return "";
+ return ListViewUtil.GetItemText(item, 0);
}
string m_strFocusedPart = "";
diff --git a/dp2Circulation/Issue/BindingControl.cs b/dp2Circulation/Issue/BindingControl.cs
index 17995d72f..addd90a6f 100644
--- a/dp2Circulation/Issue/BindingControl.cs
+++ b/dp2Circulation/Issue/BindingControl.cs
@@ -19,7 +19,6 @@
using DigitalPlatform.Text;
using DigitalPlatform.CommonControl;
-
namespace dp2Circulation
{
///
@@ -2250,13 +2249,13 @@ int SearchIssue(
}
// 如果多于一个,才用卷号来过滤
- if (issues.Count > 1 && String.IsNullOrEmpty(info.Volumn) == false)
+ if (issues.Count > 1 && String.IsNullOrEmpty(info.Volume) == false)
{
List temp = new List();
for (int i = 0; i < issues.Count; i++)
{
IssueBindingItem issue = issues[i];
- if (issue.Volume == info.Volumn)
+ if (issue.Volume == info.Volume)
temp.Add(issue);
}
@@ -6780,7 +6779,6 @@ void menuItem_newAllIssue_Click(object sender, EventArgs e)
"");
* */
-
// 插入到合适的位置?
InsertIssueToIssues(new_issue);
@@ -8370,6 +8368,16 @@ public static string NextPublishTime(string strPublishTime,
ref nPreferredDelta);
}
+ // 2016/1/6
+ // 获得一年的天数。2016 年为 366 天
+ static int GetDaysOfYear(string strYear)
+ {
+ DateTime start = DateTimeUtil.Long8ToDateTime(strYear + "0101");
+ string strNextYear = (Int32.Parse(strYear) + 1).ToString().PadLeft(4, '0');
+ DateTime end = DateTimeUtil.Long8ToDateTime(strNextYear + "0101");
+ return (int)((end - start).TotalDays);
+ }
+
// 预测下一期的出版时间
// exception:
// 可能因strPublishTime为不可能的日期而抛出异常
@@ -8383,6 +8391,9 @@ public static string NextPublishTime(string strPublishTime,
{
strPublishTime = CanonicalizeLong8TimeString(strPublishTime);
+ // 计算出一年有多少天。比如 2016 年就是 366 天而不是 365 天
+ int nDaysOfYear = GetDaysOfYear(strPublishTime.Substring(0, 4));
+
DateTime start = DateTimeUtil.Long8ToDateTime(strPublishTime);
int nCount = 0;
@@ -8562,7 +8573,7 @@ public static string NextPublishTime(string strPublishTime,
}
// 一年365期
- else if (nIssueCount > 183 && nIssueCount <= 365)
+ else if (nIssueCount > 183 && nIssueCount <= nDaysOfYear)
{
// 1天以后
start += new TimeSpan(1, 0, 0, 0);
@@ -15541,149 +15552,6 @@ private void timer_dragScroll_Tick(object sender, EventArgs e)
// this.mouseMoveArgs
this.OnMouseMove(e1);
}
-
-#if NO
- public int BuildVolumeStrings(string strText,
- out string strYear,
- out string strVolumn,
- out string strZong,
- out string strNo)
- {
- if (this.IsParent == false)
- {
- IssueBindingItem issue = this.Container;
- if (issue != null
- && String.IsNullOrEmpty(issue.PublishTime) == false)
- {
- string strVolumeString = VolumeInfo.BuildItemVolumeString(
- IssueUtil.GetYearPart(issue.PublishTime),
- issue.Issue,
- issue.Zong,
- issue.Volume);
- if (this.Volume != strVolumeString)
- {
- this.Volume = strVolumeString;
- return true;
- }
- }
-
- return false;
- }
-
- if (this.MemberCells.Count == 0)
- {
- if (this.Volume == "")
- return false;
- this.Volume = "";
- return true;
- }
-
- Hashtable no_list_table = new Hashtable();
- // List no_list = new List();
- List volumn_list = new List();
- List zong_list = new List();
-
- for (int i = 0; i < this.MemberCells.Count; i++)
- {
- Cell cell = this.MemberCells[i];
- if (cell == null)
- {
- Debug.Assert(false, "");
- continue;
- }
-
- if (cell.item == null)
- continue; // 跳过缺期
-
- IssueBindingItem issue = cell.Container;
- Debug.Assert(issue != null, "");
-
- string strNo = "";
- string strVolume = "";
- string strZong = "";
-
- if (cell.item != null
- && String.IsNullOrEmpty(cell.item.Volume) == false)
- {
- // 解析当年期号、总期号、卷号的字符串
- VolumeInfo.ParseItemVolumeString(cell.item.Volume,
- out strNo,
- out strZong,
- out strVolume);
- }
-
- // 实在不行,还是用期行的?
- if (String.IsNullOrEmpty(strNo) == true)
- {
- strNo = issue.Issue;
- Debug.Assert(String.IsNullOrEmpty(strNo) == false, "");
-
- strVolume = issue.Volume;
- strZong = issue.Zong;
- }
-
- Debug.Assert(String.IsNullOrEmpty(issue.PublishTime) == false, "");
- string strYear = IssueUtil.GetYearPart(issue.PublishTime);
-
- List no_list = (List)no_list_table[strYear];
- if (no_list == null)
- {
- no_list = new List();
- no_list_table[strYear] = no_list;
- }
-
- no_list.Add(strNo);
- volumn_list.Add(strVolume);
- zong_list.Add(strZong);
- }
-
- List keys = new List();
- foreach (string key in no_list_table.Keys)
- {
- keys.Add(key);
- }
- keys.Sort();
-
- string strNoString = "";
- for (int i = 0; i < keys.Count; i++)
- {
- string strYear = keys[i];
- List no_list = (List)no_list_table[strYear];
- Debug.Assert(no_list != null);
-
- if (String.IsNullOrEmpty(strNoString) == false)
- strNoString += ","; // ;
- strNoString += strYear + ",no." + Global.BuildNumberRangeString(no_list); // :no
- }
-
- string strVolumnString = Global.BuildNumberRangeString(volumn_list);
- string strZongString = Global.BuildNumberRangeString(zong_list);
-
- string strValue = strNoString;
-
-
- if (String.IsNullOrEmpty(strZongString) == false)
- {
- if (String.IsNullOrEmpty(strValue) == false)
- strValue += "=";
- strValue += "总." + strZongString;
- }
-
- if (String.IsNullOrEmpty(strVolumnString) == false)
- {
- if (String.IsNullOrEmpty(strValue) == false)
- strValue += "=";
- strValue += "v." + strVolumnString;
- }
-
- if (this.Volume == strValue)
- return false;
-
- this.Volume = strValue;
- return true;
- }
-
-#endif
}
// 点击检测结果
diff --git a/dp2Circulation/Issue/BindingControlItems.cs b/dp2Circulation/Issue/BindingControlItems.cs
index 0133797e3..958780bb4 100644
--- a/dp2Circulation/Issue/BindingControlItems.cs
+++ b/dp2Circulation/Issue/BindingControlItems.cs
@@ -6442,14 +6442,14 @@ public bool RefreshVolumeString()
if (issue != null
&& String.IsNullOrEmpty(issue.PublishTime) == false)
{
- string strVolumeString = VolumeInfo.BuildItemVolumeString(
+ string strTempVolumeString = VolumeInfo.BuildItemVolumeString(
IssueUtil.GetYearPart(issue.PublishTime),
issue.Issue,
issue.Zong,
issue.Volume);
- if (this.Volume != strVolumeString)
+ if (this.Volume != strTempVolumeString)
{
- this.Volume = strVolumeString;
+ this.Volume = strTempVolumeString;
return true;
}
}
@@ -6467,7 +6467,7 @@ public bool RefreshVolumeString()
Hashtable no_list_table = new Hashtable();
// List no_list = new List();
- List volumn_list = new List();
+ List volume_list = new List();
List zong_list = new List();
for (int i = 0; i < this.MemberCells.Count; i++)
@@ -6520,7 +6520,7 @@ public bool RefreshVolumeString()
}
no_list.Add(strNo);
- volumn_list.Add(strVolume);
+ volume_list.Add(strVolume);
zong_list.Add(strZong);
}
@@ -6543,7 +6543,7 @@ public bool RefreshVolumeString()
strNoString += strYear + ",no." + Global.BuildNumberRangeString(no_list); // :no
}
- string strVolumnString = Global.BuildNumberRangeString(volumn_list);
+ string strVolumeListString = Global.BuildNumberRangeString(volume_list);
string strZongString = Global.BuildNumberRangeString(zong_list);
string strValue = strNoString;
@@ -6556,11 +6556,11 @@ public bool RefreshVolumeString()
strValue += "总." + strZongString;
}
- if (String.IsNullOrEmpty(strVolumnString) == false)
+ if (String.IsNullOrEmpty(strVolumeListString) == false)
{
if (String.IsNullOrEmpty(strValue) == false)
strValue += "=";
- strValue += "v." + strVolumnString;
+ strValue += "v." + strVolumeListString;
}
if (this.Volume == strValue)
@@ -6818,7 +6818,8 @@ public string GetText(string strName)
return this.BookType;
case "price":
return this.Price;
- case "volumn":
+ case "volumn": // 兼容以前的拼写错误
+ case "volume":
return this.Volume;
case "comment":
return this.Comment;
diff --git a/dp2Circulation/Issue/CellLineDialog.Designer.cs b/dp2Circulation/Issue/CellLineDialog.Designer.cs
index 7f0c9c68f..cb8c2b361 100644
--- a/dp2Circulation/Issue/CellLineDialog.Designer.cs
+++ b/dp2Circulation/Issue/CellLineDialog.Designer.cs
@@ -96,7 +96,7 @@ private void InitializeComponent()
"accessNo -- ȡ",
"bookType -- ",
"price -- ۸",
- "volumn -- ں",
+ "volume -- ں",
"comment -- ע",
"batchNo -- κ",
"binding -- ϶Ϣ",
diff --git a/dp2Circulation/Issue/IssueControl.cs b/dp2Circulation/Issue/IssueControl.cs
index 8e4f6c9d5..4d6b03abb 100644
--- a/dp2Circulation/Issue/IssueControl.cs
+++ b/dp2Circulation/Issue/IssueControl.cs
@@ -581,7 +581,7 @@ void DoNewIssue(/*string strPublishTime*/)
edit.BiblioDbName = Global.GetDbName(this.BiblioRecPath); // 2009/2/15
edit.Text = "新增期";
edit.MainForm = this.MainForm;
- // edit.EntityForm = this;
+ // edit.EntityForm = this; // ???
nRet = edit.InitialForEdit(issueitem,
this.Items,
out strError);
diff --git a/dp2Circulation/Issue/PrintBindingForm.cs b/dp2Circulation/Issue/PrintBindingForm.cs
index 0fb3ed41d..3d184e508 100644
--- a/dp2Circulation/Issue/PrintBindingForm.cs
+++ b/dp2Circulation/Issue/PrintBindingForm.cs
@@ -2578,7 +2578,7 @@ int BuildPageBottom(PrintOption option,
/*public*/ static string BuildVolumeRangeString(List volumes)
{
Hashtable no_list_table = new Hashtable();
- List volumn_list = new List();
+ List volume_list = new List();
List zong_list = new List();
for(int i=0;i notdef_segments = new List();
@@ -197,7 +183,7 @@ public static int BuildVolumeInfos(string strText,
else if (strSegment.IndexOf("no.") != -1)
strNoString = strSegment;
else if (strSegment.IndexOf("v.") != -1)
- strVolumnString = strSegment;
+ strVolumeString = strSegment;
else if (strSegment.IndexOf("总.") != -1)
strZongString = strSegment;
else
@@ -209,7 +195,7 @@ public static int BuildVolumeInfos(string strText,
// 2012/4/25
// 当年期号序列很重要,如果缺了,光有总期号和卷号是不行的
if (string.IsNullOrEmpty(strNoString) == true
- && (string.IsNullOrEmpty(strZongString) == false || string.IsNullOrEmpty(strVolumnString) == false))
+ && (string.IsNullOrEmpty(strZongString) == false || string.IsNullOrEmpty(strVolumeString) == false))
{
strError = "当年期号序列不能省却。'" + strText + "'";
if (notdef_segments.Count > 0)
@@ -268,22 +254,22 @@ public static int BuildVolumeInfos(string strText,
}
// 去掉"v."部分
- if (StringUtil.HasHead(strVolumnString, "v.") == true)
+ if (StringUtil.HasHead(strVolumeString, "v.") == true)
{
- strVolumnString = strVolumnString.Substring(2).Trim();
+ strVolumeString = strVolumeString.Substring(2).Trim();
}
- if (String.IsNullOrEmpty(strVolumnString) == false)
+ if (String.IsNullOrEmpty(strVolumeString) == false)
{
List volumes = null;
try
{
- volumes = ExpandSequence(strVolumnString);
+ volumes = ExpandSequence(strVolumeString);
}
catch (Exception ex)
{
- strError = "v.序列 '" + strVolumnString + "' 格式错误:" + ex.Message;
+ strError = "v.序列 '" + strVolumeString + "' 格式错误:" + ex.Message;
return -1;
}
@@ -293,11 +279,11 @@ public static int BuildVolumeInfos(string strText,
VolumeInfo info = infos[i];
if (i < volumes.Count)
{
- info.Volumn = volumes[i];
- strLastValue = info.Volumn; // 记忆最后一个
+ info.Volume = volumes[i];
+ strLastValue = info.Volume; // 记忆最后一个
}
else
- info.Volumn = strLastValue; // 沿用最后一个
+ info.Volume = strLastValue; // 沿用最后一个
}
}
@@ -316,7 +302,7 @@ public static int BuildVolumeInfos(string strText,
public static List ExpandSequence(string strText)
{
List results = new List();
- string[] parts = strText.Split(new char[] { ',',',' });
+ string[] parts = strText.Split(new char[] { ',', ',' });
for (int i = 0; i < parts.Length; i++)
{
string strPart = parts[i];
@@ -376,7 +362,7 @@ public static void ParseItemVolumeString(string strVolumeString,
strZong = "";
strVolume = "";
- string[] segments = strVolumeString.Split(new char[] { ';', ',', '=',';',',','=' }); // ',','='为2010/2/24新增
+ string[] segments = strVolumeString.Split(new char[] { ';', ',', '=', ';', ',', '=' }); // ',','='为2010/2/24新增
for (int i = 0; i < segments.Length; i++)
{
string strSegment = segments[i].Trim();
@@ -397,7 +383,7 @@ public static int CheckIssueNo(
{
strError = "";
- if (strIssueNo.IndexOfAny(new char[] {'-','*',',',';','=','?','-','*',',',';','=','?' }) != -1)
+ if (strIssueNo.IndexOfAny(new char[] { '-', '*', ',', ';', '=', '?', '-', '*', ',', ';', '=', '?' }) != -1)
{
strError = strName + "字符串中不能包含下列字符: '-','*',',',';','=','?'";
return -1;
diff --git a/dp2Circulation/ItemInfoForm/ItemInfoForm.Designer.cs b/dp2Circulation/ItemInfoForm/ItemInfoForm.Designer.cs
index aba740f77..42ace94b1 100644
--- a/dp2Circulation/ItemInfoForm/ItemInfoForm.Designer.cs
+++ b/dp2Circulation/ItemInfoForm/ItemInfoForm.Designer.cs
@@ -45,6 +45,8 @@ private void InitializeComponent()
this.toolStripButton_prevRecord = new System.Windows.Forms.ToolStripButton();
this.toolStripLabel_message = new System.Windows.Forms.ToolStripLabel();
this.toolStripButton_addSubject = new System.Windows.Forms.ToolStripButton();
+ this.tabPage_borrowHistory = new System.Windows.Forms.TabPage();
+ this.webBrowser_borrowHistory = new System.Windows.Forms.WebBrowser();
((System.ComponentModel.ISupportInitialize)(this.splitContainer_main)).BeginInit();
this.splitContainer_main.Panel1.SuspendLayout();
this.splitContainer_main.Panel2.SuspendLayout();
@@ -53,6 +55,7 @@ private void InitializeComponent()
this.tabPage_html.SuspendLayout();
this.tabPage_xml.SuspendLayout();
this.toolStrip1.SuspendLayout();
+ this.tabPage_borrowHistory.SuspendLayout();
this.SuspendLayout();
//
// splitContainer_main
@@ -70,8 +73,8 @@ private void InitializeComponent()
// splitContainer_main.Panel2
//
this.splitContainer_main.Panel2.Controls.Add(this.webBrowser_biblio);
- this.splitContainer_main.Size = new System.Drawing.Size(437, 258);
- this.splitContainer_main.SplitterDistance = 160;
+ this.splitContainer_main.Size = new System.Drawing.Size(513, 258);
+ this.splitContainer_main.SplitterDistance = 187;
this.splitContainer_main.SplitterWidth = 6;
this.splitContainer_main.TabIndex = 0;
//
@@ -79,6 +82,7 @@ private void InitializeComponent()
//
this.tabControl_item.Appearance = System.Windows.Forms.TabAppearance.FlatButtons;
this.tabControl_item.Controls.Add(this.tabPage_html);
+ this.tabControl_item.Controls.Add(this.tabPage_borrowHistory);
this.tabControl_item.Controls.Add(this.tabPage_xml);
this.tabControl_item.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl_item.Location = new System.Drawing.Point(0, 0);
@@ -86,8 +90,9 @@ private void InitializeComponent()
this.tabControl_item.Name = "tabControl_item";
this.tabControl_item.Padding = new System.Drawing.Point(0, 0);
this.tabControl_item.SelectedIndex = 0;
- this.tabControl_item.Size = new System.Drawing.Size(160, 258);
+ this.tabControl_item.Size = new System.Drawing.Size(187, 258);
this.tabControl_item.TabIndex = 1;
+ this.tabControl_item.SelectedIndexChanged += new System.EventHandler(this.tabControl_item_SelectedIndexChanged);
//
// tabPage_html
//
@@ -95,9 +100,9 @@ private void InitializeComponent()
this.tabPage_html.Location = new System.Drawing.Point(4, 25);
this.tabPage_html.Margin = new System.Windows.Forms.Padding(0);
this.tabPage_html.Name = "tabPage_html";
- this.tabPage_html.Size = new System.Drawing.Size(152, 229);
+ this.tabPage_html.Size = new System.Drawing.Size(179, 229);
this.tabPage_html.TabIndex = 0;
- this.tabPage_html.Text = "HTML";
+ this.tabPage_html.Text = "";
this.tabPage_html.UseVisualStyleBackColor = true;
//
// webBrowser_itemHTML
@@ -106,7 +111,7 @@ private void InitializeComponent()
this.webBrowser_itemHTML.Location = new System.Drawing.Point(0, 0);
this.webBrowser_itemHTML.MinimumSize = new System.Drawing.Size(20, 20);
this.webBrowser_itemHTML.Name = "webBrowser_itemHTML";
- this.webBrowser_itemHTML.Size = new System.Drawing.Size(152, 229);
+ this.webBrowser_itemHTML.Size = new System.Drawing.Size(179, 229);
this.webBrowser_itemHTML.TabIndex = 0;
//
// tabPage_xml
@@ -127,7 +132,7 @@ private void InitializeComponent()
this.webBrowser_itemXml.Margin = new System.Windows.Forms.Padding(2);
this.webBrowser_itemXml.MinimumSize = new System.Drawing.Size(15, 16);
this.webBrowser_itemXml.Name = "webBrowser_itemXml";
- this.webBrowser_itemXml.Size = new System.Drawing.Size(154, 235);
+ this.webBrowser_itemXml.Size = new System.Drawing.Size(152, 229);
this.webBrowser_itemXml.TabIndex = 0;
//
// webBrowser_biblio
@@ -136,7 +141,7 @@ private void InitializeComponent()
this.webBrowser_biblio.Location = new System.Drawing.Point(0, 0);
this.webBrowser_biblio.MinimumSize = new System.Drawing.Size(20, 20);
this.webBrowser_biblio.Name = "webBrowser_biblio";
- this.webBrowser_biblio.Size = new System.Drawing.Size(271, 258);
+ this.webBrowser_biblio.Size = new System.Drawing.Size(320, 258);
this.webBrowser_biblio.TabIndex = 0;
//
// label1
@@ -170,13 +175,13 @@ private void InitializeComponent()
this.textBox_queryWord.Location = new System.Drawing.Point(166, 10);
this.textBox_queryWord.Margin = new System.Windows.Forms.Padding(2);
this.textBox_queryWord.Name = "textBox_queryWord";
- this.textBox_queryWord.Size = new System.Drawing.Size(204, 21);
+ this.textBox_queryWord.Size = new System.Drawing.Size(280, 21);
this.textBox_queryWord.TabIndex = 4;
//
// button_load
//
this.button_load.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button_load.Location = new System.Drawing.Point(374, 10);
+ this.button_load.Location = new System.Drawing.Point(450, 10);
this.button_load.Margin = new System.Windows.Forms.Padding(2);
this.button_load.Name = "button_load";
this.button_load.Size = new System.Drawing.Size(63, 22);
@@ -198,7 +203,7 @@ private void InitializeComponent()
this.toolStripButton_addSubject});
this.toolStrip1.Location = new System.Drawing.Point(0, 298);
this.toolStrip1.Name = "toolStrip1";
- this.toolStrip1.Size = new System.Drawing.Size(437, 20);
+ this.toolStrip1.Size = new System.Drawing.Size(513, 20);
this.toolStrip1.TabIndex = 6;
this.toolStrip1.Text = "toolStrip1";
//
@@ -241,12 +246,31 @@ private void InitializeComponent()
this.toolStripButton_addSubject.Visible = false;
this.toolStripButton_addSubject.Click += new System.EventHandler(this.toolStripButton_addSubject_Click);
//
+ // tabPage_borrowHistory
+ //
+ this.tabPage_borrowHistory.Controls.Add(this.webBrowser_borrowHistory);
+ this.tabPage_borrowHistory.Location = new System.Drawing.Point(4, 25);
+ this.tabPage_borrowHistory.Name = "tabPage_borrowHistory";
+ this.tabPage_borrowHistory.Size = new System.Drawing.Size(179, 229);
+ this.tabPage_borrowHistory.TabIndex = 2;
+ this.tabPage_borrowHistory.Text = "ʷ";
+ this.tabPage_borrowHistory.UseVisualStyleBackColor = true;
+ //
+ // webBrowser_borrowHistory
+ //
+ this.webBrowser_borrowHistory.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.webBrowser_borrowHistory.Location = new System.Drawing.Point(0, 0);
+ this.webBrowser_borrowHistory.MinimumSize = new System.Drawing.Size(20, 20);
+ this.webBrowser_borrowHistory.Name = "webBrowser_borrowHistory";
+ this.webBrowser_borrowHistory.Size = new System.Drawing.Size(179, 229);
+ this.webBrowser_borrowHistory.TabIndex = 0;
+ //
// ItemInfoForm
//
this.AcceptButton = this.button_load;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(437, 326);
+ this.ClientSize = new System.Drawing.Size(513, 326);
this.Controls.Add(this.toolStrip1);
this.Controls.Add(this.button_load);
this.Controls.Add(this.textBox_queryWord);
@@ -270,6 +294,7 @@ private void InitializeComponent()
this.tabPage_xml.ResumeLayout(false);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
+ this.tabPage_borrowHistory.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@@ -293,5 +318,7 @@ private void InitializeComponent()
private System.Windows.Forms.ToolStripButton toolStripButton_nextRecord;
private System.Windows.Forms.ToolStripLabel toolStripLabel_message;
private System.Windows.Forms.ToolStripButton toolStripButton_addSubject;
+ private System.Windows.Forms.TabPage tabPage_borrowHistory;
+ private System.Windows.Forms.WebBrowser webBrowser_borrowHistory;
}
}
\ No newline at end of file
diff --git a/dp2Circulation/ItemInfoForm/ItemInfoForm.cs b/dp2Circulation/ItemInfoForm/ItemInfoForm.cs
index 1ee2d5f44..7af225aa7 100644
--- a/dp2Circulation/ItemInfoForm/ItemInfoForm.cs
+++ b/dp2Circulation/ItemInfoForm/ItemInfoForm.cs
@@ -70,6 +70,7 @@ public string DbType
Commander commander = null;
WebExternalHost m_webExternalHost_item = new WebExternalHost();
+ WebExternalHost m_chargingInterface = new WebExternalHost();
WebExternalHost m_webExternalHost_biblio = new WebExternalHost();
#if NO
@@ -114,6 +115,10 @@ private void ItemInfoForm_Load(object sender, EventArgs e)
this.m_webExternalHost_item.Initial(this.MainForm, this.webBrowser_itemHTML);
this.webBrowser_itemHTML.ObjectForScripting = this.m_webExternalHost_item;
+ this.m_chargingInterface.Initial(this.MainForm, this.webBrowser_borrowHistory);
+ this.m_chargingInterface.CallFunc += m_chargingInterface_CallFunc;
+ this.webBrowser_borrowHistory.ObjectForScripting = this.m_chargingInterface;
+
this.m_webExternalHost_biblio.Initial(this.MainForm, this.webBrowser_biblio);
this.webBrowser_biblio.ObjectForScripting = this.m_webExternalHost_biblio;
@@ -122,6 +127,8 @@ private void ItemInfoForm_Load(object sender, EventArgs e)
this.commander.IsBusy += new IsBusyEventHandler(commander_IsBusy);
this.Text = this.DbTypeCaption;
+
+ ClearBorrowHistoryPage();
}
void commander_IsBusy(object sender, IsBusyEventArgs e)
@@ -153,7 +160,8 @@ private void ItemInfoForm_FormClosed(object sender, FormClosedEventArgs e)
this.m_webExternalHost_item.Destroy();
if (this.m_webExternalHost_biblio != null)
this.m_webExternalHost_biblio.Destroy();
-
+ if (this.m_chargingInterface != null)
+ this.m_chargingInterface.Destroy();
#if NO
if (stop != null) // 脱离关联
{
@@ -206,26 +214,23 @@ public int LoadRecord(string strItemBarcode)
EnableControls(false);
stop.OnStop += new StopEventHandler(this.DoStop);
- stop.Initial("正在初始化浏览器组件 ...");
+ stop.Initial("正在装载册信息 ...");
stop.BeginLoop();
-
- this.Update();
- this.MainForm.Update();
-
-
Global.ClearHtmlPage(this.webBrowser_itemHTML,
this.MainForm.DataDir);
Global.ClearHtmlPage(this.webBrowser_itemXml,
this.MainForm.DataDir);
Global.ClearHtmlPage(this.webBrowser_biblio,
this.MainForm.DataDir);
+
+ ClearBorrowHistoryPage();
+ SetItemRefID("");
+
// this.textBox_message.Text = "";
this.toolStripLabel_message.Text = "";
stop.SetMessage("正在装入册记录 " + strItemBarcode + " ...");
-
-
try
{
string strItemText = "";
@@ -321,6 +326,8 @@ public int LoadRecord(string strItemBarcode)
this.MainForm.DataDir,
"xml",
strItemText);
+
+ SetItemRefID(strItemText);
}
}
finally
@@ -335,6 +342,7 @@ public int LoadRecord(string strItemBarcode)
this.textBox_queryWord.Focus();
}
+ tabControl_item_SelectedIndexChanged(this, new EventArgs());
return 1;
ERROR1:
MessageBox.Show(this, strError);
@@ -401,13 +409,15 @@ public int LoadRecordByRecPath(string strItemRecPath,
this.MainForm.DataDir);
Global.ClearHtmlPage(this.webBrowser_biblio,
this.MainForm.DataDir);
+
// this.textBox_message.Text = "";
this.toolStripLabel_message.Text = "";
}
- stop.SetMessage("正在装入"+this.DbTypeCaption+"记录 " + strItemRecPath + " ...");
-
+ ClearBorrowHistoryPage();
+ SetItemRefID("");
+ stop.SetMessage("正在装入" + this.DbTypeCaption + "记录 " + strItemRecPath + " ...");
try
{
string strItemText = "";
@@ -421,24 +431,24 @@ public int LoadRecordByRecPath(string strItemRecPath,
string strBarcode = "@path:" + strRecPath;
long lRet = 0;
-
+
if (this.m_strDbType == "item")
- lRet = Channel.GetItemInfo(
- stop,
- strBarcode,
- "html",
- out strItemText,
- out strOutputItemRecPath,
- out item_timestamp,
- "html",
- out strBiblioText,
- out strBiblioRecPath,
- out strError);
+ lRet = Channel.GetItemInfo(
+ stop,
+ strBarcode,
+ "html",
+ out strItemText,
+ out strOutputItemRecPath,
+ out item_timestamp,
+ "html",
+ out strBiblioText,
+ out strBiblioRecPath,
+ out strError);
else if (this.m_strDbType == "comment")
lRet = Channel.GetCommentInfo(
stop,
strBarcode, // "@path:" + strItemRecPath,
- // "",
+ // "",
"html",
out strItemText,
out strOutputItemRecPath,
@@ -451,7 +461,7 @@ public int LoadRecordByRecPath(string strItemRecPath,
lRet = Channel.GetOrderInfo(
stop,
strBarcode, // "@path:" + strItemRecPath,
- // "",
+ // "",
"html",
out strItemText,
out strOutputItemRecPath,
@@ -464,7 +474,7 @@ public int LoadRecordByRecPath(string strItemRecPath,
lRet = Channel.GetIssueInfo(
stop,
strBarcode, // "@path:" + strItemRecPath,
- // "",
+ // "",
"html",
out strItemText,
out strOutputItemRecPath,
@@ -476,11 +486,8 @@ public int LoadRecordByRecPath(string strItemRecPath,
else
throw new Exception("未知的DbType '" + this.m_strDbType + "'");
-
if (lRet == -1 || lRet == 0)
{
-
-
if (bPrevNext == true
&& this.Channel.ErrorCode == DigitalPlatform.LibraryClient.localhost.ErrorCode.NotFound)
{
@@ -532,28 +539,28 @@ public int LoadRecordByRecPath(string strItemRecPath,
}
// this.textBox_message.Text = "册记录路径: " + strOutputItemRecPath + " ;其从属的种(书目)记录路径: " + strBiblioRecPath;
- this.toolStripLabel_message.Text = this.DbTypeCaption+"记录路径: " + strOutputItemRecPath + " ;其从属的种(书目)记录路径: " + strBiblioRecPath;
+ this.toolStripLabel_message.Text = this.DbTypeCaption + "记录路径: " + strOutputItemRecPath + " ;其从属的种(书目)记录路径: " + strBiblioRecPath;
this.textBox_queryWord.Text = this.ItemRecPath; // strItemRecPath;
- this.comboBox_from.Text = this.DbTypeCaption+"记录路径";
+ this.comboBox_from.Text = this.DbTypeCaption + "记录路径";
// 最后获得item xml
if (this.m_strDbType == "item")
- lRet = Channel.GetItemInfo(
- stop,
- "@path:" + strOutputItemRecPath, // strBarcode,
- "xml",
- out strItemText,
- out strItemRecPath,
- out item_timestamp,
- null, // "html",
- out strBiblioText,
- out strBiblioRecPath,
- out strError);
+ lRet = Channel.GetItemInfo(
+ stop,
+ "@path:" + strOutputItemRecPath, // strBarcode,
+ "xml",
+ out strItemText,
+ out strItemRecPath,
+ out item_timestamp,
+ null, // "html",
+ out strBiblioText,
+ out strBiblioRecPath,
+ out strError);
else if (this.m_strDbType == "comment")
lRet = Channel.GetCommentInfo(
stop,
"@path:" + strOutputItemRecPath,
- // "",
+ // "",
"xml",
out strItemText,
out strOutputItemRecPath,
@@ -566,7 +573,7 @@ public int LoadRecordByRecPath(string strItemRecPath,
lRet = Channel.GetOrderInfo(
stop,
"@path:" + strOutputItemRecPath,
- // "",
+ // "",
"xml",
out strItemText,
out strOutputItemRecPath,
@@ -579,7 +586,7 @@ public int LoadRecordByRecPath(string strItemRecPath,
lRet = Channel.GetIssueInfo(
stop,
"@path:" + strOutputItemRecPath,
- // "",
+ // "",
"xml",
out strItemText,
out strOutputItemRecPath,
@@ -591,7 +598,6 @@ public int LoadRecordByRecPath(string strItemRecPath,
else
throw new Exception("未知的DbType '" + this.m_strDbType + "'");
-
if (lRet == -1 || lRet == 0)
{
Global.SetHtmlString(this.webBrowser_itemXml,
@@ -609,6 +615,8 @@ public int LoadRecordByRecPath(string strItemRecPath,
this.MainForm.DataDir,
"xml",
strItemText);
+
+ SetItemRefID(strItemText);
}
}
finally
@@ -620,12 +628,37 @@ public int LoadRecordByRecPath(string strItemRecPath,
EnableControls(true);
}
+ tabControl_item_SelectedIndexChanged(this, new EventArgs());
return 1;
ERROR1:
MessageBox.Show(this, strError);
return -1;
}
+ string _itemBarcode = "";
+ string _refID = "";
+
+ // 设置当前记录的唯一标识
+ void SetItemRefID(string strXml)
+ {
+ _itemBarcode = "";
+ _refID = "";
+
+ if (string.IsNullOrEmpty(strXml) == true)
+ return; // 起到清除的作用
+
+ XmlDocument dom = new XmlDocument();
+ try
+ {
+ dom.LoadXml(strXml);
+ _itemBarcode = DomUtil.GetElementText(dom.DocumentElement, "barcode");
+ _refID = DomUtil.GetElementText(dom.DocumentElement, "refID");
+ }
+ catch
+ {
+
+ }
+ }
#if NO
void DoStop(object sender, StopEventArgs e)
{
@@ -774,7 +807,7 @@ private void DoLoadRecord()
int nRet = this.textBox_queryWord.Text.IndexOf("/");
if (nRet == -1)
{
- strError = "您输入的检索词似乎为一个册条码号,而不是"+this.DbTypeCaption+"记录路径";
+ strError = "您输入的检索词似乎为一个册条码号,而不是" + this.DbTypeCaption + "记录路径";
MessageBox.Show(this, strError);
}
@@ -1425,7 +1458,7 @@ int GetExistSubject(
out string strBiblioXml,
out List reserve_subjects,
out List subjects,
- out byte [] timestamp,
+ out byte[] timestamp,
out string strError)
{
strError = "";
@@ -1531,5 +1564,326 @@ public static int GetSubjectInfo(string strMARC,
return 0;
}
+
+ void m_chargingInterface_CallFunc(object sender, EventArgs e)
+ {
+ if (this.DbType != "item")
+ return;
+
+ string name = sender as string;
+ this.BeginInvoke(new Action(LoadBorrowHistory), name);
+ }
+
+ void LoadBorrowHistory(string action)
+ {
+ string strError = "";
+ int nPageNo = 0;
+ if (action == "load")
+ nPageNo = 0;
+ else if (action == "loadAll")
+ nPageNo = -1;
+ else if (action == "prevPage")
+ {
+ nPageNo = _currentPageNo - 1;
+ if (nPageNo < 0)
+ {
+ strError = "已经到头";
+ goto ERROR1;
+ }
+ }
+ else if (action == "nextPage")
+ {
+ nPageNo = _currentPageNo + 1;
+ if (nPageNo > _pageCount - 1)
+ {
+ strError = "已经到尾";
+ goto ERROR1;
+ }
+ }
+ else if (action == "firstPage")
+ nPageNo = 0;
+ else if (action == "tailPage")
+ {
+ if (_pageCount <= 0)
+ {
+ strError = "没有尾页";
+ goto ERROR1;
+ }
+ nPageNo = _pageCount - 1;
+ }
+
+ string strItemRefID = GetItemRefID();
+
+ if (string.IsNullOrEmpty(strItemRefID) == true)
+ {
+ strError = "strItemRefID 为空";
+ goto ERROR1;
+ }
+
+ int nRet = LoadBorrowHistory(strItemRefID,
+ nPageNo,
+ out strError);
+ if (nRet == -1)
+ goto ERROR1;
+ return;
+ ERROR1:
+ this.ShowMessage(strError, "red", true);
+ }
+
+ string GetItemRefID()
+ {
+ if (string.IsNullOrEmpty(this._itemBarcode) == false)
+ return "@itemBarcode:" + this._itemBarcode;
+ return "@itemRefID:" + this._refID;
+ }
+
+ static int _itemsPerPage = 10;
+
+ // parameters:
+ // nPageNo 页号。如果为 -1,表示希望从头获取全部内容
+ int LoadBorrowHistory(
+ string strBarcode,
+ int nPageNo,
+ out string strError)
+ {
+ strError = "";
+
+ stop.OnStop += new StopEventHandler(this.DoStop);
+ stop.Initial("正在装载借阅历史 ...");
+ stop.BeginLoop();
+
+ EnableControls(false);
+ try
+ {
+ long lRet = 0;
+ List total_results = new List();
+
+ int nLength = 0;
+ if (nPageNo == -1)
+ {
+ nPageNo = 0;
+ nLength = -1;
+ }
+ else
+ {
+ nLength = _itemsPerPage;
+ }
+
+ this.Channel.Idle += Channel_Idle; // 防止控制权出让给正在获取摘要的读者信息 HTML 页面
+ try
+ {
+ lRet = this.Channel.LoadChargingHistory(stop,
+ strBarcode,
+ "return,lost,read",
+ nPageNo,
+ nLength,
+ out total_results,
+ out strError);
+ if (lRet == -1)
+ return -1;
+
+ _currentPageNo = nPageNo;
+ }
+ finally
+ {
+ this.Channel.Idle -= Channel_Idle;
+ }
+
+ FillBorrowHistoryPage(total_results, nPageNo * _itemsPerPage, (int)lRet);
+ return 0;
+ }
+ finally
+ {
+ EnableControls(true);
+
+ stop.EndLoop();
+ stop.OnStop -= new StopEventHandler(this.DoStop);
+ stop.Initial("");
+ }
+ }
+
+ void Channel_Idle(object sender, IdleEventArgs e)
+ {
+ e.bDoEvents = false;
+ }
+
+ void ClearBorrowHistoryPage()
+ {
+ ClearHtml();
+
+ string strItemLink = "" + HttpUtility.HtmlEncode("装载") + "";
+
+ AppendHtml("");
+ AppendHtml(strItemLink);
+ AppendHtml("");
+
+ _borrowHistoryLoaded = false;
+ }
+
+ int _currentPageNo = 0;
+ int _pageCount = 0;
+
+ static string MakeAnchor(string name, string caption, bool enabled)
+ {
+ if (enabled)
+ return "" + HttpUtility.HtmlEncode(caption) + "";
+ return HttpUtility.HtmlEncode(caption);
+ }
+
+ void FillBorrowHistoryPage(List items,
+ int nStart,
+ int nTotalCount)
+ {
+ this.ClearMessage();
+
+ StringBuilder text = new StringBuilder();
+
+ _currentPageNo = nStart / _itemsPerPage;
+ _pageCount = nTotalCount / _itemsPerPage;
+ if ((nTotalCount % _itemsPerPage) > 0)
+ _pageCount++;
+
+ string strBinDir = Environment.CurrentDirectory;
+
+ string strCssUrl = Path.Combine(this.MainForm.DataDir, "default\\charginghistory.css");
+ string strSummaryJs = Path.Combine(this.MainForm.DataDir, "getsummary.js");
+ string strLink = "";
+ string strScriptHead = ""
+ + ""
+ + "";
+ string strStyle = @"";
+
+ text.Append(""
+ + strLink
+ + strScriptHead.Replace("%bindir%", strBinDir)
+ + strStyle
+ + "");
+
+ string strFirstPageLink = MakeAnchor("firstPage", "首页", _currentPageNo > 0);
+ string strPrevPageLink = MakeAnchor("prevPage", "前页", _currentPageNo > 0);
+ string strNextPageLink = MakeAnchor("nextPage", "后页", _currentPageNo < _pageCount - 1);
+ string strTailPageLink = MakeAnchor("tailPage", "末页", _currentPageNo != _pageCount - 1 && _pageCount > 0);
+ string strLoadAllLink = MakeAnchor("loadAll", "装载全部", _pageCount > 1);
+
+ string strPages = (_currentPageNo + 1) + "/" + _pageCount + " ";
+ if (items.Count > _itemsPerPage)
+ strPages = "(全部)";
+
+ text.Append(strPages
+ + strFirstPageLink + " " + strPrevPageLink + " " + strNextPageLink + " " + strTailPageLink + " "
+ + strLoadAllLink);
+
+ text.Append("");
+ text.Append("");
+ text.Append("序号 | ");
+ text.Append("类型 | ");
+ text.Append("证条码号 | ");
+ text.Append("姓名 | ");
+ text.Append("期限 | ");
+ text.Append("借阅操作者 | ");
+ text.Append("借阅操作时间 | ");
+ text.Append("还回操作者 | ");
+ text.Append("还回操作时间 | ");
+ text.Append(" ");
+
+ foreach (ChargingItemWrapper wrapper in items)
+ {
+ ChargingItem item = wrapper.Item;
+ text.Append("");
+ text.Append("" + (nStart + 1).ToString() + " | ");
+ text.Append("" + HttpUtility.HtmlEncode(ReaderInfoForm.GetOperTypeName(item.Action)) + " | ");
+
+ text.Append("" + HttpUtility.HtmlEncode(item.PatronBarcode) + " | ");
+ text.Append("P:" + HttpUtility.HtmlEncode(item.PatronBarcode) + " | ");
+
+ string strPeriod = "";
+ if (wrapper.RelatedItem != null)
+ strPeriod = wrapper.RelatedItem.Period;
+ text.Append("" + HttpUtility.HtmlEncode(strPeriod) + " | ");
+
+ string strBorrowOperator = "";
+ string strBorrowTime = "";
+ if (wrapper.RelatedItem != null)
+ {
+ strBorrowOperator = wrapper.RelatedItem.Operator;
+ strBorrowTime = wrapper.RelatedItem.OperTime;
+ }
+
+ text.Append("" + HttpUtility.HtmlEncode(strBorrowOperator) + " | ");
+ text.Append("" + HttpUtility.HtmlEncode(strBorrowTime) + " | ");
+
+ text.Append("" + HttpUtility.HtmlEncode(item.Operator) + " | ");
+ text.Append("" + HttpUtility.HtmlEncode(item.OperTime) + " | ");
+
+ text.Append(" ");
+ nStart++;
+ }
+ text.Append(" ");
+ text.Append("
|