Files
mapo-core/MP-TAB-SERV/Components/TechSheet_ST_ObjView.razor.cs
T
2023-10-26 12:10:52 +02:00

92 lines
2.6 KiB
C#

using global::System;
using global::System.Collections.Generic;
using global::System.Linq;
using global::System.Threading.Tasks;
using global::Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP_TAB_SERV;
using MP_TAB_SERV.Shared;
using MP_TAB_SERV.Components;
using MP.Data;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using MP.Data.Services;
using Newtonsoft.Json;
using NLog;
using System.ComponentModel.DataAnnotations;
namespace MP_TAB_SERV.Components
{
public partial class TechSheet_ST_ObjView
{
[Parameter]
public ST_ActRow CurrRec { get; set; } = null!;
[Inject]
protected SharedMemService SMServ { get; set; } = null!;
protected override void OnParametersSet()
{
enableForceParamSchedaTecnica = SMServ.GetConfBool("enableForceParamSchedaTecnica");
hasDeroga = false;
#if false
try
{
var currDeroga = DataLayerObj.getDerogaSt(idxST);
answ = (currDeroga != null);
if (answ)
{
answ = (currDeroga.CanForce && currDeroga.Num == dataNum && currDeroga.CodGruppo == dataGroup && currDeroga.CodTipo == dataType && currDeroga.Oggetto == dataOggetto);
}
}
catch
{ }
#endif
}
private bool enableForceParamSchedaTecnica = false;
public string dataCss
{
get
{
string answ = "";
if (CurrRec.Required)
{
if (CurrRec.Value != CurrRec.ExtCode)
{
answ = " text-danger";
}
else
{
answ = " text-success";
}
}
return answ;
}
}
public string derogaCss
{
get
{
string answ = enableForceParamSchedaTecnica && hasDeroga ? " bg-warning" : "";
return answ;
}
}
private bool hasDeroga = false;
private bool showError = false;
private bool showChecked = false;
}
}