Event: Add description, date and location.
Changed Files: Model >Event.cs & Client > Module > Edit.razor & Detail.razor
This commit is contained in:
parent
527f9aadc6
commit
f280e49d96
@ -11,6 +11,12 @@
|
|||||||
<h3>Anmeldung zum Event</h3>
|
<h3>Anmeldung zum Event</h3>
|
||||||
|
|
||||||
<p>Willst du am Event (@_name) teilnehmen?</p>
|
<p>Willst du am Event (@_name) teilnehmen?</p>
|
||||||
|
<span>@_eventDate - @_location</span>
|
||||||
|
<div>
|
||||||
|
<p>@_description</p>
|
||||||
|
<p><strong>Erstellt von:</strong> @_createdby am @_createdon</p>
|
||||||
|
<p><strong>Zuletzt aktualisiert von:</strong> @_modifiedby am @_modifiedon</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
@if (PageState.User != null) {
|
@if (PageState.User != null) {
|
||||||
|
|
||||||
@ -35,7 +41,7 @@
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
<p class="mt-3">Um dich für dieses Event zu registrieren, muss man sich zuerst anmelden.</p> <Login />
|
<p class="mt-3">Um dich für dieses Event zu registrieren, muss man sich zuerst anmelden.</p> <Login /><Register />
|
||||||
}
|
}
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
@ -55,6 +61,10 @@
|
|||||||
|
|
||||||
private int _id;
|
private int _id;
|
||||||
private string _name;
|
private string _name;
|
||||||
|
private string _description;
|
||||||
|
private DateTime _eventDate;
|
||||||
|
private string _location;
|
||||||
|
|
||||||
private string _createdby;
|
private string _createdby;
|
||||||
private DateTime _createdon;
|
private DateTime _createdon;
|
||||||
private string _modifiedby;
|
private string _modifiedby;
|
||||||
@ -103,6 +113,9 @@
|
|||||||
if (currentEvent != null)
|
if (currentEvent != null)
|
||||||
{
|
{
|
||||||
_name = currentEvent.Name;
|
_name = currentEvent.Name;
|
||||||
|
_description = currentEvent.Description;
|
||||||
|
_eventDate = currentEvent.EventDate;
|
||||||
|
_location = currentEvent.Location;
|
||||||
_createdby = currentEvent.CreatedBy;
|
_createdby = currentEvent.CreatedBy;
|
||||||
_createdon = currentEvent.CreatedOn;
|
_createdon = currentEvent.CreatedOn;
|
||||||
_modifiedby = currentEvent.ModifiedBy;
|
_modifiedby = currentEvent.ModifiedBy;
|
||||||
@ -121,41 +134,4 @@
|
|||||||
AddModuleMessage(Localizer["Message.LoadError"], MessageType.Error);
|
AddModuleMessage(Localizer["Message.LoadError"], MessageType.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task Save()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
validated = true;
|
|
||||||
var interop = new Oqtane.UI.Interop(JSRuntime);
|
|
||||||
if (await interop.FormValid(form))
|
|
||||||
{
|
|
||||||
if (PageState.Action == "Add")
|
|
||||||
{
|
|
||||||
Event EventRegistration = new Event();
|
|
||||||
EventRegistration.ModuleId = ModuleState.ModuleId;
|
|
||||||
EventRegistration.Name = _name;
|
|
||||||
EventRegistration = await EventRegistrationService.AddEventAsync(EventRegistration);
|
|
||||||
await logger.LogInformation("EventRegistration Added {EventRegistration}", EventRegistration);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Event EventRegistration = await EventRegistrationService.GetEventAsync(_id, ModuleState.ModuleId);
|
|
||||||
EventRegistration.Name = _name;
|
|
||||||
await EventRegistrationService.UpdateEventAsync(EventRegistration);
|
|
||||||
await logger.LogInformation("EventRegistration Updated {EventRegistration}", EventRegistration);
|
|
||||||
}
|
|
||||||
NavigationManager.NavigateTo(NavigateUrl());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
AddModuleMessage(Localizer["Message.SaveValidation"], MessageType.Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
await logger.LogError(ex, "Error Saving EventRegistration {Error}", ex.Message);
|
|
||||||
AddModuleMessage(Localizer["Message.SaveError"], MessageType.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -16,13 +16,31 @@
|
|||||||
<input id="name" class="form-control" @bind="@_name" required />
|
<input id="name" class="form-control" @bind="@_name" required />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="description" HelpText="Enter a description" ResourceKey="Description">Description: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="description" class="form-control" @bind="@_description" required />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="eventdate" HelpText="Enter a Date" ResourceKey="EventDate">EventDate: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="eventdate" class="form-control" @bind="@_eventDate" required />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="location" HelpText="Enter a Location" ResourceKey="Location">Location: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="location" class="form-control" @bind="@_location" required />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-success" @onclick="Save">@Localizer["Save"]</button>
|
<button type="button" class="btn btn-success" @onclick="Save">@Localizer["Save"]</button>
|
||||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
|
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
@if (PageState.Action == "Edit")
|
@if (PageState.Action == "Edit")
|
||||||
{
|
{
|
||||||
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon"></AuditInfo>
|
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon"></AuditInfo>
|
||||||
}
|
}
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@ -43,6 +61,10 @@
|
|||||||
|
|
||||||
private int _id;
|
private int _id;
|
||||||
private string _name;
|
private string _name;
|
||||||
|
private string _description;
|
||||||
|
private DateTime _eventDate;
|
||||||
|
private string _location;
|
||||||
|
|
||||||
private string _createdby;
|
private string _createdby;
|
||||||
private DateTime _createdon;
|
private DateTime _createdon;
|
||||||
private string _modifiedby;
|
private string _modifiedby;
|
||||||
@ -59,6 +81,10 @@
|
|||||||
if (EventRegistration != null)
|
if (EventRegistration != null)
|
||||||
{
|
{
|
||||||
_name = EventRegistration.Name;
|
_name = EventRegistration.Name;
|
||||||
|
_description = EventRegistration.Description;
|
||||||
|
_eventDate = EventRegistration.EventDate;
|
||||||
|
_location = EventRegistration.Location;
|
||||||
|
|
||||||
_createdby = EventRegistration.CreatedBy;
|
_createdby = EventRegistration.CreatedBy;
|
||||||
_createdon = EventRegistration.CreatedOn;
|
_createdon = EventRegistration.CreatedOn;
|
||||||
_modifiedby = EventRegistration.ModifiedBy;
|
_modifiedby = EventRegistration.ModifiedBy;
|
||||||
@ -86,6 +112,9 @@
|
|||||||
Event EventRegistration = new Event();
|
Event EventRegistration = new Event();
|
||||||
EventRegistration.ModuleId = ModuleState.ModuleId;
|
EventRegistration.ModuleId = ModuleState.ModuleId;
|
||||||
EventRegistration.Name = _name;
|
EventRegistration.Name = _name;
|
||||||
|
EventRegistration.Description = _description;
|
||||||
|
EventRegistration.EventDate = _eventDate;
|
||||||
|
EventRegistration.Location = _location;
|
||||||
EventRegistration = await EventRegistrationService.AddEventAsync(EventRegistration);
|
EventRegistration = await EventRegistrationService.AddEventAsync(EventRegistration);
|
||||||
await logger.LogInformation("EventRegistration Added {EventRegistration}", EventRegistration);
|
await logger.LogInformation("EventRegistration Added {EventRegistration}", EventRegistration);
|
||||||
}
|
}
|
||||||
@ -93,6 +122,9 @@
|
|||||||
{
|
{
|
||||||
Event EventRegistration = await EventRegistrationService.GetEventAsync(_id, ModuleState.ModuleId);
|
Event EventRegistration = await EventRegistrationService.GetEventAsync(_id, ModuleState.ModuleId);
|
||||||
EventRegistration.Name = _name;
|
EventRegistration.Name = _name;
|
||||||
|
EventRegistration.Description = _description;
|
||||||
|
EventRegistration.EventDate = _eventDate;
|
||||||
|
EventRegistration.Location = _location;
|
||||||
await EventRegistrationService.UpdateEventAsync(EventRegistration);
|
await EventRegistrationService.UpdateEventAsync(EventRegistration);
|
||||||
await logger.LogInformation("EventRegistration Updated {EventRegistration}", EventRegistration);
|
await logger.LogInformation("EventRegistration Updated {EventRegistration}", EventRegistration);
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,9 @@ namespace SZUAbsolventenverein.Module.EventRegistration
|
|||||||
{
|
{
|
||||||
Name = "EventRegistration",
|
Name = "EventRegistration",
|
||||||
Description = "A module to manage registration for events",
|
Description = "A module to manage registration for events",
|
||||||
Version = "1.0.0",
|
Version = "1.0.5",
|
||||||
ServerManagerType = "SZUAbsolventenverein.Module.EventRegistration.Manager.EventRegistrationManager, SZUAbsolventenverein.Module.EventRegistration.Server.Oqtane",
|
ServerManagerType = "SZUAbsolventenverein.Module.EventRegistration.Manager.EventRegistrationManager, SZUAbsolventenverein.Module.EventRegistration.Server.Oqtane",
|
||||||
ReleaseVersions = "1.0.0",
|
ReleaseVersions = "1.0.0,1.0.1,1.0.2,1.0.3,1.0.4,1.0.5",
|
||||||
Dependencies = "SZUAbsolventenverein.Module.EventRegistration.Shared.Oqtane",
|
Dependencies = "SZUAbsolventenverein.Module.EventRegistration.Shared.Oqtane",
|
||||||
PackageName = "SZUAbsolventenverein.Module.EventRegistration"
|
PackageName = "SZUAbsolventenverein.Module.EventRegistration"
|
||||||
};
|
};
|
||||||
|
@ -13,6 +13,10 @@ namespace SZUAbsolventenverein.Module.EventRegistration.Models
|
|||||||
public int ModuleId { get; set; }
|
public int ModuleId { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public string Description { get; set; }
|
||||||
|
public DateTime EventDate { get; set; }
|
||||||
|
public string Location { get; set; }
|
||||||
|
|
||||||
public string CreatedBy { get; set; }
|
public string CreatedBy { get; set; }
|
||||||
public DateTime CreatedOn { get; set; }
|
public DateTime CreatedOn { get; set; }
|
||||||
public string ModifiedBy { get; set; }
|
public string ModifiedBy { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user