This commit is contained in:
Alexander Trofimov
2015-06-25 11:27:08 +03:00
parent dbf21ee32f
commit a10605c91f
174 changed files with 24121 additions and 8908 deletions

View File

@@ -39,6 +39,7 @@ using System.Net;
using System.Xml;
using System.Text;
using System.Web;
using System.Web.Script.Serialization;
using FileConverterUtils2;
using log4net;
using log4net.Config;
@@ -63,6 +64,20 @@ namespace FileConverterService2
}
}
public class ChangesHistoryData
{
public string userid;
public string username;
public string date;
public ChangesHistoryData(string _userId, string _userName, DateTime _date)
{
userid = _userId;
username = _userName;
date = _date.ToString(Constants.mc_sDateTimeFormat);
}
}
public class FileConverter
{
private static readonly ILog _log = LogManager.GetLogger(typeof(FileConverter));
@@ -387,9 +402,15 @@ namespace FileConverterService2
string sChangesAuthor = null;
int nIndexFile = 0;
StreamWriter oStreamWriter = null;
StreamWriter oStreamWriterChangesJSON = null;
Ionic.Zip.ZipFile oZipFile = null;
try
{
List<ChangesHistoryData> arrChangesHistoryData = new List<ChangesHistoryData>();
string strFileNameChange = "";
oZipFile = new Ionic.Zip.ZipFile();
for (int i = 0, length = aChanges.Count; i < length; ++i)
{
if (null == sChangesAuthor || sChangesAuthor != aChanges[i].userid)
@@ -403,9 +424,13 @@ namespace FileConverterService2
}
sChangesAuthor = aChanges[i].userid;
oStreamWriter = new StreamWriter(Path.Combine(sChangesDir, "changes" + (nIndexFile++) + ".json"));
strFileNameChange = Path.Combine(sChangesDir, string.Format("changes{0}.json", nIndexFile++));
oZipFile.AddFile(strFileNameChange, "");
oStreamWriter = new StreamWriter(strFileNameChange);
oStreamWriter.Write("[");
oStreamWriter.Write(aChanges[i].data);
arrChangesHistoryData.Add(new ChangesHistoryData(sChangesAuthor, aChanges[i].username, aChanges[i].date));
}
else
{
@@ -421,6 +446,17 @@ namespace FileConverterService2
oStreamWriter.Dispose();
oStreamWriter = null;
}
oStreamWriterChangesJSON = new StreamWriter(Path.Combine(sDirResult, "changesHistory.json"));
JavaScriptSerializer oJsSerializer = new JavaScriptSerializer();
oStreamWriterChangesJSON.Write(oJsSerializer.Serialize(arrChangesHistoryData));
oStreamWriterChangesJSON.Dispose();
oStreamWriterChangesJSON = null;
oZipFile.Save(Path.Combine(sDirResult, "changes.zip"));
oZipFile.Dispose();
oZipFile = null;
}
catch
{
@@ -429,6 +465,10 @@ namespace FileConverterService2
{
if (null != oStreamWriter)
oStreamWriter.Dispose();
if (null != oStreamWriterChangesJSON)
oStreamWriterChangesJSON.Dispose();
if (null != oZipFile)
oZipFile.Dispose();
}
}
}

View File

@@ -75,19 +75,23 @@
<ItemGroup>
<Reference Include="AWSSDK, Version=1.3.19.0, Culture=neutral, PublicKeyToken=cd2d24cd2bace800, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ThirdParty\Bin\AWSSDK.dll</HintPath>
<HintPath>..\..\..\wwwroot\Bin\AWSSDK.dll</HintPath>
</Reference>
<Reference Include="FileConverterUtils2, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Bin\FileConverterUtils2.dll</HintPath>
<HintPath>..\..\..\wwwroot\Bin\FileConverterUtils2.dll</HintPath>
</Reference>
<Reference Include="Ionic.Zip.Reduced, Version=1.9.1.5, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\wwwroot\Bin\Ionic.Zip.Reduced.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ThirdParty\Bin\log4net.dll</HintPath>
<HintPath>..\..\..\wwwroot\Bin\log4net.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ThirdParty\Bin\MySql.Data.dll</HintPath>
<HintPath>..\..\..\wwwroot\Bin\MySql.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
@@ -115,6 +119,9 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="Settings.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<COMReference Condition=" '$(IsOpenSource)' == '' " Include="AVSGraphics">
@@ -135,6 +142,8 @@
</COMReference>
</ItemGroup>
<PropertyGroup>
<PostBuildEvent>copy $(TargetPath) $(ProjectDir)..\Bin\</PostBuildEvent>
<PostBuildEvent>copy $(ProjectDir)..\..\..\wwwroot\Bin\Settings.config $(TargetDir)
copy $(ProjectDir)..\..\..\wwwroot\Bin\ConnectionStrings.config $(TargetDir)
copy $(TargetPath) $(ProjectDir)..\..\..\wwwroot\Bin\</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -46,5 +46,5 @@ using System.Runtime.InteropServices;
[assembly: Guid("2f0ef597-725c-4954-976e-9808c513f9a5")]
[assembly: AssemblyVersion("1.0.0.56")]
[assembly: AssemblyFileVersion("1.0.0.56")]
[assembly: AssemblyVersion("1.0.0.57")]
[assembly: AssemblyFileVersion("1.0.0.57")]