Inizio bozza gestione schedulazione task
This commit is contained in:
@@ -4,7 +4,9 @@ using Microsoft.Extensions.Configuration;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using static MP.Data.Objects.Enums;
|
||||
|
||||
namespace MP.Data.Controllers
|
||||
{
|
||||
@@ -224,17 +226,6 @@ namespace MP.Data.Controllers
|
||||
List<DatabaseModels.OdlEnergyModel> dbResult = new List<DatabaseModels.OdlEnergyModel>();
|
||||
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||
{
|
||||
//dbResult = dbCtx
|
||||
// .DbSetOdlEnergy
|
||||
// .Where(x =>
|
||||
// (string.IsNullOrEmpty(IdxMacchina) || x.IdxMacchina == IdxMacchina)
|
||||
// && ((x.DataInizio >= DtStart && x.DataInizio <= DtEnd) || (x.DataFine >= DtStart && x.DataFine <= DtEnd) || (x.DataFine == null && x.DataInizio <= DtStart))
|
||||
// && (IdxODL == 0 || x.IdxOdl == IdxODL)
|
||||
// && (KeyRichiesta == "*" || x.KeyRichiesta == KeyRichiesta)
|
||||
// && (CodArticolo == "*" || x.CodArticolo == CodArticolo)
|
||||
// )
|
||||
// .ToList();
|
||||
|
||||
var dataFrom = new SqlParameter("@dataFrom", DtStart);
|
||||
var dataTo = new SqlParameter("@dataTo", DtEnd);
|
||||
var idxMacchina = new SqlParameter("@idxMacchina", IdxMacchina);
|
||||
@@ -250,6 +241,48 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ricerca task dato tipo e
|
||||
/// </summary>
|
||||
/// <param name="TType"></param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.TaskListModel> TaskListGetAll(Task2ExeType TType)
|
||||
{
|
||||
List<DatabaseModels.TaskListModel> dbResult = new List<DatabaseModels.TaskListModel>();
|
||||
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||
{
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetTaskList
|
||||
.Where(x => (TType == Task2ExeType.ND || x.TType == TType))
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Ricerca task dato tipo + num max (desc)
|
||||
/// </summary>
|
||||
/// <param name="TaskId">TaskId da cui deriva</param>
|
||||
/// <returns></returns>
|
||||
public List<DatabaseModels.TaskExecModel> TaskExeGetFilt(int TaskId, int maxRec)
|
||||
{
|
||||
List<DatabaseModels.TaskExecModel> dbResult = new List<DatabaseModels.TaskExecModel>();
|
||||
using (var dbCtx = new MoonPro_STATSContext(_configuration))
|
||||
{
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetTaskExe
|
||||
.Include(x => x.TaskListNav)
|
||||
.Where(x => (x.TaskId == TaskId))
|
||||
.OrderByDescending(x => x.DtStart)
|
||||
.Take(maxRec)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco tabella ODL da filtro
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user