diff --git a/MP-MAG/Areas/HelpPage/SampleGeneration/HelpPageSampleGenerator.cs b/MP-MAG/Areas/HelpPage/SampleGeneration/HelpPageSampleGenerator.cs
index 64b655d1..71aa8e80 100644
--- a/MP-MAG/Areas/HelpPage/SampleGeneration/HelpPageSampleGenerator.cs
+++ b/MP-MAG/Areas/HelpPage/SampleGeneration/HelpPageSampleGenerator.cs
@@ -20,6 +20,8 @@ namespace MP_MAG.Areas.HelpPage
///
public class HelpPageSampleGenerator
{
+ #region Public Constructors
+
///
/// Initializes a new instance of the class.
///
@@ -34,10 +36,9 @@ namespace MP_MAG.Areas.HelpPage
};
}
- ///
- /// Gets CLR types that are used as the content of or .
- ///
- public IDictionary ActualHttpMessageTypes { get; internal set; }
+ #endregion Public Constructors
+
+ #region Public Properties
///
/// Gets the objects that are used directly as samples for certain actions.
@@ -45,9 +46,9 @@ namespace MP_MAG.Areas.HelpPage
public IDictionary ActionSamples { get; internal set; }
///
- /// Gets the objects that are serialized as samples by the supported formatters.
+ /// Gets CLR types that are used as the content of or .
///
- public IDictionary SampleObjects { get; internal set; }
+ public IDictionary ActualHttpMessageTypes { get; internal set; }
///
/// Gets factories for the objects that the supported formatters will serialize as samples. Processed in order,
@@ -62,23 +63,138 @@ namespace MP_MAG.Areas.HelpPage
public IList> SampleObjectFactories { get; private set; }
///
- /// Gets the request body samples for a given .
+ /// Gets the objects that are serialized as samples by the supported formatters.
///
- /// The .
- /// The samples keyed by media type.
- public IDictionary GetSampleRequests(ApiDescription api)
+ public IDictionary SampleObjects { get; internal set; }
+
+ #endregion Public Properties
+
+ #region Private Methods
+
+ // Default factory for sample objects
+ private static object DefaultSampleObjectFactory(HelpPageSampleGenerator sampleGenerator, Type type)
{
- return GetSample(api, SampleDirection.Request);
+ // Try to create a default sample object
+ ObjectGenerator objectGenerator = new ObjectGenerator();
+ return objectGenerator.GenerateObject(type);
}
- ///
- /// Gets the response body samples for a given .
- ///
- /// The .
- /// The samples keyed by media type.
- public IDictionary GetSampleResponses(ApiDescription api)
+ private static bool IsFormatSupported(SampleDirection sampleDirection, MediaTypeFormatter formatter, Type type)
{
- return GetSample(api, SampleDirection.Response);
+ switch (sampleDirection)
+ {
+ case SampleDirection.Request:
+ return formatter.CanReadType(type);
+
+ case SampleDirection.Response:
+ return formatter.CanWriteType(type);
+ }
+ return false;
+ }
+
+ [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
+ private static string TryFormatJson(string str)
+ {
+ try
+ {
+ object parsedJson = JsonConvert.DeserializeObject(str);
+ return JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
+ }
+ catch
+ {
+ // can't parse JSON, return the original string
+ return str;
+ }
+ }
+
+ [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
+ private static string TryFormatXml(string str)
+ {
+ try
+ {
+ XDocument xml = XDocument.Parse(str);
+ return xml.ToString();
+ }
+ catch
+ {
+ // can't parse XML, return the original string
+ return str;
+ }
+ }
+
+ private static object WrapSampleIfString(object sample)
+ {
+ string stringSample = sample as string;
+ if (stringSample != null)
+ {
+ return new TextSample(stringSample);
+ }
+
+ return sample;
+ }
+
+ private IEnumerable> GetAllActionSamples(string controllerName, string actionName, IEnumerable parameterNames, SampleDirection sampleDirection)
+ {
+ HashSet parameterNamesSet = new HashSet(parameterNames, StringComparer.OrdinalIgnoreCase);
+ foreach (var sample in ActionSamples)
+ {
+ HelpPageSampleKey sampleKey = sample.Key;
+ if (String.Equals(controllerName, sampleKey.ControllerName, StringComparison.OrdinalIgnoreCase) &&
+ String.Equals(actionName, sampleKey.ActionName, StringComparison.OrdinalIgnoreCase) &&
+ (sampleKey.ParameterNames.SetEquals(new[] { "*" }) || parameterNamesSet.SetEquals(sampleKey.ParameterNames)) &&
+ sampleDirection == sampleKey.SampleDirection)
+ {
+ yield return sample;
+ }
+ }
+ }
+
+ #endregion Private Methods
+
+ #region Internal Methods
+
+ internal static Exception UnwrapException(Exception exception)
+ {
+ AggregateException aggregateException = exception as AggregateException;
+ if (aggregateException != null)
+ {
+ return aggregateException.Flatten().InnerException;
+ }
+ return exception;
+ }
+
+ #endregion Internal Methods
+
+ #region Public Methods
+
+ ///
+ /// Search for samples that are provided directly through .
+ ///
+ /// Name of the controller.
+ /// Name of the action.
+ /// The parameter names.
+ /// The CLR type.
+ /// The formatter.
+ /// The media type.
+ /// The value indicating whether the sample is for a request or for a response.
+ /// The sample that matches the parameters.
+ public virtual object GetActionSample(string controllerName, string actionName, IEnumerable parameterNames, Type type, MediaTypeFormatter formatter, MediaTypeHeaderValue mediaType, SampleDirection sampleDirection)
+ {
+ object sample;
+
+ // First, try to get the sample provided for the specified mediaType, sampleDirection, controllerName, actionName and parameterNames.
+ // If not found, try to get the sample provided for the specified mediaType, sampleDirection, controllerName and actionName regardless of the parameterNames.
+ // If still not found, try to get the sample provided for the specified mediaType and type.
+ // Finally, try to get the sample provided for the specified mediaType.
+ if (ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, parameterNames), out sample) ||
+ ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, new[] { "*" }), out sample) ||
+ ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, type), out sample) ||
+ ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType), out sample))
+ {
+ return sample;
+ }
+
+ return null;
}
///
@@ -136,37 +252,7 @@ namespace MP_MAG.Areas.HelpPage
}
///
- /// Search for samples that are provided directly through .
- ///
- /// Name of the controller.
- /// Name of the action.
- /// The parameter names.
- /// The CLR type.
- /// The formatter.
- /// The media type.
- /// The value indicating whether the sample is for a request or for a response.
- /// The sample that matches the parameters.
- public virtual object GetActionSample(string controllerName, string actionName, IEnumerable parameterNames, Type type, MediaTypeFormatter formatter, MediaTypeHeaderValue mediaType, SampleDirection sampleDirection)
- {
- object sample;
-
- // First, try to get the sample provided for the specified mediaType, sampleDirection, controllerName, actionName and parameterNames.
- // If not found, try to get the sample provided for the specified mediaType, sampleDirection, controllerName and actionName regardless of the parameterNames.
- // If still not found, try to get the sample provided for the specified mediaType and type.
- // Finally, try to get the sample provided for the specified mediaType.
- if (ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, parameterNames), out sample) ||
- ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, new[] { "*" }), out sample) ||
- ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, type), out sample) ||
- ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType), out sample))
- {
- return sample;
- }
-
- return null;
- }
-
- ///
- /// Gets the sample object that will be serialized by the formatters.
+ /// Gets the sample object that will be serialized by the formatters.
/// First, it will look at the . If no sample object is found, it will try to create
/// one using (which wraps an ) and other
/// factories in .
@@ -207,6 +293,26 @@ namespace MP_MAG.Areas.HelpPage
return sampleObject;
}
+ ///
+ /// Gets the request body samples for a given .
+ ///
+ /// The .
+ /// The samples keyed by media type.
+ public IDictionary GetSampleRequests(ApiDescription api)
+ {
+ return GetSample(api, SampleDirection.Request);
+ }
+
+ ///
+ /// Gets the response body samples for a given .
+ ///
+ /// The .
+ /// The samples keyed by media type.
+ public IDictionary GetSampleResponses(ApiDescription api)
+ {
+ return GetSample(api, SampleDirection.Response);
+ }
+
///
/// Resolves the actual type of passed to the in an action.
///
@@ -265,6 +371,7 @@ namespace MP_MAG.Areas.HelpPage
type = requestBodyParameter == null ? null : requestBodyParameter.ParameterDescriptor.ParameterType;
formatters = api.SupportedRequestBodyFormatters;
break;
+
case SampleDirection.Response:
default:
type = api.ResponseDescription.ResponseType ?? api.ResponseDescription.DeclaredType;
@@ -319,6 +426,7 @@ namespace MP_MAG.Areas.HelpPage
}
sample = new TextSample(serializedSampleString);
+ reader.Dispose();
}
else
{
@@ -354,91 +462,6 @@ namespace MP_MAG.Areas.HelpPage
return sample;
}
- internal static Exception UnwrapException(Exception exception)
- {
- AggregateException aggregateException = exception as AggregateException;
- if (aggregateException != null)
- {
- return aggregateException.Flatten().InnerException;
- }
- return exception;
- }
-
- // Default factory for sample objects
- private static object DefaultSampleObjectFactory(HelpPageSampleGenerator sampleGenerator, Type type)
- {
- // Try to create a default sample object
- ObjectGenerator objectGenerator = new ObjectGenerator();
- return objectGenerator.GenerateObject(type);
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
- private static string TryFormatJson(string str)
- {
- try
- {
- object parsedJson = JsonConvert.DeserializeObject(str);
- return JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
- }
- catch
- {
- // can't parse JSON, return the original string
- return str;
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Handling the failure by returning the original string.")]
- private static string TryFormatXml(string str)
- {
- try
- {
- XDocument xml = XDocument.Parse(str);
- return xml.ToString();
- }
- catch
- {
- // can't parse XML, return the original string
- return str;
- }
- }
-
- private static bool IsFormatSupported(SampleDirection sampleDirection, MediaTypeFormatter formatter, Type type)
- {
- switch (sampleDirection)
- {
- case SampleDirection.Request:
- return formatter.CanReadType(type);
- case SampleDirection.Response:
- return formatter.CanWriteType(type);
- }
- return false;
- }
-
- private IEnumerable> GetAllActionSamples(string controllerName, string actionName, IEnumerable parameterNames, SampleDirection sampleDirection)
- {
- HashSet parameterNamesSet = new HashSet(parameterNames, StringComparer.OrdinalIgnoreCase);
- foreach (var sample in ActionSamples)
- {
- HelpPageSampleKey sampleKey = sample.Key;
- if (String.Equals(controllerName, sampleKey.ControllerName, StringComparison.OrdinalIgnoreCase) &&
- String.Equals(actionName, sampleKey.ActionName, StringComparison.OrdinalIgnoreCase) &&
- (sampleKey.ParameterNames.SetEquals(new[] { "*" }) || parameterNamesSet.SetEquals(sampleKey.ParameterNames)) &&
- sampleDirection == sampleKey.SampleDirection)
- {
- yield return sample;
- }
- }
- }
-
- private static object WrapSampleIfString(object sample)
- {
- string stringSample = sample as string;
- if (stringSample != null)
- {
- return new TextSample(stringSample);
- }
-
- return sample;
- }
+ #endregion Public Methods
}
}
\ No newline at end of file
diff --git a/MP-MAG/BasePage.cs b/MP-MAG/BasePage.cs
index 5f76a8be..b25ecf12 100644
--- a/MP-MAG/BasePage.cs
+++ b/MP-MAG/BasePage.cs
@@ -18,6 +18,16 @@ namespace MP_MAG
#endregion Internal Fields
+ #region Protected Methods
+
+ protected override void OnInit(EventArgs e)
+ {
+ // Assuming that your page makes use of ASP.NET session state and the SessionID is stable.
+ ViewStateUserKey = Session.SessionID;
+ }
+
+ #endregion Protected Methods
+
#region Public Methods
///
diff --git a/MP-MAG/Controllers/PrintQueueController.cs b/MP-MAG/Controllers/PrintQueueController.cs
index 7d0b92b6..810e31d5 100644
--- a/MP-MAG/Controllers/PrintQueueController.cs
+++ b/MP-MAG/Controllers/PrintQueueController.cs
@@ -82,6 +82,8 @@ namespace MP_MAG.Controllers
default:
break;
}
+ // CHECK FIXME 2021.03.03: verificare sia OK dispose
+ tab.Dispose();
return answ;
}
diff --git a/MP-MAG/MP-MAG.csproj b/MP-MAG/MP-MAG.csproj
index 9ae6f732..4a4e9fe7 100644
--- a/MP-MAG/MP-MAG.csproj
+++ b/MP-MAG/MP-MAG.csproj
@@ -26,7 +26,7 @@
- 3.7
+ 4.0
true
@@ -873,6 +873,7 @@
+
compilerconfig.json
diff --git a/MP-MAG/SMART/Default.aspx.cs b/MP-MAG/SMART/Default.aspx.cs
index 6be9e8ab..7a7a9aed 100644
--- a/MP-MAG/SMART/Default.aspx.cs
+++ b/MP-MAG/SMART/Default.aspx.cs
@@ -7,11 +7,15 @@ using System.Web.UI.WebControls;
namespace MP_MAG.SMART
{
- public partial class Default : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
+ public partial class Default : BasePage
{
- Response.Redirect("menu");
+ #region Protected Methods
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ Response.Redirect("menu");
+ }
+
+ #endregion Protected Methods
}
- }
}
\ No newline at end of file
diff --git a/MP-MAG/SMART/EnrollDevice.aspx.cs b/MP-MAG/SMART/EnrollDevice.aspx.cs
index d845eb92..5a3e94e8 100644
--- a/MP-MAG/SMART/EnrollDevice.aspx.cs
+++ b/MP-MAG/SMART/EnrollDevice.aspx.cs
@@ -7,7 +7,7 @@ using System.Web.UI.WebControls;
namespace MP_MAG.SMART
{
- public partial class EnrollDevice : System.Web.UI.Page
+ public partial class EnrollDevice : BasePage
{
#region Protected Methods
diff --git a/MP-MAG/SMART/PLScanner.aspx.cs b/MP-MAG/SMART/PLScanner.aspx.cs
index 82bdc205..c9c8b493 100644
--- a/MP-MAG/SMART/PLScanner.aspx.cs
+++ b/MP-MAG/SMART/PLScanner.aspx.cs
@@ -8,7 +8,7 @@ using System.Web.UI.WebControls;
namespace MP_MAG.SMART
{
- public partial class PLScanner : System.Web.UI.Page
+ public partial class PLScanner : BasePage
{
#region Protected Methods
diff --git a/MP-MAG/SMART/Reset.aspx.cs b/MP-MAG/SMART/Reset.aspx.cs
index 14cbb4a1..8b1154cf 100644
--- a/MP-MAG/SMART/Reset.aspx.cs
+++ b/MP-MAG/SMART/Reset.aspx.cs
@@ -8,7 +8,7 @@ using System.Web.UI.WebControls;
namespace MP_MAG.SMART
{
- public partial class Reset : System.Web.UI.Page
+ public partial class Reset : BasePage
{
#region Protected Methods
diff --git a/MP-MAG/SMART/SmartStarter.aspx.cs b/MP-MAG/SMART/SmartStarter.aspx.cs
index 3a37e47d..ff9679e4 100644
--- a/MP-MAG/SMART/SmartStarter.aspx.cs
+++ b/MP-MAG/SMART/SmartStarter.aspx.cs
@@ -8,7 +8,7 @@ using System.Web.UI.WebControls;
namespace MP_MAG.SMART
{
- public partial class SmartStarter : System.Web.UI.Page
+ public partial class SmartStarter : BasePage
{
#region Private Methods
diff --git a/MP-MAG/SMART/elencoLotti.aspx.cs b/MP-MAG/SMART/elencoLotti.aspx.cs
index 9c64bbda..7e2d5998 100644
--- a/MP-MAG/SMART/elencoLotti.aspx.cs
+++ b/MP-MAG/SMART/elencoLotti.aspx.cs
@@ -4,28 +4,39 @@ using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
+
namespace MP_MAG.SMART
{
- public partial class elencoLotti : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
+ public partial class elencoLotti : BasePage
{
- if(!Page.IsPostBack)
- {
- cmp_dettLotti.Visible = false;
- }
- cmp_elencoLotti.eh_doRefresh += Cmp_elencoLotti_eh_doRefresh;
- cmp_elencoLotti.eh_doReset += Cmp_elencoLotti_eh_doReset;
+ #region Private Methods
+
+ private void Cmp_elencoLotti_eh_doRefresh(object sender, EventArgs e)
+ {
+ cmp_dettLotti.lotto = cmp_elencoLotti.LottoSel;
+ cmp_dettLotti.Visible = true;
+ }
+
+ private void Cmp_elencoLotti_eh_doReset(object sender, EventArgs e)
+ {
+ cmp_dettLotti.lotto = "0";
+ cmp_dettLotti.Visible = false;
+ }
+
+ #endregion Private Methods
+
+ #region Protected Methods
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ cmp_dettLotti.Visible = false;
+ }
+ cmp_elencoLotti.eh_doRefresh += Cmp_elencoLotti_eh_doRefresh;
+ cmp_elencoLotti.eh_doReset += Cmp_elencoLotti_eh_doReset;
+ }
+
+ #endregion Protected Methods
}
- private void Cmp_elencoLotti_eh_doRefresh(object sender, EventArgs e)
- {
- cmp_dettLotti.lotto = cmp_elencoLotti.LottoSel;
- cmp_dettLotti.Visible = true;
- }
- private void Cmp_elencoLotti_eh_doReset(object sender, EventArgs e)
- {
- cmp_dettLotti.lotto = "0";
- cmp_dettLotti.Visible = false;
- }
- }
}
\ No newline at end of file
diff --git a/MP-MAG/SMART/gestPedane.aspx.cs b/MP-MAG/SMART/gestPedane.aspx.cs
index f26c9521..a2a10a79 100644
--- a/MP-MAG/SMART/gestPedane.aspx.cs
+++ b/MP-MAG/SMART/gestPedane.aspx.cs
@@ -8,7 +8,7 @@ using System.Web.UI.WebControls;
namespace MP_MAG.SMART
{
- public partial class gestPedane : System.Web.UI.Page
+ public partial class gestPedane : BasePage
{
#region Protected Properties
diff --git a/MP-MAG/SMART/jumper.aspx.cs b/MP-MAG/SMART/jumper.aspx.cs
index a9ee3f36..622f1df3 100644
--- a/MP-MAG/SMART/jumper.aspx.cs
+++ b/MP-MAG/SMART/jumper.aspx.cs
@@ -7,11 +7,14 @@ using System.Web.UI.WebControls;
namespace MP_MAG.SMART
{
- public partial class jumper : System.Web.UI.Page
+ public partial class jumper : BasePage
{
+ #region Protected Methods
+
protected void Page_Load(object sender, EventArgs e)
{
-
}
+
+ #endregion Protected Methods
}
}
\ No newline at end of file
diff --git a/MP-MAG/SMART/menu.aspx.cs b/MP-MAG/SMART/menu.aspx.cs
index 25d97de8..8bd83ac8 100644
--- a/MP-MAG/SMART/menu.aspx.cs
+++ b/MP-MAG/SMART/menu.aspx.cs
@@ -7,7 +7,7 @@ using System.Web.UI.WebControls;
namespace MP_MAG.SMART
{
- public partial class menu : System.Web.UI.Page
+ public partial class menu : BasePage
{
#region Protected Methods
diff --git a/MP-MAG/SMART/packList.aspx.cs b/MP-MAG/SMART/packList.aspx.cs
index 28c1e9e4..d2fd9390 100644
--- a/MP-MAG/SMART/packList.aspx.cs
+++ b/MP-MAG/SMART/packList.aspx.cs
@@ -7,7 +7,7 @@ using System.Web.UI.WebControls;
namespace MP_MAG.SMART
{
- public partial class packList : System.Web.UI.Page
+ public partial class packList : BasePage
{
#region Protected Methods
diff --git a/MP-MAG/SMART/printCartOdl.aspx.cs b/MP-MAG/SMART/printCartOdl.aspx.cs
index 40835fb7..d3ee580e 100644
--- a/MP-MAG/SMART/printCartOdl.aspx.cs
+++ b/MP-MAG/SMART/printCartOdl.aspx.cs
@@ -7,7 +7,7 @@ using System.Web.UI.WebControls;
namespace MP_MAG.SMART
{
- public partial class printCartOdl : System.Web.UI.Page
+ public partial class printCartOdl : BasePage
{
#region Private Methods
diff --git a/MP-MAG/SMART/prtFiniti.aspx.cs b/MP-MAG/SMART/prtFiniti.aspx.cs
index 1972d4c2..8dcbefec 100644
--- a/MP-MAG/SMART/prtFiniti.aspx.cs
+++ b/MP-MAG/SMART/prtFiniti.aspx.cs
@@ -7,14 +7,18 @@ using System.Web.UI.WebControls;
namespace MP_MAG.SMART
{
- public partial class prtFiniti : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
+ public partial class prtFiniti : BasePage
{
- if (!Page.IsPostBack)
- {
- ((Site)this.Master).showSearch = false;
- }
+ #region Protected Methods
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ ((Site)this.Master).showSearch = false;
+ }
+ }
+
+ #endregion Protected Methods
}
- }
}
\ No newline at end of file
diff --git a/MP-MAG/SMART/prtSemilav.aspx.cs b/MP-MAG/SMART/prtSemilav.aspx.cs
index 40f2baed..7360b911 100644
--- a/MP-MAG/SMART/prtSemilav.aspx.cs
+++ b/MP-MAG/SMART/prtSemilav.aspx.cs
@@ -7,14 +7,18 @@ using System.Web.UI.WebControls;
namespace MP_MAG.SMART
{
- public partial class prtSemilav : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
+ public partial class prtSemilav : BasePage
{
- if (!Page.IsPostBack)
- {
- ((Site)this.Master).showSearch = false;
- }
+ #region Protected Methods
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ ((Site)this.Master).showSearch = false;
+ }
+ }
+
+ #endregion Protected Methods
}
- }
}
\ No newline at end of file
diff --git a/MP-MAG/SMART/tryLogin.aspx.cs b/MP-MAG/SMART/tryLogin.aspx.cs
index 78a6cd65..646a249c 100644
--- a/MP-MAG/SMART/tryLogin.aspx.cs
+++ b/MP-MAG/SMART/tryLogin.aspx.cs
@@ -7,7 +7,7 @@ using System.Web.UI.WebControls;
namespace MP_MAG.SMART
{
- public partial class tryLogin : System.Web.UI.Page
+ public partial class tryLogin : BasePage
{
#region Protected Methods
diff --git a/MP-MAG/WebUserControls/cmp_barcode.ascx.cs b/MP-MAG/WebUserControls/cmp_barcode.ascx.cs
index 16daefb0..904b5a03 100644
--- a/MP-MAG/WebUserControls/cmp_barcode.ascx.cs
+++ b/MP-MAG/WebUserControls/cmp_barcode.ascx.cs
@@ -37,7 +37,7 @@ namespace MP_MAG.WebUserControls
{
resetMessage();
}
- else if (inputAcquired == "")
+ else if (string.IsNullOrEmpty(inputAcquired))
{
raiseEvent();
}
diff --git a/MP-MAG/WebUserControls/cmp_dettLotti.ascx.cs b/MP-MAG/WebUserControls/cmp_dettLotti.ascx.cs
index 5ace1b24..4e9e6c38 100644
--- a/MP-MAG/WebUserControls/cmp_dettLotti.ascx.cs
+++ b/MP-MAG/WebUserControls/cmp_dettLotti.ascx.cs
@@ -7,63 +7,82 @@ using System.Web.UI.WebControls;
namespace MP_MAG.WebUserControls
{
- public partial class cmp_dettLotti : System.Web.UI.UserControl
- {
- ///
- /// Generico evento di richiesta refresh a aprent
- ///
- public event EventHandler eh_doRefresh;
- ///
- /// Generico evento di richiesta refresh a aprent
- ///
- public event EventHandler eh_doReset;
- protected void Page_Load(object sender, EventArgs e)
+ public partial class cmp_dettLotti : System.Web.UI.UserControl
{
- if (!Page.IsPostBack)
- {
- }
- }
- ///
- /// Lotto OUT cui fare riferimento con elenco
- ///
- public string lotto
- {
- get
- {
- return hfLotto.Value;
- }
- set
- {
- hfLotto.Value = value;
- }
- }
+ #region Public Events
- ///
- /// comando reset
- ///
- ///
- ///
- protected void lbtReset_Click(object sender, EventArgs e)
- {
- resetSelezione();
- }
+ ///
+ /// Generico evento di richiesta refresh a aprent
+ ///
+ public event EventHandler eh_doReset;
- private void resetSelezione()
- {
- grView.SelectedIndex = -1;
- grView.DataBind();
- raiseReset();
+ #endregion Public Events
+
+ #region Public Properties
+
+ ///
+ /// Lotto OUT cui fare riferimento con elenco
+ ///
+ public string lotto
+ {
+ get
+ {
+ return hfLotto.Value;
+ }
+ set
+ {
+ hfLotto.Value = value;
+ }
+ }
+
+ #endregion Public Properties
+
+ #region Private Methods
+
+ private void resetSelezione()
+ {
+ grView.SelectedIndex = -1;
+ grView.DataBind();
+ raiseReset();
+ }
+
+ #endregion Private Methods
+
+ #region Protected Methods
+
+ ///
+ /// comando reset
+ ///
+ ///
+ ///
+ protected void lbtReset_Click(object sender, EventArgs e)
+ {
+ resetSelezione();
+ }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (!Page.IsPostBack)
+ {
+ }
+ }
+
+ #endregion Protected Methods
+
+ #region Public Methods
+
+ ///
+ /// Chiamata evento
+ ///
+ public void raiseReset()
+ {
+ // se qualcuno ascolta sollevo evento nuovo valore...
+ if (eh_doReset != null)
+ {
+ eh_doReset(this, new EventArgs());
+ }
+ }
+
+ #endregion Public Methods
}
- ///
- /// Chiamata evento
- ///
- public void raiseReset()
- {
- // se qualcuno ascolta sollevo evento nuovo valore...
- if (eh_doReset != null)
- {
- eh_doReset(this, new EventArgs());
- }
- }
- }
-}
+}
\ No newline at end of file
diff --git a/MP-MAG/WebUserControls/cmp_menuTop.ascx.cs b/MP-MAG/WebUserControls/cmp_menuTop.ascx.cs
index 92a57b3b..96d30fff 100644
--- a/MP-MAG/WebUserControls/cmp_menuTop.ascx.cs
+++ b/MP-MAG/WebUserControls/cmp_menuTop.ascx.cs
@@ -124,6 +124,7 @@ namespace MP_MAG.WebUserControls
}
catch (Exception exc)
{
+ logger.lg.scriviLog($"Eccezione in updateTreeMenu {Environment.NewLine}{exc}");
if (safePages.IndexOf(Request.Url.Segments.LastOrDefault(), StringComparison.OrdinalIgnoreCase) < 0)
{
Response.Redirect("login", false);
diff --git a/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.cs b/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.cs
index 39e5ec49..e7745ac7 100644
--- a/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.cs
+++ b/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.cs
@@ -344,7 +344,7 @@ namespace MP_MAG.WebUserControls
private bool processLastCmd(bool doRaiseEv)
{
- if (lastCmd == "") doRaiseEv = true;
+ if (string.IsNullOrEmpty(lastCmd)) doRaiseEv = true;
// processiamo barcode letto
decodedData decoData = MagDataLayer.man.decodeBcode(lastValidCmd);
switch (decoData.codeType)
diff --git a/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.cs b/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.cs
index 5f8a6892..f80a99bd 100644
--- a/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.cs
+++ b/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.cs
@@ -342,7 +342,7 @@ namespace MP_MAG.WebUserControls
private bool processLastCmd(bool doRaiseEv)
{
- if (lastCmd == "") doRaiseEv = true;
+ if (string.IsNullOrEmpty(lastCmd)) doRaiseEv = true;
// processiamo barcode letto
decodedData decoData = MagDataLayer.man.decodeBcode(lastValidCmd);
switch (decoData.codeType)
diff --git a/MP-MAG/jumper.aspx.cs b/MP-MAG/jumper.aspx.cs
index 2687f880..f4f74ca2 100644
--- a/MP-MAG/jumper.aspx.cs
+++ b/MP-MAG/jumper.aspx.cs
@@ -7,11 +7,14 @@ using System.Web.UI.WebControls;
namespace MP_MAG
{
- public partial class jumper : System.Web.UI.Page
+ public partial class jumper : BasePage
{
+ #region Protected Methods
+
protected void Page_Load(object sender, EventArgs e)
{
-
}
+
+ #endregion Protected Methods
}
}
\ No newline at end of file