Skip to content

Commit

Permalink
整理代码,针对 dp-library 新版本编译通过
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalPlatform committed Apr 28, 2019
1 parent 38728a0 commit 418ee6c
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 6 deletions.
3 changes: 3 additions & 0 deletions ChordInstaller/ChordInstaller.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
<PropertyGroup>
<ManifestTimestampUrl>http://timestamp.comodoca.com/rfc3161</ManifestTimestampUrl>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<HintPath>..\packages\Unofficial.Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll</HintPath>
Expand Down
3 changes: 3 additions & 0 deletions MessageWeb/MessageWeb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
Expand Down
3 changes: 3 additions & 0 deletions TestClient1/TestClient1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommonMark, Version=0.1.0.0, Culture=neutral, PublicKeyToken=001ef8810438905d, processorArchitecture=MSIL">
<HintPath>..\packages\CommonMark.NET.0.15.1\lib\net45\CommonMark.dll</HintPath>
Expand Down
3 changes: 3 additions & 0 deletions TestClient2/TestClient2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="FirstFloor.ModernUI, Version=1.0.9.0, Culture=neutral, PublicKeyToken=bc9b0c37bf06c6a9, processorArchitecture=MSIL">
<HintPath>..\packages\ModernUI.WPF.1.0.9\lib\net40\FirstFloor.ModernUI.dll</HintPath>
Expand Down
3 changes: 3 additions & 0 deletions TestRouter/TestRouter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
4 changes: 4 additions & 0 deletions TestZ3950/TestZ3950.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
<Project>{ffd44d99-c846-477a-86e9-a68c04985c0e}</Project>
<Name>DigitalPlatform.Core</Name>
</ProjectReference>
<ProjectReference Include="..\dp-library\DigitalPlatform.MarcQuery\DigitalPlatform.MarcQuery.csproj">
<Project>{df196fa7-7593-4548-a80f-3b10609e95a7}</Project>
<Name>DigitalPlatform.MarcQuery</Name>
</ProjectReference>
<ProjectReference Include="..\dp-library\DigitalPlatform.Net\DigitalPlatform.Net.csproj">
<Project>{10d28ecc-80d2-4a18-942d-d4e08d620e75}</Project>
<Name>DigitalPlatform.Net</Name>
Expand Down
2 changes: 1 addition & 1 deletion WebZ.Server/ServerInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public void WriteErrorLog(string strText)
// 每天一个日志文件
string strFilename = Path.Combine(LogDir, "log_" + DateTimeUtil.DateTimeToString8(now) + ".txt");
string strTime = now.ToString();
FileUtil.WriteText(strFilename,
StreamUtil.WriteText(strFilename,
strTime + " " + strText + "\r\n");
}
}
Expand Down
3 changes: 3 additions & 0 deletions ZipUtil/ZipUtil.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<HintPath>..\packages\Unofficial.Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion dp-library
4 changes: 4 additions & 0 deletions dp2Mini/dp2Mini.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@
<Project>{ffd44d99-c846-477a-86e9-a68c04985c0e}</Project>
<Name>DigitalPlatform.Core</Name>
</ProjectReference>
<ProjectReference Include="..\dp-library\DigitalPlatform.MarcQuery\DigitalPlatform.MarcQuery.csproj">
<Project>{df196fa7-7593-4548-a80f-3b10609e95a7}</Project>
<Name>DigitalPlatform.MarcQuery</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
30 changes: 29 additions & 1 deletion dp2weixin.service/SessionInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using DigitalPlatform.IO;
using DigitalPlatform;
using DigitalPlatform.IO;
using DigitalPlatform.Message;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -147,6 +148,33 @@ public string AddDebugInfo(string text)
return this._debugInfo;
}

/// <summary>
/// 写日志
/// </summary>
/// <param name="strText"></param>
public static void WriteLog(string strFilename, string strText, string strEventLogSource)
{
try
{
//lock (logSyncRoot)
{
string strTime = DateTime.Now.ToString();
StreamUtil.WriteText(strFilename, strTime + " " + strText + "\r\n");
}
}
catch (Exception ex)
{
EventLog Log = new EventLog();
Log.Source = strEventLogSource;
Log.WriteEntry("因为原本要写入日志文件的操作发生异常, 所以不得不改为写入 Windows 日志(见后一条)。异常信息如下:'" + ExceptionUtil.GetDebugText(ex) + "'", EventLogEntryType.Error);
Log.WriteEntry(strText, EventLogEntryType.Error);
}
}

