Skip to content

Commit

Permalink
Merge pull request #4 from DigitalPlatform/master
Browse files Browse the repository at this point in the history
同步源
  • Loading branch information
renyh1013 committed Dec 31, 2015
2 parents da2214a + 0c8304f commit 63593cc
Show file tree
Hide file tree
Showing 155 changed files with 5,464 additions and 2,179 deletions.
2 changes: 1 addition & 1 deletion DigitalPlatform.CirculationClient/dp2ResTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ int GetDbNames(
}
#endif

string version = "0";
string version = "0.0";
// return:
// -1 error
// 0 dp2Library的版本号过低。警告信息在strError中
Expand Down
1 change: 0 additions & 1 deletion DigitalPlatform.CommonControl/BinaryEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

using System.Runtime.InteropServices;


using DigitalPlatform;
using DigitalPlatform.GUI;

Expand Down
1 change: 0 additions & 1 deletion DigitalPlatform.CommonControl/CaptionEditControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Xml;
using System.Diagnostics;


using DigitalPlatform.Xml;

namespace DigitalPlatform.CommonControl
Expand Down
34 changes: 16 additions & 18 deletions DigitalPlatform.CommonControl/DateRangeControl.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
Expand Down Expand Up @@ -117,7 +117,7 @@ void SetStartEnd(string strValue)
{
strStart = strValue;
if (strStart.Length != 8)
throw new Exception("时间范围 '"+strValue+"' 格式不正确");
throw new Exception("时间范围 '" + strValue + "' 格式不正确");

strEnd = "";
}
Expand All @@ -127,27 +127,25 @@ void SetStartEnd(string strValue)

if (strStart.Length != 8
&& string.IsNullOrEmpty(strStart) == false)
throw new Exception("时间范围 '" + strValue + "' 内 '"+strStart+"' 格式不正确");

throw new Exception("时间范围 '" + strValue + "' 内 '" + strStart + "' 格式不正确");

strEnd = strValue.Substring(nRet + 1).Trim();

if (strEnd.Length != 8
&& string.IsNullOrEmpty(strEnd) == false)
throw new Exception("时间范围 '" + strValue + "' 内 '"+strEnd+"' 格式不正确");
throw new Exception("时间范围 '" + strValue + "' 内 '" + strEnd + "' 格式不正确");
}

if (String.IsNullOrEmpty(strStart) == false)
this.dateTimePicker_start.Value = Long8ToDateTime(strStart);
if (String.IsNullOrEmpty(strEnd) == false)
this.dateTimePicker_end.Value = Long8ToDateTime(strEnd);

}

public static DateTime Long8ToDateTime(string strDate8)
{
if (strDate8.Length != 8)
throw new Exception("日期字符串格式必须为8字符。");
throw new Exception("日期字符串格式必须为8字符。");

int nYear = Convert.ToInt32(strDate8.Substring(0, 4));
int nMonth = Convert.ToInt32(strDate8.Substring(4, 2));
Expand Down Expand Up @@ -178,15 +176,15 @@ private void dateTimePicker_end_ValueChanged(object sender, EventArgs e)
}
}

// 获得最近三年的年份字符串
// 获得最近三年的年份字符串
List<string> GetRecentYear()
{
List<string> results = new List<string>();
int nCurrentYear = DateTime.Now.Year;

results.Add((nCurrentYear-1).ToString().PadLeft(4, '0'));
results.Add((nCurrentYear - 1).ToString().PadLeft(4, '0'));
results.Add(nCurrentYear.ToString().PadLeft(4, '0'));
results.Add((nCurrentYear+1).ToString().PadLeft(4, '0'));
results.Add((nCurrentYear + 1).ToString().PadLeft(4, '0'));

return results;
}
Expand All @@ -209,7 +207,7 @@ private void label_start_MouseUp(object sender, MouseEventArgs e)
contextMenu.MenuItems.Add(menuItem);

//
string strPart = "全年";
string strPart = "全年";

QuickSetParam param = new QuickSetParam();
param.Year = strYear;
Expand All @@ -221,7 +219,7 @@ private void label_start_MouseUp(object sender, MouseEventArgs e)
menuItem.MenuItems.Add(subMenuItem);

//
strPart = "上半年";
strPart = "上半年";
param = new QuickSetParam();
param.Year = strYear;
param.Part = strPart;
Expand All @@ -232,7 +230,7 @@ private void label_start_MouseUp(object sender, MouseEventArgs e)
menuItem.MenuItems.Add(subMenuItem);

//
strPart = "下半年";
strPart = "下半年";
param = new QuickSetParam();
param.Year = strYear;
param.Part = strPart;
Expand All @@ -253,29 +251,29 @@ void menu_quickSet_Click(object sender, EventArgs e)

