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
///
/// Evento cancel
///
public event EventHandler ehCancel;
///
/// Evento save
///
public event EventHandler ehSave;
#endregion Public Events
#region Protected Properties
///
/// idxDipendente in sessione
///
protected int idxDip
{
get
{
return memLayer.ML.IntSessionObj("idxDipBCode");
}
set
{
memLayer.ML.setSessionVal("idxDipBCode", value);
}
}
#endregion Protected Properties
#region Public Properties
///
/// controllo stato licenze!
///
public bool chkLicOk => doChkLicOk();
#endregion Public Properties
#region Private Methods
///
/// controllo stato licenze!
///
private bool doChkLicOk()
{
return (licenzeGPW.checkLicenze);
}
#endregion Private Methods
#region Protected Methods
///
/// Sollevo evento cancel
///
protected void raiseCancel()
{
if (ehCancel != null)
{
ehCancel(this, new EventArgs());
}
}
///
/// Sollevo evento save
///
protected void raiseSave()
{
if (ehSave != null)
{
ehSave(this, new EventArgs());
}
}
#endregion Protected Methods
#region Public Methods
///
/// Verifica se il valore sia > limitValue
///
///
///
///
///
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;
}
///
/// Verifica se il valore sia > limitValue
///
///
///
///
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;
}
///
/// Verifica se il valore sia > 0
///
///
///
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
}
}