inizio fix area WebUserControls
This commit is contained in:
@@ -1,139 +0,0 @@
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
|
||||
namespace MP_SITE
|
||||
{
|
||||
public class BaseUserControl : System.Web.UI.UserControl
|
||||
{
|
||||
#region gestione eventi
|
||||
|
||||
public event EventHandler eh_nuovoValore;
|
||||
|
||||
public event EventHandler eh_resetSelezione;
|
||||
|
||||
public event EventHandler eh_selValore;
|
||||
|
||||
/// <summary>
|
||||
/// Solleva evento nuovo valore
|
||||
/// </summary>
|
||||
public void raiseNewVal()
|
||||
{
|
||||
// evento come nuovo...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
public void raiseSelNew()
|
||||
{
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_selValore != null)
|
||||
{
|
||||
eh_selValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Solleva evento reset
|
||||
/// </summary>
|
||||
public void raiseReset()
|
||||
{
|
||||
if (eh_resetSelezione != null)
|
||||
{
|
||||
eh_resetSelezione(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
#endregion gestione eventi
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico NON singleton x scalare
|
||||
/// </summary>
|
||||
internal DataLayer DataLayerObj = new DataLayer();
|
||||
|
||||
/// <summary>
|
||||
/// UID formattato con "_"
|
||||
/// </summary>
|
||||
public string uid
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.UniqueID.Replace("$", "_").Replace("-", "_");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// titolo pagina
|
||||
/// </summary>
|
||||
public string titolo
|
||||
{
|
||||
get
|
||||
{
|
||||
return devicesAuthProxy.getPage(Request.Url).Replace(".aspx", "");
|
||||
}
|
||||
}
|
||||
|
||||
#region utils
|
||||
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// effettua traduzione in inglese del lemma
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduciEn(string lemma)
|
||||
{
|
||||
return user_std.UtSn.TraduciEn(lemma);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// formatta in minuti/sec partendo da min.cent
|
||||
/// </summary>
|
||||
/// <param name="minCent"></param>
|
||||
/// <returns></returns>
|
||||
public string minSec(object minCent)
|
||||
{
|
||||
string answ = "";
|
||||
if (minCent != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = string.Format("{0:mm}:{0:ss}", minCent2Sec(Convert.ToDecimal(minCent.ToString().Replace(".", ","))));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// conversione da tempo minuti centesimali a minuti/secondi
|
||||
/// </summary>
|
||||
/// <param name="valore"></param>
|
||||
/// <returns></returns>
|
||||
protected TimeSpan minCent2Sec(decimal valore)
|
||||
{
|
||||
TimeSpan answ = new TimeSpan(0, 0, 1);
|
||||
try
|
||||
{
|
||||
answ = new TimeSpan(0, Convert.ToInt32(valore), Convert.ToInt32((valore - Convert.ToInt32(valore)) * 60));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion utils
|
||||
}
|
||||
}
|
||||
@@ -522,9 +522,6 @@
|
||||
<Compile Include="BasePage.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BaseUserControl.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Default.aspx.cs">
|
||||
<DependentUpon>Default.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -3,58 +3,64 @@ using System;
|
||||
|
||||
namespace MP_SITE.WebUserControls
|
||||
{
|
||||
public class baseProdControl : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// evento update
|
||||
/// </summary>
|
||||
public event EventHandler eh_doUpdate;
|
||||
protected resoconti _resoconti;
|
||||
protected int _numRighe = 17;
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
_resoconti = new resoconti();
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
aggiornamento();
|
||||
}
|
||||
}
|
||||
public virtual void aggiornamento()
|
||||
public class baseProdControl : System.Web.UI.UserControl
|
||||
{
|
||||
protected int _numRighe = 17;
|
||||
|
||||
}
|
||||
public int numRighe
|
||||
{
|
||||
get
|
||||
{
|
||||
return _numRighe;
|
||||
}
|
||||
set
|
||||
{
|
||||
_numRighe = value;
|
||||
}
|
||||
}
|
||||
public void reportUpdate()
|
||||
{
|
||||
// alzo l'evento d update/inserimento e ricarico cache...
|
||||
if (eh_doUpdate != null)
|
||||
{
|
||||
eh_doUpdate(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
protected resoconti _resoconti;
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se la macchina MAIN sia MULTI (da DatiMacchina / redis...)
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
protected bool isMulti(string idxMacchina)
|
||||
{
|
||||
return DataLayerObj.isMulti(idxMacchina);
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
private DataLayer DataLayerObj = new DataLayer();
|
||||
|
||||
/// <summary>
|
||||
/// evento update
|
||||
/// </summary>
|
||||
public event EventHandler eh_doUpdate;
|
||||
|
||||
public int numRighe
|
||||
{
|
||||
get
|
||||
{
|
||||
return _numRighe;
|
||||
}
|
||||
set
|
||||
{
|
||||
_numRighe = value;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void aggiornamento()
|
||||
{
|
||||
}
|
||||
|
||||
public void reportUpdate()
|
||||
{
|
||||
// alzo l'evento d update/inserimento e ricarico cache...
|
||||
if (eh_doUpdate != null)
|
||||
{
|
||||
eh_doUpdate(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se la macchina MAIN sia MULTI (da DatiMacchina / redis...)
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
protected bool isMulti(string idxMacchina)
|
||||
{
|
||||
return DataLayerObj.isMulti(idxMacchina);
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
_resoconti = new resoconti();
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
aggiornamento();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user