Correzioni warnings in TaskMan
This commit is contained in:
@@ -2,16 +2,11 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.TaskMan.Models;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static MP.TaskMan.Objects.Enums;
|
||||
|
||||
namespace MP.TaskMan.Controllers
|
||||
{
|
||||
public class MpTaskController : IDisposable
|
||||
public class MpTaskController
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
@@ -87,11 +82,7 @@ namespace MP.TaskMan.Controllers
|
||||
return dtNext;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_configuration = null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Chiamata esecuzione di un singolo task programmato, SE in stato abilitato
|
||||
/// </summary>
|
||||
|
||||
@@ -16,7 +16,7 @@ using static MP.TaskMan.Objects.Enums;
|
||||
|
||||
namespace MP.TaskMan.Services
|
||||
{
|
||||
public class TaskService : BaseServ, IDisposable
|
||||
public class TaskService : BaseServ
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
@@ -88,15 +88,6 @@ namespace MP.TaskMan.Services
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Clear database controller
|
||||
MLController.Dispose();
|
||||
// redis dispose
|
||||
redisConn = null;
|
||||
redisDb = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Chiamata esecuzione di un singolo task programmato
|
||||
/// </summary>
|
||||
@@ -136,18 +127,22 @@ namespace MP.TaskMan.Services
|
||||
{
|
||||
var callResp = await RCallService.CallRestGet(TaskRec.Command, TaskRec.Args);
|
||||
DateTime dtEnd = DateTime.Now;
|
||||
string formattedJson = JValue.Parse(callResp.Content).ToString(Formatting.Indented);
|
||||
TaskExecModel tExeMod = new TaskExecModel()
|
||||
if (callResp != null && !string.IsNullOrEmpty(callResp.Content))
|
||||
{
|
||||
DtEnd = dtEnd,
|
||||
DtStart = dtStart,
|
||||
IsError = callResp.StatusCode != System.Net.HttpStatusCode.OK,
|
||||
TaskId = TaskRec.TaskId,
|
||||
// deserializzazione come json indentato?!?
|
||||
Result = formattedJson// $"{callResp.Content}".Replace("\"", ""),
|
||||
};
|
||||
// salvo su DB
|
||||
answ = MLController.TaskExecSaveExecuted(TaskRec.TaskId, SchedNext, tExeMod);
|
||||
|
||||
string formattedJson = JValue.Parse(callResp.Content).ToString(Formatting.Indented);
|
||||
TaskExecModel tExeMod = new TaskExecModel()
|
||||
{
|
||||
DtEnd = dtEnd,
|
||||
DtStart = dtStart,
|
||||
IsError = callResp.StatusCode != System.Net.HttpStatusCode.OK,
|
||||
TaskId = TaskRec.TaskId,
|
||||
// deserializzazione come json indentato?!?
|
||||
Result = formattedJson// $"{callResp.Content}".Replace("\"", ""),
|
||||
};
|
||||
// salvo su DB
|
||||
answ = MLController.TaskExecSaveExecuted(TaskRec.TaskId, SchedNext, tExeMod);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -95,8 +95,8 @@ namespace MP.TaskMan
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private List<TaskExecModel> ListRecords;
|
||||
private List<TaskExecModel> SearchRecords;
|
||||
private List<TaskExecModel> ListRecords = new();
|
||||
private List<TaskExecModel> SearchRecords = new();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -112,19 +112,26 @@ namespace MP.TaskMan
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
SearchRecords = await TService.TaskExecGetFilt(CurrRecord.TaskId, 1000, "");
|
||||
// se non tutti filtro...
|
||||
if (ShowErrorMode != 0)
|
||||
if (CurrRecord != null)
|
||||
{
|
||||
if (ShowErrorMode == 1)
|
||||
SearchRecords = await TService.TaskExecGetFilt(CurrRecord.TaskId, 1000, "");
|
||||
// se non tutti filtro...
|
||||
if (ShowErrorMode != 0)
|
||||
{
|
||||
SearchRecords = SearchRecords.FindAll(x => x.IsError);
|
||||
}
|
||||
else if (ShowErrorMode == 2)
|
||||
{
|
||||
SearchRecords = SearchRecords.FindAll(x => !x.IsError);
|
||||
if (ShowErrorMode == 1)
|
||||
{
|
||||
SearchRecords = SearchRecords.FindAll(x => x.IsError);
|
||||
}
|
||||
else if (ShowErrorMode == 2)
|
||||
{
|
||||
SearchRecords = SearchRecords.FindAll(x => !x.IsError);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SearchRecords = new();
|
||||
}
|
||||
totalCount = SearchRecords.Count;
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
}
|
||||
|
||||
@@ -205,8 +205,11 @@ namespace MP.TaskMan
|
||||
|
||||
protected void ResetData()
|
||||
{
|
||||
TService.rollBackEdit(currRecord);
|
||||
currRecord = null;
|
||||
if (currRecord != null)
|
||||
{
|
||||
TService.rollBackEdit(currRecord);
|
||||
currRecord = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected double righDiv(double num, double den)
|
||||
|
||||
@@ -10,10 +10,10 @@ namespace MP.TaskMan
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public int CodGroup { get; set; } = 0;
|
||||
public List<TaskListModel> AllRecords { get; set; } = new List<TaskListModel>();
|
||||
|
||||
[Parameter]
|
||||
public List<TaskListModel> AllRecords { get; set; } = new List<TaskListModel>();
|
||||
public int CodGroup { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_Cancel { get; set; }
|
||||
@@ -207,7 +207,6 @@ namespace MP.TaskMan
|
||||
|
||||
private int currPage = 1;
|
||||
private TaskListModel? DetailTaskId = null;
|
||||
private bool isLoading = false;
|
||||
private List<TaskListModel> ListRecords = new List<TaskListModel>();
|
||||
private int maxOrdinal = 999;
|
||||
private int minOrdinal = 0;
|
||||
|
||||
Reference in New Issue
Block a user