Files
BeWoPlaner/BeWo/Core/DownloadLinkEngine.cs

85 lines
2.5 KiB
C#

using BS.SharedLauncher.Information;
using System;
using System.ComponentModel;
namespace BeWo.Core
{
public class DownloadLinkEngine : INotifyPropertyChanged
{
private string _ExcelFileId;
private Uri _ExcelUri;
private string _WordFileId;
private Uri _WordUri;
public DownloadLinkEngine()
{
this.GenerateNewExcelLink();
this.GenerateNewWordLink();
}
public event PropertyChangedEventHandler PropertyChanged;
public string ExcelFileId
{
get
{
return this._ExcelFileId;
}
}
public Uri ExcelUri
{
get
{
return this._ExcelUri;
}
}
public string WordFileId
{
get
{
return this._WordFileId;
}
}
public Uri WordUri
{
get
{
return this._WordUri;
}
}
public Uri GenerateNewExcelLink()
{
this._ExcelFileId = Guid.NewGuid() + ".xls";
//alles nach dem ? wird beim klick auf word/excel export im jeweiligen view erstellt tenant=" + ConnectionInformation.Tenant + "&username=" + ConnectionInformation.Username + "&token=" + MainSession.LoggedOnUser.RC2Password + "&
this._ExcelUri = new Uri(ConnectionInformation.CoreServerAddressOrigin + "/Download.aspx?fileid=" + this._ExcelFileId);
if (this.PropertyChanged != null)
{
this.PropertyChanged(this, new PropertyChangedEventArgs("ExcelUri"));
}
return this._ExcelUri;
}
public Uri GenerateNewWordLink()
{
this._WordFileId = Guid.NewGuid() + ".doc";
//alles nach dem ? wird beim klick auf word/excel export im jeweiligen view erstellt
this._WordUri = new Uri(ConnectionInformation.CoreServerAddressOrigin + "/Download.aspx?tenant=" + ConnectionInformation.Tenant + "&username=" + ConnectionInformation.Username + "&token=" + MainSession.LoggedOnUser.RC2Password + "&fileid=" + this._WordFileId);
if (this.PropertyChanged != null)
{
this.PropertyChanged(this, new PropertyChangedEventArgs("WordUri"));
}
return this._WordUri;
}
}
}