Event: Add description, date and location.
Changed Files: Model >Event.cs & Client > Module > Edit.razor & Detail.razor
This commit is contained in:
@ -16,13 +16,31 @@
|
||||
<input id="name" class="form-control" @bind="@_name" required />
|
||||
</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>
|
||||
<button type="button" class="btn btn-success" @onclick="Save">@Localizer["Save"]</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
|
||||
<br /><br />
|
||||
@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>
|
||||
|
||||
@ -43,6 +61,10 @@
|
||||
|
||||
private int _id;
|
||||
private string _name;
|
||||
private string _description;
|
||||
private DateTime _eventDate;
|
||||
private string _location;
|
||||
|
||||
private string _createdby;
|
||||
private DateTime _createdon;
|
||||
private string _modifiedby;
|
||||
@ -59,6 +81,10 @@
|
||||
if (EventRegistration != null)
|
||||
{
|
||||
_name = EventRegistration.Name;
|
||||
_description = EventRegistration.Description;
|
||||
_eventDate = EventRegistration.EventDate;
|
||||
_location = EventRegistration.Location;
|
||||
|
||||
_createdby = EventRegistration.CreatedBy;
|
||||
_createdon = EventRegistration.CreatedOn;
|
||||
_modifiedby = EventRegistration.ModifiedBy;
|
||||
@ -86,6 +112,9 @@
|
||||
Event EventRegistration = new Event();
|
||||
EventRegistration.ModuleId = ModuleState.ModuleId;
|
||||
EventRegistration.Name = _name;
|
||||
EventRegistration.Description = _description;
|
||||
EventRegistration.EventDate = _eventDate;
|
||||
EventRegistration.Location = _location;
|
||||
EventRegistration = await EventRegistrationService.AddEventAsync(EventRegistration);
|
||||
await logger.LogInformation("EventRegistration Added {EventRegistration}", EventRegistration);
|
||||
}
|
||||
@ -93,6 +122,9 @@
|
||||
{
|
||||
Event EventRegistration = await EventRegistrationService.GetEventAsync(_id, ModuleState.ModuleId);
|
||||
EventRegistration.Name = _name;
|
||||
EventRegistration.Description = _description;
|
||||
EventRegistration.EventDate = _eventDate;
|
||||
EventRegistration.Location = _location;
|
||||
await EventRegistrationService.UpdateEventAsync(EventRegistration);
|
||||
await logger.LogInformation("EventRegistration Updated {EventRegistration}", EventRegistration);
|
||||
}
|
||||
|
Reference in New Issue
Block a user