Files
2021-03-26 17:17:28 +01:00

129 lines
3.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using GPW_data;
using SteamWare;
using System.Globalization;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace GPW_Commesse
{
public class BaseUserControl : SteamWare.UserControl
{
#region Public Events
/// <summary>
/// Evento cancel
/// </summary>
public event EventHandler ehCancel;
/// <summary>
/// Evento save
/// </summary>
public event EventHandler ehSave;
#endregion Public Events
#region Protected Properties
/// <summary>
/// idxDipendente in sessione
/// </summary>
protected int idxDip
{
get
{
return memLayer.ML.IntSessionObj("idxDipBCode");
}
set
{
memLayer.ML.setSessionVal("idxDipBCode", value);
}
}
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Sollevo evento cancel
/// </summary>
protected void raiseCancel()
{
if (ehCancel != null)
{
ehCancel(this, new EventArgs());
}
}
/// <summary>
/// Sollevo evento save
/// </summary>
protected void raiseSave()
{
if (ehSave != null)
{
ehSave(this, new EventArgs());
}
}
#endregion Protected Methods
#region Public Methods
/// <summary>
/// Verifica se il valore sia > limitValue
/// </summary>
/// <param name="_valore"></param>
/// <param name="minVal"></param>
/// <param name="maxVal"></param>
/// <returns></returns>
public bool betweenVal(object _valore, double minVal, double maxVal)
{
bool answ = false;
if (_valore != null)
{
double valore = 0;
_ = double.TryParse(_valore.ToString(), out valore);
answ = valore <= maxVal && valore >= minVal;
}
return answ;
}
/// <summary>
/// Verifica se il valore sia > limitValue
/// </summary>
/// <param name="_valore"></param>
/// <param name="maxVal"></param>
/// <returns></returns>
public bool gtVal(object _valore, double maxVal)
{
bool answ = false;
if (_valore != null)
{
double valore = 0;
_ = double.TryParse(_valore.ToString(), out valore);
answ = valore > maxVal;
}
return answ;
}
/// <summary>
/// Verifica se il valore sia > 0
/// </summary>
/// <param name="_valore"></param>
/// <returns></returns>
public bool gtZero(object _valore)
{
bool answ = false;
decimal valore = 0;
decimal.TryParse(_valore.ToString(), out valore);
answ = valore > 0;
return answ;
}
#endregion Public Methods
}
}