OK gestione update grafico
This commit is contained in:
@@ -5,6 +5,7 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
@@ -81,5 +82,77 @@ namespace WebDoorCreator.Data.DbModels
|
||||
|
||||
//[ForeignKey("DoorOpTypId")]
|
||||
//public virtual DoorOpTypeModel? DoorOpTypeNav { get; set; }
|
||||
|
||||
|
||||
[NotMapped]
|
||||
public Dictionary<string, string> CurrVals
|
||||
{
|
||||
get
|
||||
{
|
||||
Dictionary<string, string> answ = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(JsoncActVal))
|
||||
{
|
||||
try
|
||||
{
|
||||
var deserialized = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsoncActVal);
|
||||
answ = deserialized ?? new Dictionary<string, string>();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
JsoncActVal = JsonConvert.SerializeObject(value);
|
||||
}
|
||||
}
|
||||
[NotMapped]
|
||||
public Dictionary<string, List<string>> GraphicParams
|
||||
{
|
||||
get
|
||||
{
|
||||
Dictionary<string, List<string>> answ = new Dictionary<string, List<string>>();
|
||||
if (!string.IsNullOrEmpty(JsoncConfigVal))
|
||||
{
|
||||
try
|
||||
{
|
||||
var deserialized = JsonConvert.DeserializeObject<Dictionary<string, List<string>>>(JsoncConfigVal);
|
||||
answ = deserialized ?? new Dictionary<string, List<string>>();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
JsoncConfigVal = JsonConvert.SerializeObject(value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// COmparazione tra il dizionario currVal corrente e quello ricevuto
|
||||
/// </summary>
|
||||
/// <param name="newDict">Dizionario x comparazione</param>
|
||||
/// <returns></returns>
|
||||
public bool JsoncActValEquals(Dictionary<string, string> newDict)
|
||||
{
|
||||
string JsonNewVal = JsonConvert.SerializeObject(newDict);
|
||||
bool answ = JsoncActVal.Equals(JsonNewVal);
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Comparazione tra il dizionario configurazioni corrente e quello ricevuto
|
||||
/// </summary>
|
||||
/// <param name="newDict">Dizionario x comparazione</param>
|
||||
/// <returns></returns>
|
||||
public bool JsoncConfigValEquals(Dictionary<string, List<string>> newDict)
|
||||
{
|
||||
string JsonNewVal = JsonConvert.SerializeObject(newDict);
|
||||
bool answ = JsoncConfigVal.Equals(JsonNewVal);
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user