Modifica userControl x ereditare da BaseUserControl
This commit is contained in:
@@ -7,8 +7,14 @@ using System.Web;
|
||||
|
||||
namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public class BaseUserControl : System.Web.UI.UserControl
|
||||
public class BaseUserControl : System.Web.UI.UserControl //SteamWare.UserControl //
|
||||
{
|
||||
public string encodeAuthKey(object plainUserAuthKey)
|
||||
{
|
||||
string answ = "";
|
||||
answ = SteamCrypto.EncryptString(plainUserAuthKey.ToString(), memLayer.ML.CRS("cookieName"));
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
@@ -26,7 +32,11 @@ namespace MoonProTablet.WebUserControls
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
internal DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// classe MapoDB x uso locale
|
||||
/// </summary>
|
||||
internal MapoDb.MapoDb controllerMapo = new MapoDb.MapoDb();
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
@@ -36,7 +46,16 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
/// <param name="_lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(object _lemma)
|
||||
{
|
||||
_lemma = _lemma == null ? "" : _lemma;
|
||||
return user_std.UtSn.Traduci(_lemma.ToString());
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua traduzione in inglese del lemma
|
||||
/// </summary>
|
||||
@@ -46,5 +65,168 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
return user_std.UtSn.TraduciEn(lemma);
|
||||
}
|
||||
public string TCMinSec(object _TC)
|
||||
{
|
||||
string TC_MinSec = "";
|
||||
decimal TC = 0;
|
||||
decimal.TryParse(_TC.ToString(), out TC);
|
||||
int min = 0;
|
||||
int sec = 0;
|
||||
try
|
||||
{
|
||||
// cerco di convertire in min/sec
|
||||
min = Convert.ToInt32(Math.Floor(Convert.ToDouble(TC)));
|
||||
sec = Convert.ToInt32((Convert.ToDouble(TC) - min) * 60);
|
||||
TC_MinSec = string.Format("{0}:{1:00}", min, sec);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return TC_MinSec;
|
||||
}
|
||||
/// <summary>
|
||||
/// Sotto sistema (macchina) selezionato in sessione
|
||||
/// </summary>
|
||||
public string subMaccSel
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("subMaccSel");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("subMaccSel", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// idxOdl corrente in sessione
|
||||
/// </summary>
|
||||
public int idxOdl
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("idxODL");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxODL", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// url completo immagine
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <returns></returns>
|
||||
public string ImgUrlMacc(object url)
|
||||
{
|
||||
if (string.IsNullOrEmpty(url.ToString()))
|
||||
{
|
||||
url = "empty.png";
|
||||
}
|
||||
return string.Format("./images/macchine/{0}", url);
|
||||
}
|
||||
/// <summary>
|
||||
/// url completo immagine icona
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <returns></returns>
|
||||
public string ImgUrlIcon(object url)
|
||||
{
|
||||
return string.Format("./images/iconDic/{0}.png", url);
|
||||
}
|
||||
/// <summary>
|
||||
/// titolo pagina
|
||||
/// </summary>
|
||||
public string titolo
|
||||
{
|
||||
get
|
||||
{
|
||||
return devicesAuthProxy.getPage(Request.Url);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// fomratta durata in minuti/ore/gg a seconda del totale...
|
||||
/// </summary>
|
||||
/// <param name="minuti"></param>
|
||||
/// <returns></returns>
|
||||
public string formatDurata(object min)
|
||||
{
|
||||
return utility.formatDurata(min);
|
||||
}
|
||||
public string urlDisegno(object _codArticolo)
|
||||
{
|
||||
// default è ND...
|
||||
string outVal = "~/Files/Disegni/ND.pdf";
|
||||
// recupero da anagrafica articoli...
|
||||
try
|
||||
{
|
||||
|
||||
DS_ProdTempi.AnagArticoliRow riga = selData.mng.rigaArt(_codArticolo.ToString());
|
||||
if (riga != null)
|
||||
{
|
||||
outVal = string.Format("~/Files/Disegni/{0}.pdf", riga.Disegno);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Attenzione! nessuna informazione trovata per l'articolo {0}", _codArticolo), tipoLog.WARNING);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in ricostruzione URL disegno:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return outVal;
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se la macchina MAIN sia MULTI (da DatiMacchina / redis...)
|
||||
/// </summary>
|
||||
internal bool isMulti
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataLayerObj.isMulti(idxMacchina);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// stringa UID univoca
|
||||
/// </summary>
|
||||
public string uid
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.UniqueID.Replace("$", "_").Replace("-", "_");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// conversione da tempo minuti/secondi a minuti centesimali
|
||||
/// </summary>
|
||||
/// <param name="valore"></param>
|
||||
/// <returns></returns>
|
||||
protected decimal minSec2Cent(TimeSpan valore)
|
||||
{
|
||||
Decimal answ = 0;
|
||||
try
|
||||
{
|
||||
answ = Math.Round((valore.Minutes + (decimal)valore.Seconds / 60), 3);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user