Skip to content

Commit 499ee4f

Browse files
committed
Fix: update template
- to fix name conflict when creating file from template
1 parent 14ef50e commit 499ee4f

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

DebitExpress.VatRelief/DebitExpress.VatRelief.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
<ItemGroup>
2020
<Resource Include="favicon.png" />
21-
<None Remove="template.xlsx" />
22-
<EmbeddedResource Include="template.xlsx" />
21+
<EmbeddedResource Include="template.xltx" />
2322
</ItemGroup>
2423

2524
</Project>

DebitExpress.VatRelief/MainWindow.xaml.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,34 +169,34 @@ private void OnDownload(object sender, RoutedEventArgs e)
169169
Directory.CreateDirectory(path);
170170

171171
var assembly = Assembly.GetExecutingAssembly();
172-
using var stream = assembly.GetManifestResourceStream("DebitExpress.VatRelief.template.xlsx");
172+
using var stream = assembly.GetManifestResourceStream("DebitExpress.VatRelief.template.xltx");
173173

174174
if (stream == null) return;
175175

176-
var filePath = Path.Combine(path, "template.xlsx");
176+
var filePath = Path.Combine(path, "vat-relief-template.xltx");
177177
using var fileStream = File.Create(Path.Combine(filePath));
178178
stream.Seek(0, SeekOrigin.Begin);
179179
stream.CopyTo(fileStream);
180180
fileStream.Close();
181181

182182
NotifyResult("Template downloaded successfully");
183-
OpenExcelFile(filePath);
183+
OpenProcess(filePath);
184184
}
185185
finally
186186
{
187187
DownloadButton.IsEnabled = true;
188188
}
189189
}
190190

191-
private static void OpenExcelFile(string excelFile)
191+
private static void OpenProcess(string path)
192192
{
193-
new Process { StartInfo = new ProcessStartInfo(excelFile) { UseShellExecute = true } }.Start();
193+
new Process { StartInfo = new ProcessStartInfo(path) { UseShellExecute = true } }.Start();
194194
}
195195

196196
#endregion
197197

198198
private void OnGithub(object sender, RoutedEventArgs e)
199199
{
200-
new Process { StartInfo = new ProcessStartInfo("https://github.com/cpa-coder/vat-relief") { UseShellExecute = true } }.Start();
200+
OpenProcess("https://github.com/cpa-coder/vat-relief");
201201
}
202202
}
-16.8 KB
Binary file not shown.
16.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)