oqtane.framework/Oqtane.Client/Modules/Controls/AuditInfo.razor
Pavel Vesely cf6643aef3 Client fixes
Client is partially done.
227 warnings left out of 1500
I like Rider
2020-03-15 15:19:35 +01:00

82 lines
2.1 KiB
Plaintext

@namespace Oqtane.Modules.Controls
@inherits ModuleBase
@if (_text != "")
{
@((MarkupString)_text)
}
@code {
[Parameter]
public string CreatedBy { get; set; }
[Parameter]
public DateTime CreatedOn { get; set; }
[Parameter]
public string ModifiedBy { get; set; }
[Parameter]
public DateTime ModifiedOn { get; set; }
[Parameter]
public string DeletedBy { get; set; }
[Parameter]
public DateTime? DeletedOn { get; set; }
[Parameter]
public bool IsDeleted { get; set; }
[Parameter]
public string Style { get; set; }
string _text = "";
protected override void OnParametersSet()
{
_text = "";
if (!String.IsNullOrEmpty(CreatedBy) || CreatedOn != null)
{
_text += "<p style=\"" + Style + "\">Created ";
if (!String.IsNullOrEmpty(CreatedBy))
{
_text += " by <b>" + CreatedBy + "</b>";
}
if (CreatedOn != null)
{
_text += " on <b>" + CreatedOn.ToString("MMM dd yyyy HH:mm:ss") + "</b>";
}
_text += "</p>";
}
if (!String.IsNullOrEmpty(ModifiedBy) || ModifiedOn != null)
{
_text += "<p style=\"" + Style + "\">Last modified ";
if (!String.IsNullOrEmpty(ModifiedBy))
{
_text += " by <b>" + ModifiedBy + "</b>";
}
if (ModifiedOn != null)
{
_text += " on <b>" + ModifiedOn.ToString("MMM dd yyyy HH:mm:ss") + "</b>";
}
_text += "</p>";
}
if (!String.IsNullOrEmpty(DeletedBy) || DeletedOn.HasValue)
{
_text += "<p style=\"" + Style + "\">Deleted ";
if (!String.IsNullOrEmpty(DeletedBy))
{
_text += " by <b>" + DeletedBy + "</b>";
}
if (DeletedOn != null)
{
_text += " on <b>" + DeletedOn.Value.ToString("MMM dd yyyy HH:mm:ss") + "</b>";
}
_text += "</p>";
}
}
}