Naming fixes
This commit is contained in:
@ -6,26 +6,26 @@
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Name: </label>
|
||||
<label class="control-label">Name: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@name" />
|
||||
<input class="form-control" @bind="@_name" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Type: </label>
|
||||
<label class="control-label">Type: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@jobtype" />
|
||||
<input class="form-control" @bind="@_jobType" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Enabled? </label>
|
||||
<label class="control-label">Enabled? </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@isenabled">
|
||||
<select class="form-control" @bind="@_isEnabled">
|
||||
<option value="True">Yes</option>
|
||||
<option value="False">No</option>
|
||||
</select>
|
||||
@ -33,11 +33,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Runs Every: </label>
|
||||
<label class="control-label">Runs Every: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@interval" />
|
||||
<select class="form-control" @bind="@frequency">
|
||||
<input class="form-control" @bind="@_interval" />
|
||||
<select class="form-control" @bind="@_frequency">
|
||||
<option value="m">Minute(s)</option>
|
||||
<option value="H">Hour(s)</option>
|
||||
<option value="d">Day(s)</option>
|
||||
@ -47,26 +47,26 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Starting: </label>
|
||||
<label class="control-label">Starting: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@startdate" />
|
||||
<input class="form-control" @bind="@_startDate" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Ending: </label>
|
||||
<label class="control-label">Ending: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@enddate" />
|
||||
<input class="form-control" @bind="@_endDate" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Retention Log (Items): </label>
|
||||
<label class="control-label">Retention Log (Items): </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@retentionhistory" />
|
||||
<input class="form-control" @bind="@_retentionHistory" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -76,68 +76,68 @@
|
||||
@code {
|
||||
public override SecurityAccessLevel SecurityAccessLevel { get { return SecurityAccessLevel.Host; } }
|
||||
|
||||
int jobid;
|
||||
string name = "";
|
||||
string jobtype = "";
|
||||
string isenabled = "True";
|
||||
string interval = "";
|
||||
string frequency = "";
|
||||
string startdate = "";
|
||||
string enddate = "";
|
||||
string retentionhistory = "";
|
||||
int _jobId;
|
||||
string _name = "";
|
||||
string _jobType = "";
|
||||
string _isEnabled = "True";
|
||||
string _interval = "";
|
||||
string _frequency = "";
|
||||
string _startDate = "";
|
||||
string _endDate = "";
|
||||
string _retentionHistory = "";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
jobid = Int32.Parse(PageState.QueryString["id"]);
|
||||
Job job = await JobService.GetJobAsync(jobid);
|
||||
_jobId = Int32.Parse(PageState.QueryString["id"]);
|
||||
Job job = await JobService.GetJobAsync(_jobId);
|
||||
if (job != null)
|
||||
{
|
||||
name = job.Name;
|
||||
jobtype = job.JobType;
|
||||
isenabled = job.IsEnabled.ToString();
|
||||
interval = job.Interval.ToString();
|
||||
frequency = job.Frequency;
|
||||
startdate = (job.StartDate != null) ? job.StartDate.ToString() : "";
|
||||
enddate = (job.EndDate != null) ? job.EndDate.ToString() : "";
|
||||
retentionhistory = job.RetentionHistory.ToString();
|
||||
_name = job.Name;
|
||||
_jobType = job.JobType;
|
||||
_isEnabled = job.IsEnabled.ToString();
|
||||
_interval = job.Interval.ToString();
|
||||
_frequency = job.Frequency;
|
||||
_startDate = (job.StartDate != null) ? job.StartDate.ToString() : "";
|
||||
_endDate = (job.EndDate != null) ? job.EndDate.ToString() : "";
|
||||
_retentionHistory = job.RetentionHistory.ToString();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await logger.LogError(ex, "Error Loading Job {JobId} {Error}", jobid, ex.Message);
|
||||
await logger.LogError(ex, "Error Loading Job {JobId} {Error}", _jobId, ex.Message);
|
||||
AddModuleMessage("Error Loading Job", MessageType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SaveJob()
|
||||
{
|
||||
if (name != "" && !string.IsNullOrEmpty(jobtype) && frequency != "" && interval != "" && retentionhistory != "")
|
||||
if (_name != "" && !string.IsNullOrEmpty(_jobType) && _frequency != "" && _interval != "" && _retentionHistory != "")
|
||||
{
|
||||
Job job = await JobService.GetJobAsync(jobid);
|
||||
job.Name = name;
|
||||
job.JobType = jobtype;
|
||||
job.IsEnabled = Boolean.Parse(isenabled);
|
||||
job.Frequency = frequency;
|
||||
job.Interval = int.Parse(interval);
|
||||
if (startdate == "")
|
||||
Job job = await JobService.GetJobAsync(_jobId);
|
||||
job.Name = _name;
|
||||
job.JobType = _jobType;
|
||||
job.IsEnabled = Boolean.Parse(_isEnabled);
|
||||
job.Frequency = _frequency;
|
||||
job.Interval = int.Parse(_interval);
|
||||
if (_startDate == "")
|
||||
{
|
||||
job.StartDate = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
job.StartDate = DateTime.Parse(startdate);
|
||||
job.StartDate = DateTime.Parse(_startDate);
|
||||
}
|
||||
if (enddate == "")
|
||||
if (_endDate == "")
|
||||
{
|
||||
job.EndDate = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
job.EndDate = DateTime.Parse(enddate);
|
||||
job.EndDate = DateTime.Parse(_endDate);
|
||||
}
|
||||
job.RetentionHistory = int.Parse(retentionhistory);
|
||||
job.RetentionHistory = int.Parse(_retentionHistory);
|
||||
|
||||
try
|
||||
{
|
||||
|
Reference in New Issue
Block a user