Cache x ottimizzazione velocità accesso pagina articoli
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using SteamWare;
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Web.UI.WebControls;
|
||||
@@ -9,19 +10,31 @@ namespace MP_ADM.WebUserControls
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
|
||||
public bool delEnabled(object _idx)
|
||||
{
|
||||
bool answ = false;
|
||||
string codArticolo = _idx.ToString();
|
||||
// controllo non sia stato mai prodotto sennò non posso cancellare...
|
||||
try
|
||||
string codArticolo = $"{_idx}";
|
||||
// cerco in cache redis...
|
||||
string redKeyArtUsed = DataLayer.mHash($"CACHE:CheckArtUsed:{codArticolo}");
|
||||
string rawData = memLayer.ML.getRSV(redKeyArtUsed);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
bool? usato = false;
|
||||
DataLayerObj.taAnagArt.checkUsed(codArticolo, ref usato);
|
||||
answ = !(bool)usato;
|
||||
bool.TryParse(rawData, out answ);
|
||||
}
|
||||
else
|
||||
{
|
||||
// controllo non sia stato mai prodotto sennò non posso cancellare...
|
||||
try
|
||||
{
|
||||
bool? usato = false;
|
||||
DataLayerObj.taAnagArt.checkUsed(codArticolo, ref usato);
|
||||
answ = !(bool)usato;
|
||||
memLayer.ML.setRSV(redKeyArtUsed, $"{answ}", 60 * memLayer.ML.cdvi("cacheCheckArtUsato"));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
|
||||
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
|
||||
<WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>
|
||||
|
||||
@@ -59,9 +59,6 @@
|
||||
<Reference Include="AspNet.ScriptManager.jQuery, Version=3.6.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\AspNet.ScriptManager.jQuery.3.6.0\lib\net45\AspNet.ScriptManager.jQuery.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crc32C.NET, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Crc32C.NET.1.0.5.0\lib\net20\Crc32C.NET.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DnsClient, Version=1.6.0.0, Culture=neutral, PublicKeyToken=4574bb5573c51424, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DnsClient.1.6.0\lib\net45\DnsClient.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -126,9 +123,6 @@
|
||||
<Reference Include="SharpCompress, Version=0.31.0.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpCompress.0.31.0\lib\net461\SharpCompress.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Snappy.NET, Version=1.1.1.8, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Snappy.NET.1.1.1.8\lib\net45\Snappy.NET.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\StackExchange.Redis.2.5.61\lib\net461\StackExchange.Redis.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
<package id="AspNet.ScriptManager.bootstrap" version="4.6.0" targetFramework="net462" />
|
||||
<package id="AspNet.ScriptManager.jQuery" version="3.6.0" targetFramework="net462" />
|
||||
<package id="bootstrap" version="4.6.0" targetFramework="net462" />
|
||||
<package id="Crc32C.NET" version="1.0.5.0" targetFramework="net462" />
|
||||
<package id="DnsClient" version="1.6.0" targetFramework="net462" />
|
||||
<package id="elmah" version="1.2.2" targetFramework="net462" />
|
||||
<package id="elmah.corelibrary" version="1.2.2" targetFramework="net462" />
|
||||
@@ -22,7 +21,6 @@
|
||||
<package id="Microsoft.AspNet.ScriptManager.WebForms" version="5.0.0" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.SessionState.SessionStateModule" version="1.1.0" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.Web.Optimization.it" version="1.1.3" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.Web.Optimization.WebForms" version="1.1.3" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.WebApi" version="5.2.8" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.8" targetFramework="net462" />
|
||||
@@ -52,7 +50,6 @@
|
||||
<package id="popper.js" version="1.16.1" targetFramework="net462" />
|
||||
<package id="SharpCompress" version="0.31.0" targetFramework="net462" />
|
||||
<package id="SharpZipLib" version="1.3.3" targetFramework="net462" />
|
||||
<package id="Snappy.NET" version="1.1.1.8" targetFramework="net462" />
|
||||
<package id="StackExchange.Redis" version="2.5.61" targetFramework="net462" />
|
||||
<package id="SteamWare" version="5.2.2204.2910" targetFramework="net462" />
|
||||
<package id="SteamWare.Logger" version="5.2.2204.2910" targetFramework="net462" />
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
||||
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
<NameOfLastUsedPublishProfile>IIS02</NameOfLastUsedPublishProfile>
|
||||
</PropertyGroup>
|
||||
|
||||
Reference in New Issue
Block a user