// 日期转换成yyyy-MM-dd HH:mm:ss格式字符串
public static string DateTimeToStringNoSec(DateTime time)
{
return time.ToString("yyyy-MM-dd HH:mm");
}
}
}
5 changes: 3 additions & 2 deletions dp2weixin.service/dp2WeiXinService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ private int SendTemplateMsgInternal(List<string> weixinIds,
string oldRemark = templateData.remark.value;

// 加日期与操作人
string nowTime = DateTimeUtil.DateTimeToStringNoSec(DateTime.Now);
string nowTime = SessionInfo.DateTimeToStringNoSec(DateTime.Now);
templateData.remark.value = oldRemark + "\n" + nowTime;
if (theOperator != "")
templateData.remark.value = templateData.remark.value + " " + theOperator;
Expand Down Expand Up @@ -8308,6 +8308,7 @@ public int Renew1(string libId,

#region 预约


public int Reservation(string weixinId,
string libId,
string patron,
Expand Down Expand Up @@ -8614,7 +8615,7 @@ public void WriteLog(string strText, int logLevel)
{
var logDir = this.weiXinLogDir;
string strFilename = string.Format(logDir + "/log_{0}.txt", DateTime.Now.ToString("yyyyMMdd"));
FileUtil.WriteLog(strFilename, strText, "dp2weixin");
SessionInfo.WriteLog(strFilename, strText, "dp2weixin");
}
}

Expand Down
7 changes: 7 additions & 0 deletions dp2weixin.service/dp2weixin.service.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommonMark, Version=0.1.0.0, Culture=neutral, PublicKeyToken=001ef8810438905d, processorArchitecture=MSIL">
<HintPath>..\packages\CommonMark.NET.0.15.1\lib\net45\CommonMark.dll</HintPath>
Expand Down Expand Up @@ -174,6 +177,10 @@
<Project>{FFD44D99-C846-477A-86E9-A68C04985C0E}</Project>
<Name>DigitalPlatform.Core</Name>
</ProjectReference>
<ProjectReference Include="..\dp-library\DigitalPlatform.MarcQuery\DigitalPlatform.MarcQuery.csproj">
<Project>{df196fa7-7593-4548-a80f-3b10609e95a7}</Project>
<Name>DigitalPlatform.MarcQuery</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
8 changes: 7 additions & 1 deletion ilovelibrary.Server/SessionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ public Command GetCmd(int id)
return this.cmdList.Where(r => r.id == id).FirstOrDefault();
}

// 日期转换成yyyy-MM-dd HH:mm:ss格式字符串
public static string DateTimeToString(DateTime time)
{
return time.ToString("yyyy-MM-dd HH:mm:ss");
}

public Command AddCmd(Command item)
{
Debug.Assert(item != null, "AddCmd传进的item不能为空。");
Expand All @@ -52,7 +58,7 @@ public Command AddCmd(Command item)
// 补充命令信息
item.id = this.cmdList.Count + 1;
item.description = item.readerBarcode + "-" + item.type + "-" + item.itemBarcode;
item.operTime = DateTimeUtil.DateTimeToString(DateTime.Now);
item.operTime = DateTimeToString(DateTime.Now);
item.typeString = Command.getTypeString(item.type);

if (item.type == Command.C_Command_Borrow
Expand Down
4 changes: 4 additions & 0 deletions ilovelibrary.Server/ilovelibrary.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
<Project>{ffd44d99-c846-477a-86e9-a68c04985c0e}</Project>
<Name>DigitalPlatform.Core</Name>
</ProjectReference>
<ProjectReference Include="..\dp-library\DigitalPlatform.MarcQuery\DigitalPlatform.MarcQuery.csproj">
<Project>{df196fa7-7593-4548-a80f-3b10609e95a7}</Project>
<Name>DigitalPlatform.MarcQuery</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
3 changes: 3 additions & 0 deletions testSearch/testSearch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down

0 comments on commit 418ee6c

Please sign in to comment.