Inserito detail x item in details view...
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
using System;
|
||||
using AppData;
|
||||
using Newtonsoft.Json;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using AppData;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NKC_WF
|
||||
{
|
||||
@@ -50,5 +48,50 @@ namespace NKC_WF
|
||||
return SteamWare.user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
|
||||
protected Dictionary<int, string> anagMateriali
|
||||
{
|
||||
set
|
||||
{
|
||||
string jsonData = JsonConvert.SerializeObject(value);
|
||||
memLayer.ML.setRSV("anagMateriali", jsonData, 60);
|
||||
}
|
||||
get
|
||||
{
|
||||
Dictionary<int, string> answ = new Dictionary<int, string>();
|
||||
//cerco in redis...
|
||||
string rawData = memLayer.ML.getRSV("anagMateriali");
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
answ = JsonConvert.DeserializeObject<Dictionary<int, string>>(rawData);
|
||||
}
|
||||
// sennò nel DB e salvo in redis...
|
||||
else
|
||||
{
|
||||
var tabMat = DataLayer.man.taMat.GetData();
|
||||
foreach (var item in tabMat)
|
||||
{
|
||||
answ.Add(item.MatID, item.MatDesc);
|
||||
}
|
||||
// salvo in redis
|
||||
anagMateriali = answ;
|
||||
}
|
||||
// restituisco
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
public string matByKey(object _matId)
|
||||
{
|
||||
string answ = "";
|
||||
int matId = 0;
|
||||
int.TryParse(_matId.ToString(), out matId);
|
||||
try
|
||||
{
|
||||
answ = anagMateriali[matId];
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user