QuickSetParam param = (QuickSetParam)menu.Tag;

if (param.Part == "全年")
if (param.Part == "全年")
{
this.Text = param.Year + "0101-" + param.Year + "1231";
return;
}
if (param.Part == "上半年")
if (param.Part == "上半年")
{
this.Text = param.Year + "0101-" + param.Year + "0630";
return;
}
if (param.Part == "下半年")
if (param.Part == "下半年")
{
this.Text = param.Year + "0701-" + param.Year + "1231";
return;
}
throw new Exception("未知的part参数值 '" + param.Part + "'");
throw new Exception("未知的part参数值 '" + param.Part + "'");
}

}

public class QuickSetParam
{
public string Year = "";
public string Part = ""; // 全年/上半年/下半年 等等
public string Part = ""; // 全年/上半年/下半年 等等
}
}
16 changes: 8 additions & 8 deletions DigitalPlatform.CommonControl/DcPeriodDialog.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
Expand All @@ -9,7 +9,7 @@
namespace DigitalPlatform.CommonControl
{
/// <summary>
/// DC中类型为dcterms:Period的时间范围值的编辑对话框
/// DC中类型为dcterms:Period的时间范围值的编辑对话框
/// </summary>
public partial class DcPeriodDialog : Form
{
Expand Down Expand Up @@ -73,12 +73,12 @@ static string GetParameter(string strText,
return strValue;
}

// 检测内容是否包含了被支持的 时间字符串类型
// 检测内容是否包含了被支持的 时间字符串类型
public static bool IsSupportType(string strValue)
{
string strScheme = GetParameter(strValue, "scheme");

// 缺省的类型
// 缺省的类型
if (String.IsNullOrEmpty(strScheme) == true)
{
strScheme = "W3C-DTF";
Expand Down Expand Up @@ -110,15 +110,15 @@ static int ParseValue(string strValue,
strName = GetParameter(strValue, "name");
strScheme = GetParameter(strValue, "scheme");

// 缺省的类型
// 缺省的类型
if (String.IsNullOrEmpty(strScheme) == true)
{
strScheme = "W3C-DTF";
}

if (strScheme != "W3C-DTF")
{
strError = "目前尚不支持编辑 '" + strScheme + "' 类型的时间字符串";
strError = "目前尚不支持编辑 '" + strScheme + "' 类型的时间字符串";
return -1;
}

Expand All @@ -139,7 +139,7 @@ int GetValue(out string strValue,
}
catch (Exception ex)
{
strError = "起始时间格式有错: " + ex.Message;
strError = "起始时间格式有错: " + ex.Message;
return -1;
}

Expand All @@ -155,7 +155,7 @@ int GetValue(out string strValue,
}
catch (Exception ex)
{
strError = "结束时间格式有错: " + ex.Message;
strError = "结束时间格式有错: " + ex.Message;
return -1;
}

Expand Down
6 changes: 3 additions & 3 deletions DigitalPlatform.CommonControl/DoubleComboBox.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
Expand Down Expand Up @@ -89,8 +89,8 @@ public string OldText
}
}

// 根据两个值是否相同,设置TextBox是否可见
// 两个值相同的时候,TextBox不可见;不同的时候,TextBox可见
// 根据两个值是否相同,设置TextBox是否可见
// 两个值相同的时候,TextBox不可见;不同的时候,TextBox可见
void SetVisibleState()
{
if (this.ComboBox.Text != this.TextBox.Text)
Expand Down
8 changes: 4 additions & 4 deletions DigitalPlatform.CommonControl/DoubleTextBox.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
Expand Down Expand Up @@ -120,16 +120,16 @@ public string OldText
}
}

// 根据两个值是否相同,设置TextBox是否可见
// 两个值相同的时候,TextBox不可见;不同的时候,TextBox可见
// 根据两个值是否相同,设置TextBox是否可见
// 两个值相同的时候,TextBox不可见;不同的时候,TextBox可见
void SetVisibleState()
{
if (this.TextBox.Text != this.SecondTextBox.Text)
{
this.SecondTextBox.Visible = true;
//this.Height = 28 * 2;
this.SecondTextBox.Location = new Point(this.SecondTextBox.Location.X,
this.TextBox.Height + 2); // 没有这句话以前,SecondTextBox可能会靠下,看不到的位置
this.TextBox.Height + 2); // 没有这句话以前,SecondTextBox可能会靠下,看不到的位置
}
else
{
Expand Down
Loading

0 comments on commit 63593cc

Please sign in to comment.