Completamento porting a BaseUserControl x MP_ADM

This commit is contained in:
Samuele E. Locatelli
2020-09-09 11:39:45 +02:00
parent 000ad35f18
commit 300e27ee26
41 changed files with 3476 additions and 3591 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ namespace MP_ADM
{
get
{
string pagina = SteamWare.memLayer.ML.StringSessionObj("nextPage");
string pagina = memLayer.ML.StringSessionObj("nextPage");
if (pagina == "")
{
pagina = "menu.aspx";
+99
View File
@@ -9,10 +9,74 @@ namespace MP_ADM
{
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
/// <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>
@@ -31,5 +95,40 @@ namespace MP_ADM
{
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 = "";
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
}
}
+72 -72
View File
@@ -3,98 +3,98 @@ using System;
namespace MP_ADM
{
public partial class Planner : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
public partial class Planner : BasePage
{
if(!Page.IsPostBack)
{
toggleVisibility();
}
checkEnabled();
string codPre = memLayer.ML.CRS("OptAdmKit_CodPre");
mod_planStats.eh_reset += Mod_planStats_eh_reset;
mod_planStats.eh_selVal += Mod_planStats_eh_selVal;
mod_planCreate.eh_ucev += Mod_planCreate_eh_ucev;
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
toggleVisibility();
}
checkEnabled();
string codPre = memLayer.ML.CRS("OptAdmKit_CodPre");
mod_planStats.eh_reset += Mod_planStats_eh_reset;
mod_planStats.eh_selVal += Mod_planStats_eh_selVal;
mod_planCreate.eh_ucev += Mod_planCreate_eh_ucev;
}
private void Mod_planCreate_eh_ucev(object sender, EventArgs e)
{
// se trovo evento select/reset mostro/nascondo dettagli...
ucEvent evento = (ucEvent)e;
switch (evento.tipoEvento)
{
case ucEvType.ReqUpdateParent:
mod_planStats.doReset();
mod_gestPromODL_OUT.resetSelezione();
break;
default:
break;
}
}
private void Mod_planCreate_eh_ucev(object sender, EventArgs e)
{
// se trovo evento select/reset mostro/nascondo dettagli...
ucEvent evento = (ucEvent)e;
switch (evento.tipoEvento)
{
case ucEvType.ReqUpdateParent:
mod_planStats.doReset();
mod_gestPromODL_OUT.resetSelezione();
break;
default:
break;
}
}
protected void lbtToggle_Click(object sender, EventArgs e)
{
toggleVisibility();
}
protected void lbtToggle_Click(object sender, EventArgs e)
{
toggleVisibility();
}
private void toggleVisibility()
{
divPromOUT.Visible = !divPromOUT.Visible;
tgIcon.Attributes["class"] = divPromOUT.Visible ? "fa fa-chevron-up" : "fa fa-chevron-down";
}
private void Mod_planStats_eh_selVal(object sender, EventArgs e)
{
fixSelStat();
}
private void toggleVisibility()
{
divPromOUT.Visible = !divPromOUT.Visible;
tgIcon.Attributes["class"] = divPromOUT.Visible ? "fa fa-chevron-up" : "fa fa-chevron-down";
}
private void Mod_planStats_eh_selVal(object sender, EventArgs e)
{
fixSelStat();
}
private void Mod_planStats_eh_reset(object sender, EventArgs e)
{
fixSelStat();
}
private void Mod_planStats_eh_reset(object sender, EventArgs e)
{
fixSelStat();
}
protected void fixSelStat()
{
mod_planCreate.CodGruppo = mod_planStats.CodGruppo;
mod_planCreate.IdxMacchina = mod_planStats.IdxMacchina;
mod_planCreate.CodArticolo = mod_planStats.CodArticolo;
mod_planCreate.doUpdate();
}
protected void fixSelStat()
{
mod_planCreate.CodGruppo = mod_planStats.CodGruppo;
mod_planCreate.IdxMacchina = mod_planStats.IdxMacchina;
mod_planCreate.CodArticolo = mod_planStats.CodArticolo;
mod_planCreate.doUpdate();
}
private void checkEnabled()
{
bool optPar = memLayer.ML.CRB("OptAdmKitEnabled");
divContent.Visible = optPar;
lblDataImportOut.Visible = !optPar;
string messaggio = "";
if (!optPar)
{
messaggio = "Attenzione: Gestione KIT disabilitata";
lblDataImportOut.Text = messaggio;
}
}
private void checkEnabled()
{
bool optPar = memLayer.ML.CRB("OptAdmKitEnabled");
divContent.Visible = optPar;
lblDataImportOut.Visible = !optPar;
string messaggio = "";
if (!optPar)
{
messaggio = "Attenzione: Gestione KIT disabilitata";
lblDataImportOut.Text = messaggio;
}
}
private void Mod_gestKIT_eh_selKit(object sender, EventArgs e)
{
private void Mod_gestKIT_eh_selKit(object sender, EventArgs e)
{
#if false
// invio ultimo kit creato a barcode...
mod_barcode.BCodeVal = mod_gestKIT.lastKitMade;
mod_barcode.processInput();
#endif
}
}
private void Mod_barcode_eh_dataRead(object sender, EventArgs e)
{
private void Mod_barcode_eh_dataRead(object sender, EventArgs e)
{
#if false
// verifico input su KIT x lettura "grezza"
string rawInput = mod_barcode.rawInput;
mod_gestKIT.lastInput = rawInput;
mod_gestKIT.doUpdate();
#endif
}
}
private void Mod_barcode_eh_comandoRegistrato(object sender, EventArgs e)
{
private void Mod_barcode_eh_comandoRegistrato(object sender, EventArgs e)
{
#if false
// verifico input su KIT x comando completo
string BCodeVal = mod_barcode.BCodeVal;
@@ -111,6 +111,6 @@ namespace MP_ADM
}
mod_gestKIT.doUpdate();
#endif
}
}
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
namespace MP_ADM
{
public partial class StoricoTC : System.Web.UI.Page
public partial class StoricoTC : BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
+1 -1
View File
@@ -6,6 +6,6 @@ public partial class AjaxSimple : System.Web.UI.MasterPage
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Page.Title = SteamWare.memLayer.ML.CRS("_titoloPagina");
Page.Title = memLayer.ML.CRS("_titoloPagina");
}
}
+1 -1
View File
@@ -63,7 +63,7 @@ public partial class MoonPro {
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::MoonPro_site.WebUserControls.mod_menuTop Mod_menuTop1;
protected global::MP_ADM.WebUserControls.mod_menuTop Mod_menuTop1;
/// <summary>
/// Controllo UpdatePanel1.
+1 -1
View File
@@ -19,7 +19,7 @@
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Module</h5>
</div>
<p class="mb-1"><%: SteamWare.memLayer.ML.confReadString("CodModulo") %></p>
<p class="mb-1"><%: memLayer.ML.confReadString("CodModulo") %></p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
+1 -1
View File
@@ -7,7 +7,7 @@ using System.Web.UI.WebControls;
namespace MP_ADM.WebUserControls
{
public partial class cmp_HwSwInfo : System.Web.UI.UserControl
public partial class cmp_HwSwInfo : BaseUserControl
{
protected void Page_Load(object sender, EventArgs e)
{
@@ -6,7 +6,7 @@ using System.Web.UI.WebControls;
namespace MP_ADM.WebUserControls
{
public partial class mod_anagArticoli : System.Web.UI.UserControl
public partial class mod_anagArticoli : BaseUserControl
{
/// <summary>
@@ -37,7 +37,7 @@ namespace MP_ADM.WebUserControls
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// salvo in session il valore selezionato...
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false);
memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false);
// sollevo evento nuovo valore...
if (eh_selValore != null)
{
@@ -167,7 +167,7 @@ namespace MP_ADM.WebUserControls
/// </summary>
public void resetSelezione()
{
SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView));
memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView));
grView.SelectedIndex = -1;
grView.DataBind();
lblWarning.Visible = false;
+138 -151
View File
@@ -6,161 +6,148 @@ using System.Web.UI.WebControls;
namespace MP_ADM.WebUserControls
{
public partial class mod_approvProd : System.Web.UI.UserControl
{
/// <summary>
/// Oggetto datalayer specifico
/// </summary>
DataLayer DataLayerObj = new DataLayer();
protected void Page_Load(object sender, EventArgs e)
public partial class mod_approvProd : BaseUserControl
{
if (!Page.IsPostBack)
{
grView.PageSize = pageSize;
}
}
/// <summary>
/// dimensione pagina
/// </summary>
public int pageSize
{
get
{
int answ = 10;
try
protected void Page_Load(object sender, EventArgs e)
{
answ = Convert.ToInt32(txtPageSize.Text);
if (!Page.IsPostBack)
{
grView.PageSize = pageSize;
}
}
catch
{ }
return answ;
}
set
{
txtPageSize.Text = value.ToString();
}
}
/// <summary>
/// wrapper traduzione
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(object lemma)
{
return user_std.UtSn.Traduci(lemma.ToString());
}
/// <summary>
/// seleziona/deseleziona le righe indicate...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSelAll_Click(object sender, EventArgs e)
{
// seleziono tutti i valori visibili nel datagrid
CheckBox chkbox = ((CheckBox)sender);
bool isChecked = chkbox.Checked;
if (!isChecked)
{
chkbox.ToolTip = traduci("btnSelAll");
}
else
{
chkbox.ToolTip = traduci("btnDeselAll");
}
foreach (GridViewRow riga in grView.Rows)
{
((CheckBox)riga.FindControl("chkSelect")).Checked = isChecked;
}
}
/// <summary>
/// conferma dati produzione verso As400
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtApprovaProd_Click(object sender, EventArgs e)
{
foreach (GridViewRow riga in grView.Rows)
{
int IdxODL = 0;
DateTime DataRif = DateTime.Now.Date;
if (((CheckBox)riga.FindControl("chkSelect")).Checked && ((CheckBox)riga.FindControl("chkSelect")).Visible)
/// <summary>
/// dimensione pagina
/// </summary>
public int pageSize
{
try
{
IdxODL = Convert.ToInt32(((Label)riga.FindControl("lblIdxODL")).Text);
DataRif = Convert.ToDateTime(((Label)riga.FindControl("lblDataRif")).Text);
}
catch
{ }
DataLayerObj.taAs400.insProdAs400(IdxODL, DataRif);
get
{
int answ = 10;
try
{
answ = Convert.ToInt32(txtPageSize.Text);
}
catch
{ }
return answ;
}
set
{
txtPageSize.Text = value.ToString();
}
}
/// <summary>
/// seleziona/deseleziona le righe indicate...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSelAll_Click(object sender, EventArgs e)
{
// seleziono tutti i valori visibili nel datagrid
CheckBox chkbox = ((CheckBox)sender);
bool isChecked = chkbox.Checked;
if (!isChecked)
{
chkbox.ToolTip = traduci("btnSelAll");
}
else
{
chkbox.ToolTip = traduci("btnDeselAll");
}
foreach (GridViewRow riga in grView.Rows)
{
((CheckBox)riga.FindControl("chkSelect")).Checked = isChecked;
}
}
/// <summary>
/// conferma dati produzione verso As400
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtApprovaProd_Click(object sender, EventArgs e)
{
foreach (GridViewRow riga in grView.Rows)
{
int IdxODL = 0;
DateTime DataRif = DateTime.Now.Date;
if (((CheckBox)riga.FindControl("chkSelect")).Checked && ((CheckBox)riga.FindControl("chkSelect")).Visible)
{
try
{
IdxODL = Convert.ToInt32(((Label)riga.FindControl("lblIdxODL")).Text);
DataRif = Convert.ToDateTime(((Label)riga.FindControl("lblDataRif")).Text);
}
catch
{ }
DataLayerObj.taAs400.insProdAs400(IdxODL, DataRif);
}
}
grView.DataBind();
}
/// <summary>
/// salvo comando
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbt_Command(object sender, CommandEventArgs e)
{
memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument);
}
/// <summary>
/// evento selezione riga: salvo tempo e qta nei campi input...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// ricavo i dati selezionati
int IdxODL = 0;
DateTime DataRif = DateTime.Now.Date;
try
{
IdxODL = Convert.ToInt32(grView.SelectedDataKey[0]);
DataRif = Convert.ToDateTime(grView.SelectedDataKey[1]);
}
catch
{ }
// gestione buttons approvazione
string _comando = "";
if (memLayer.ML.isInSessionObject("nextObjCommand"))
{
_comando = memLayer.ML.StringSessionObj("nextObjCommand");
memLayer.ML.emptySessionVal("nextObjCommand");
}
switch (_comando)
{
case "Approva":
DataLayerObj.taAs400.insProdAs400(IdxODL, DataRif);
break;
default:
break;
}
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// cambio dim pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtPageSize_TextChanged(object sender, EventArgs e)
{
grView.PageSize = pageSize;
}
/// <summary>
/// effettua caricamento interventi pending
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtImportPending_Click(object sender, EventArgs e)
{
// forzo rilettura dati da approvare...
DataLayerObj.taAs400.ImportDati_ElencoConfermeProd();
// update tab...
grView.DataBind();
}
}
grView.DataBind();
}
/// <summary>
/// salvo comando
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbt_Command(object sender, CommandEventArgs e)
{
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument);
}
/// <summary>
/// evento selezione riga: salvo tempo e qta nei campi input...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// ricavo i dati selezionati
int IdxODL = 0;
DateTime DataRif = DateTime.Now.Date;
try
{
IdxODL = Convert.ToInt32(grView.SelectedDataKey[0]);
DataRif = Convert.ToDateTime(grView.SelectedDataKey[1]);
}
catch
{ }
// gestione buttons approvazione
string _comando = "";
if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand"))
{
_comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand");
SteamWare.memLayer.ML.emptySessionVal("nextObjCommand");
}
switch (_comando)
{
case "Approva":
DataLayerObj.taAs400.insProdAs400(IdxODL, DataRif);
break;
default:
break;
}
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// cambio dim pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtPageSize_TextChanged(object sender, EventArgs e)
{
grView.PageSize = pageSize;
}
/// <summary>
/// effettua caricamento interventi pending
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtImportPending_Click(object sender, EventArgs e)
{
// forzo rilettura dati da approvare...
DataLayerObj.taAs400.ImportDati_ElencoConfermeProd();
// update tab...
grView.DataBind();
}
}
}
+123 -159
View File
@@ -6,167 +6,131 @@ using System.Web.UI.WebControls;
namespace MP_ADM.WebUserControls
{
public partial class mod_approvazioneODL : System.Web.UI.UserControl
{
/// <summary>
/// Oggetto datalayer specifico
/// </summary>
DataLayer DataLayerObj = new DataLayer();
protected void Page_Load(object sender, EventArgs e)
public partial class mod_approvazioneODL : BaseUserControl
{
if (!Page.IsPostBack)
{
grView.PageSize = pageSize;
}
}
/// <summary>
/// dimensione pagina
/// </summary>
public int pageSize
{
get
{
int answ = 10;
try
protected void Page_Load(object sender, EventArgs e)
{
answ = Convert.ToInt32(txtPageSize.Text);
if (!Page.IsPostBack)
{
grView.PageSize = pageSize;
}
}
/// <summary>
/// dimensione pagina
/// </summary>
public int pageSize
{
get
{
int answ = 10;
try
{
answ = Convert.ToInt32(txtPageSize.Text);
}
catch
{ }
return answ;
}
set
{
txtPageSize.Text = value.ToString();
}
}
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// salvo comando
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbt_Command(object sender, CommandEventArgs e)
{
memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument);
}
/// <summary>
/// evento selezione riga: salvo tempo e qta nei campi input...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// ricavo i dati selezionati
int idxOdl = 0;
try
{
idxOdl = Convert.ToInt32(grView.SelectedValue);
}
catch
{ }
MapoDb.DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0];
// gestione buttons approvazione
string _comando = "";
if (memLayer.ML.isInSessionObject("nextObjCommand"))
{
_comando = memLayer.ML.StringSessionObj("nextObjCommand");
memLayer.ML.emptySessionVal("nextObjCommand");
}
switch (_comando)
{
case "Approva":
DataLayerObj.taODL.approvaTC(idxOdl, string.Format("{0}{1}Approvato da: {2}", rigaOdl.Note, Environment.NewLine, user_std.UtSn.CognomeNome), user_std.UtSn.CognomeNome, true);
break;
case "Rifiuta":
DataLayerObj.taODL.approvaTC(idxOdl, string.Format("{0}{1}Rifiutato da: {2}", rigaOdl.Note, Environment.NewLine, user_std.UtSn.CognomeNome), user_std.UtSn.CognomeNome, false);
break;
default:
break;
}
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// cambio dim pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtPageSize_TextChanged(object sender, EventArgs e)
{
grView.PageSize = pageSize;
}
/// <summary>
/// Classe css colore testo calcolato in abse ai TC
/// </summary>
/// <param name="_tcAssegnato"></param>
/// <param name="_tcAttrezzato"></param>
/// <returns></returns>
public string cssFromTempi(object _tcAssegnato, object _tcAttrezzato)
{
string answ = "text-dark";
double tcAssegnato = 0;
double tcAttrezzato = 0;
double.TryParse(_tcAssegnato.ToString(), out tcAssegnato);
double.TryParse(_tcAttrezzato.ToString(), out tcAttrezzato);
if (tcAttrezzato > tcAssegnato)
{
answ = "text-danger";
}
else
if (tcAttrezzato < tcAssegnato)
{
answ = "text-success";
}
return answ;
}
catch
{ }
return answ;
}
set
{
txtPageSize.Text = value.ToString();
}
}
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// salvo comando
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbt_Command(object sender, CommandEventArgs e)
{
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument);
}
/// <summary>
/// evento selezione riga: salvo tempo e qta nei campi input...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// ricavo i dati selezionati
int idxOdl = 0;
try
{
idxOdl = Convert.ToInt32(grView.SelectedValue);
}
catch
{ }
MapoDb.DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0];
// gestione buttons approvazione
string _comando = "";
if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand"))
{
_comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand");
SteamWare.memLayer.ML.emptySessionVal("nextObjCommand");
}
switch (_comando)
{
case "Approva":
DataLayerObj.taODL.approvaTC(idxOdl, string.Format("{0}{1}Approvato da: {2}", rigaOdl.Note, Environment.NewLine, user_std.UtSn.CognomeNome), user_std.UtSn.CognomeNome, true);
break;
case "Rifiuta":
DataLayerObj.taODL.approvaTC(idxOdl, string.Format("{0}{1}Rifiutato da: {2}", rigaOdl.Note, Environment.NewLine, user_std.UtSn.CognomeNome), user_std.UtSn.CognomeNome, false);
break;
default:
break;
}
grView.SelectedIndex = -1;
grView.DataBind();
}
/// <summary>
/// cambio dim pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtPageSize_TextChanged(object sender, EventArgs e)
{
grView.PageSize = pageSize;
}
/// <summary>
/// formatta in minuti/sec partendo da min.cent
/// </summary>
/// <param name="minCent"></param>
/// <returns></returns>
public string minSec(object minCent)
{
string answ = "";
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;
}
/// <summary>
/// Classe css colore testo calcolato in abse ai TC
/// </summary>
/// <param name="_tcAssegnato"></param>
/// <param name="_tcAttrezzato"></param>
/// <returns></returns>
public string cssFromTempi(object _tcAssegnato, object _tcAttrezzato)
{
string answ = "text-dark";
double tcAssegnato = 0;
double tcAttrezzato = 0;
double.TryParse(_tcAssegnato.ToString(), out tcAssegnato);
double.TryParse(_tcAttrezzato.ToString(), out tcAttrezzato);
if (tcAttrezzato > tcAssegnato)
{
answ = "text-danger";
}
else
if (tcAttrezzato < tcAssegnato)
{
answ = "text-success";
}
return answ;
}
}
}
File diff suppressed because it is too large Load Diff
+8 -4
View File
@@ -1,9 +1,13 @@
using System;
public partial class mod_fixCal : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
namespace MP_ADM.WebUserControls
{
public partial class mod_fixCal : BaseUserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
+24 -20
View File
@@ -10,23 +10,27 @@
public partial class mod_fixCal {
/// <summary>
/// TextBox1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox TextBox1;
/// <summary>
/// CalendarExtender1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::AjaxControlToolkit.CalendarExtender CalendarExtender1;
}
namespace MP_ADM.WebUserControls
{
public partial class mod_fixCal
{
/// <summary>
/// TextBox1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox TextBox1;
/// <summary>
/// CalendarExtender1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::AjaxControlToolkit.CalendarExtender CalendarExtender1;
}
}
+6 -6
View File
@@ -2,12 +2,12 @@
namespace MP_ADM.WebUserControls
{
public partial class mod_footer : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
public partial class mod_footer : BaseUserControl
{
lblLastUpdt.Text = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss");
lblVers.Text = string.Format("v.{0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
protected void Page_Load(object sender, EventArgs e)
{
lblLastUpdt.Text = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss");
lblVers.Text = string.Format("v.{0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
}
}
}
}
+226 -249
View File
@@ -4,266 +4,243 @@ using System;
namespace MP_ADM.WebUserControls
{
public partial class mod_gestKIT : System.Web.UI.UserControl
{
/// <summary>
/// Oggetto datalayer specifico
/// </summary>
DataLayer DataLayerObj = new DataLayer();
public event EventHandler eh_selKit;
#region setup VARS
/// <summary>
/// RegExp x RESET / CANCEL
/// </summary>
protected string regExp_KO = memLayer.ML.cdv("regExp_KO");
/// <summary>
/// RegExp x CONFERMA
/// </summary>
protected string regExp_OK = memLayer.ML.cdv("regExp_OK");
/// <summary>
/// RegExp x START KIT
/// </summary>
protected string regExp_KitStart = memLayer.ML.cdv("regExp_KitStart");
/// <summary>
/// RegExp x SAVE KIT
/// </summary>
protected string regExp_KitSave = memLayer.ML.cdv("regExp_KitSave");
#endregion
#region variabili in sessione
/// <summary>
/// UID formattato con "_"
/// </summary>
public string uid
public partial class mod_gestKIT : BaseUserControl
{
get
{
return this.UniqueID.Replace("$", "_").Replace("-", "_");
}
}
/// <summary>
/// titolo pagina
/// </summary>
public string titolo
{
get
{
return devicesAuthProxy.getPage(Request.Url).Replace(".aspx", "");
}
}
public string codKitTemp
{
get
{
return memLayer.ML.StringSessionObj(string.Format("codKitTemp_{0}", uid));
}
set
{
memLayer.ML.setSessionVal(string.Format("codKitTemp_{0}", uid), value);
hlCodKitTemp.Value = value;
grViewWSK.DataBind();
}
}
/// <summary>
/// Ultimo Codice KIT creato
/// </summary>
public string lastKitMade
{
get
{
return memLayer.ML.StringSessionObj("lastKitMade");
}
set
{
memLayer.ML.setSessionVal("lastKitMade", value);
}
}
/// <summary>
/// Aggiunge (in obj OrdineKit) l'ordine coi parametri indicati
/// </summary>
/// <param name="codOrd"></param>
/// <param name="codArt"></param>
/// <param name="descArt"></param>
/// <param name="qta"></param>
/// <returns></returns>
public bool addOrdArt(string codOrd, string codArt, string descArt, int qta)
{
bool answ = false;
// verifico di avere un codiceKIT
checkCodKit();
// salvo info x il cod temporaneo...
DataLayerObj.taWKS.insertQuery(codKitTemp, codOrd, codArt, descArt, qta);
// verifico SE HO un KIT riconosciuto e quindi un CodArt di KIT valido...
string currCodArtKit = "###";
var TksTab = DataLayerObj.taTKS.GetData(codKitTemp, 1);
bool showPODL = false;
if (TksTab.Rows.Count > 0)
{
// verifico se ho aderenza 100%...
if (TksTab[0].TotalScore == 1)
public event EventHandler eh_selKit;
#region setup VARS
/// <summary>
/// RegExp x RESET / CANCEL
/// </summary>
protected string regExp_KO = memLayer.ML.cdv("regExp_KO");
/// <summary>
/// RegExp x CONFERMA
/// </summary>
protected string regExp_OK = memLayer.ML.cdv("regExp_OK");
/// <summary>
/// RegExp x START KIT
/// </summary>
protected string regExp_KitStart = memLayer.ML.cdv("regExp_KitStart");
/// <summary>
/// RegExp x SAVE KIT
/// </summary>
protected string regExp_KitSave = memLayer.ML.cdv("regExp_KitSave");
#endregion
#region variabili in sessione
public string codKitTemp
{
currCodArtKit = TksTab[0].CodArtParent;
showPODL = true;
get
{
return memLayer.ML.StringSessionObj(string.Format("codKitTemp_{0}", uid));
}
set
{
memLayer.ML.setSessionVal(string.Format("codKitTemp_{0}", uid), value);
hlCodKitTemp.Value = value;
grViewWSK.DataBind();
}
}
}
hfCodArtKit.Value = currCodArtKit;
divPODL.Visible = showPODL;
answ = true;
grViewWSK.DataBind();
grViewKitSel.DataBind();
grViewPODL.DataBind();
grViewIstanzeKIT.DataBind();
return answ;
}
#endregion
/// <summary>
/// Caricamento pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
bool OptAdmKitEnabled = memLayer.ML.CRB("OptAdmKitEnabled");
if (!Page.IsPostBack && OptAdmKitEnabled)
{
doReset();
}
}
/// <summary>
/// Ultimo input registrato
/// </summary>
public string lastInput
{
get
{
return hlLastInput.Value;
}
set
{
hlLastInput.Value = value;
}
}
/// <summary>
/// Aggiorno controllo secondo ULTIMO input
/// </summary>
public void doUpdate()
{
// aggiorno label...
messOut = "";
// controllo input (reset/inizio o salva...)
if (lastInput == regExp_KO)
{
// resetto dati
doReset();
messOut = "Effettuato reset!";
}
else if (lastInput == regExp_KitStart)
{
// resetto dati
doReset();
messOut = "Inizio configurazione KIT";
}
else if (lastInput == regExp_KitSave)
{
// controllo SE HO un kit selezionato...
string currCodArtKit = "###";
var TksTab = DataLayerObj.taTKS.GetData(codKitTemp, 1);
bool showPODL = false;
if (TksTab.Rows.Count > 0)
/// <summary>
/// Ultimo Codice KIT creato
/// </summary>
public string lastKitMade
{
// verifico se ho aderenza 100%...
if (TksTab[0].TotalScore == 1)
{
currCodArtKit = TksTab[0].CodArtParent;
showPODL = true;
}
get
{
return memLayer.ML.StringSessionObj("lastKitMade");
}
set
{
memLayer.ML.setSessionVal("lastKitMade", value);
}
}
if (showPODL)
/// <summary>
/// Aggiunge (in obj OrdineKit) l'ordine coi parametri indicati
/// </summary>
/// <param name="codOrd"></param>
/// <param name="codArt"></param>
/// <param name="descArt"></param>
/// <param name="qta"></param>
/// <returns></returns>
public bool addOrdArt(string codOrd, string codArt, string descArt, int qta)
{
// in questo caso creo istanza!
creazioneIstanzaKit(currCodArtKit);
bool answ = false;
// verifico di avere un codiceKIT
checkCodKit();
// salvo info x il cod temporaneo...
DataLayerObj.taWKS.insertQuery(codKitTemp, codOrd, codArt, descArt, qta);
// verifico SE HO un KIT riconosciuto e quindi un CodArt di KIT valido...
string currCodArtKit = "###";
var TksTab = DataLayerObj.taTKS.GetData(codKitTemp, 1);
bool showPODL = false;
if (TksTab.Rows.Count > 0)
{
// verifico se ho aderenza 100%...
if (TksTab[0].TotalScore == 1)
{
currCodArtKit = TksTab[0].CodArtParent;
showPODL = true;
}
}
hfCodArtKit.Value = currCodArtKit;
divPODL.Visible = showPODL;
answ = true;
grViewWSK.DataBind();
grViewKitSel.DataBind();
grViewPODL.DataBind();
grViewIstanzeKIT.DataBind();
return answ;
}
}
else if (lastInput == regExp_OK)
{
}
// ennesimo check cod TEMP
checkCodKit();
}
#endregion
private void doReset()
{
// elimino eventuali record ODL
DataLayerObj.taWKS.deleteQuery(codKitTemp);
codKitTemp = "";
divPODL.Visible = false;
checkCodKit();
}
/// <summary>
/// Verifico SE HO un codKit Temporaneo sennò lo creo...
/// </summary>
private void checkCodKit()
{
if (codKitTemp == "")
{
// genero un NUOVO cod temp kit...
codKitTemp = string.Format("KIT_{0:yyMMdd_HHmmss}", DateTime.Now);
}
}
public string messOut
{
set
{
lblOut.Text = value;
}
get
{
return lblOut.Text;
}
}
protected void grViewKitSel_SelectedIndexChanged(object sender, EventArgs e)
{
// se ho selezionato recupero CHIAVE = CodArticolo del KIT
string CodArtParent = grViewKitSel.SelectedValue.ToString();
// crea KIT x quel CodArtParent...
creazioneIstanzaKit(CodArtParent);
}
/// <summary>
/// Crea una NUOVA istanza KIT
/// </summary>
/// <param name="CodArtParent">CodArt dell'Assieme/KIT</param>
private void creazioneIstanzaKit(string CodArtParent)
{
// calcolo NUOVO codice kit...
var tabKey = DataLayerObj.taIstK.getNewKey();
if (tabKey.Rows.Count == 1)
{
// stacco un NUOVO codice KIT
lastKitMade = tabKey[0].KeyKit;
// inserisco ISTANZA KIT!
DataLayerObj.taIstK.insertByWKS(lastKitMade, CodArtParent, codKitTemp);
// faccio reset valori WKS...
doReset();
// ora resetto ordine caricato...
messOut = string.Format("Creato NUOVA P.ODL cod {0} per il KIT {1}", lastKitMade, CodArtParent);
// sollevo evento x impostare lettura KIT a BARCODE (x conferma successiva...)
// sollevo evento nuovo valore...
if (eh_selKit != null)
/// <summary>
/// Caricamento pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
eh_selKit(this, new EventArgs());
bool OptAdmKitEnabled = memLayer.ML.CRB("OptAdmKitEnabled");
if (!Page.IsPostBack && OptAdmKitEnabled)
{
doReset();
}
}
/// <summary>
/// Ultimo input registrato
/// </summary>
public string lastInput
{
get
{
return hlLastInput.Value;
}
set
{
hlLastInput.Value = value;
}
}
/// <summary>
/// Aggiorno controllo secondo ULTIMO input
/// </summary>
public void doUpdate()
{
// aggiorno label...
messOut = "";
// controllo input (reset/inizio o salva...)
if (lastInput == regExp_KO)
{
// resetto dati
doReset();
messOut = "Effettuato reset!";
}
else if (lastInput == regExp_KitStart)
{
// resetto dati
doReset();
messOut = "Inizio configurazione KIT";
}
else if (lastInput == regExp_KitSave)
{
// controllo SE HO un kit selezionato...
string currCodArtKit = "###";
var TksTab = DataLayerObj.taTKS.GetData(codKitTemp, 1);
bool showPODL = false;
if (TksTab.Rows.Count > 0)
{
// verifico se ho aderenza 100%...
if (TksTab[0].TotalScore == 1)
{
currCodArtKit = TksTab[0].CodArtParent;
showPODL = true;
}
}
if (showPODL)
{
// in questo caso creo istanza!
creazioneIstanzaKit(currCodArtKit);
}
}
else if (lastInput == regExp_OK)
{
}
// ennesimo check cod TEMP
checkCodKit();
}
private void doReset()
{
// elimino eventuali record ODL
DataLayerObj.taWKS.deleteQuery(codKitTemp);
codKitTemp = "";
divPODL.Visible = false;
checkCodKit();
}
/// <summary>
/// Verifico SE HO un codKit Temporaneo sennò lo creo...
/// </summary>
private void checkCodKit()
{
if (codKitTemp == "")
{
// genero un NUOVO cod temp kit...
codKitTemp = string.Format("KIT_{0:yyMMdd_HHmmss}", DateTime.Now);
}
}
public string messOut
{
set
{
lblOut.Text = value;
}
get
{
return lblOut.Text;
}
}
protected void grViewKitSel_SelectedIndexChanged(object sender, EventArgs e)
{
// se ho selezionato recupero CHIAVE = CodArticolo del KIT
string CodArtParent = grViewKitSel.SelectedValue.ToString();
// crea KIT x quel CodArtParent...
creazioneIstanzaKit(CodArtParent);
}
/// <summary>
/// Crea una NUOVA istanza KIT
/// </summary>
/// <param name="CodArtParent">CodArt dell'Assieme/KIT</param>
private void creazioneIstanzaKit(string CodArtParent)
{
// calcolo NUOVO codice kit...
var tabKey = DataLayerObj.taIstK.getNewKey();
if (tabKey.Rows.Count == 1)
{
// stacco un NUOVO codice KIT
lastKitMade = tabKey[0].KeyKit;
// inserisco ISTANZA KIT!
DataLayerObj.taIstK.insertByWKS(lastKitMade, CodArtParent, codKitTemp);
// faccio reset valori WKS...
doReset();
// ora resetto ordine caricato...
messOut = string.Format("Creato NUOVA P.ODL cod {0} per il KIT {1}", lastKitMade, CodArtParent);
// sollevo evento x impostare lettura KIT a BARCODE (x conferma successiva...)
// sollevo evento nuovo valore...
if (eh_selKit != null)
{
eh_selKit(this, new EventArgs());
}
}
}
}
}
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -5,7 +5,7 @@ using System.Web.UI.WebControls;
namespace MP_ADM.WebUserControls
{
public partial class mod_gestioneDatiMacchine : System.Web.UI.UserControl
public partial class mod_gestioneDatiMacchine : BaseUserControl
{
#region area da NON modificare
@@ -31,12 +31,8 @@ namespace MP_ADM.WebUserControls
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
{
// salvo in session il valore selezionato...
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false);
// sollevo evento nuovo valore...
if (eh_selValore != null)
{
eh_selValore(this, new EventArgs());
}
memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false);
raiseSelNew();
}
/// <summary>
/// traduce gli header delle colonne
@@ -127,61 +123,29 @@ namespace MP_ADM.WebUserControls
/// <param name="e"></param>
protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
// evento come nuovo...
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
raiseNewVal();
}
#endregion
#region are public
/// <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>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView));
memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView));
grView.SelectedIndex = -1;
grView.DataBind();
lblWarning.Visible = false;
if (eh_resetSelezione != null)
{
eh_resetSelezione(this, new EventArgs());
}
raiseReset();
}
#endregion
#endregion
#region gestione eventi
public event EventHandler eh_resetSelezione;
public event EventHandler eh_nuovoValore;
public event EventHandler eh_selValore;
#endregion
#region area da modificare
+1 -1
View File
@@ -84,7 +84,7 @@ namespace MP_ADM.WebUserControls
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::MoonPro_site.WebUserControls.mod_newOdl mod_newOdl1;
protected global::MP_ADM.WebUserControls.mod_newOdl mod_newOdl1;
/// <summary>
/// Controllo divEditQta.
+5 -5
View File
@@ -120,7 +120,7 @@ namespace MP_ADM.WebUserControls
bool _allowForceUser = false;
try
{
_allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser");
_allowForceUser = memLayer.ML.CRB("_allowForceUser");
}
catch
{
@@ -146,7 +146,7 @@ namespace MP_ADM.WebUserControls
else
{
lblMessage.Text = String.Format("{0}<br>key not allowed for operation!! operation logged!!", user_std.UtSn.Traduci("AccessFail"));
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la sua key autorizzativa e' sbagliata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp"))));
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la sua key autorizzativa e' sbagliata...", Page.User.Identity.Name, user_std.UtSn.Traduci(memLayer.ML.CRS("defaultApp"))));
string _rigaLog = String.Format("User {0}\t tried to force user - wrong password - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
if (Login_Error != null)
@@ -157,7 +157,7 @@ namespace MP_ADM.WebUserControls
}
else
{
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp"))));
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(memLayer.ML.CRS("defaultApp"))));
string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
if (Login_Error != null)
@@ -187,7 +187,7 @@ namespace MP_ADM.WebUserControls
bool _allowForceUser = false;
try
{
_allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser");
_allowForceUser = memLayer.ML.CRB("_allowForceUser");
}
catch
{
@@ -216,7 +216,7 @@ namespace MP_ADM.WebUserControls
}
else
{
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp"))));
mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!<br>L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(memLayer.ML.CRS("defaultApp"))));
string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}", Page.User.Identity.Name, ddlStdUser.SelectedValue);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING);
if (Login_Error != null)
+44 -44
View File
@@ -1,91 +1,91 @@
<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_main_help" CodeBehind="mod_main_help.ascx.cs" %>
<div class="row">
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtAnagArticoli" CssClass="btn btn-outline-info btn-block py-3" OnClick="btnAnagArticoli_Click">
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtAnagArticoli" CssClass="btn btn-outline-info btn-block py-3" OnClick="btnAnagArticoli_Click">
<div><i class="fa fa-tasks fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnAnagArticoli") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestPromesseOdl" CssClass="btn btn-outline-primary btn-block py-3" OnClick="btnGestPromesseOdl_Click">
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestPromesseOdl" CssClass="btn btn-outline-primary btn-block py-3" OnClick="btnGestPromesseOdl_Click">
<div><i class="fa fa-list-ol fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnGestPromesseOdl") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestOdl" CssClass="btn btn-outline-success btn-block py-3" OnClick="btnGestOdl_Click">
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestOdl" CssClass="btn btn-outline-success btn-block py-3" OnClick="btnGestOdl_Click">
<div><i class="fa fa-wrench fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnGestOdl") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestDatiMacchina" CssClass="btn btn-outline-secondary btn-block py-3" OnClick="btnGestDatiMacchina_Click">
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestDatiMacchina" CssClass="btn btn-outline-secondary btn-block py-3" OnClick="btnGestDatiMacchina_Click">
<div><i class="fa fa-industry fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnGestDatiMacchina") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtApprovaTC" CssClass="btn btn-outline-warning btn-block py-3" OnClick="btnApprovaTC_Click"> <div><i class="fa fa-clock-o fa-4x"></i></div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtApprovaTC" CssClass="btn btn-outline-warning btn-block py-3" OnClick="btnApprovaTC_Click"> <div><i class="fa fa-clock-o fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnApprovaTC") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtApprovaProd" CssClass="btn btn-outline-danger btn-block py-3" OnClick="btnApprovaProd_Click">
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtApprovaProd" CssClass="btn btn-outline-danger btn-block py-3" OnClick="btnApprovaProd_Click">
<div><i class="fa fa-thumbs-up fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnApprovaProd") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtBCode" CssClass="btn btn-outline-info btn-block py-3" OnClick="btnBCode_Click">
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtBCode" CssClass="btn btn-outline-info btn-block py-3" OnClick="btnBCode_Click">
<div><i class="fa fa-barcode fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnBCode") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestKIT" CssClass="btn btn-outline-info btn-block py-3" OnClick="lbtGestKIT_Click">
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestKIT" CssClass="btn btn-outline-info btn-block py-3" OnClick="lbtGestKIT_Click">
<div><i class="fa fa-object-group fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnGestKIT") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestPlan" CssClass="btn btn-outline-warning btn-block py-3" OnClick="lbtGestPlan_Click">
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtGestPlan" CssClass="btn btn-outline-warning btn-block py-3" OnClick="lbtGestPlan_Click">
<div><i class="fa fa-map-signs fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnPlanner") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtDataImport" CssClass="btn btn-outline-info btn-block py-3" OnClick="lbtDataImport_Click">
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtDataImport" CssClass="btn btn-outline-info btn-block py-3" OnClick="lbtDataImport_Click">
<div><i class="fa fa-download fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnDataImport") %>
</div>
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtBCodeCtrack" CssClass="btn btn-outline-primary btn-block py-3" OnClick="lbtBCodeCtrack_Click">
</asp:LinkButton>
</div>
<div class="col-3 py-4">
<asp:LinkButton runat="server" ID="lbtBCodeCtrack" CssClass="btn btn-outline-primary btn-block py-3" OnClick="lbtBCodeCtrack_Click">
<div><i class="fa fa-barcode fa-4x"></i></div>
<div class="font-weight-bold mt-1 table-dark text-light">
<%: traduci("btnBCodeCTrack") %>
</div>
</asp:LinkButton>
</div>
</asp:LinkButton>
</div>
</div>
+11 -8
View File
@@ -3,19 +3,22 @@ using System.Configuration;
using System.Diagnostics;
using System.Web.UI;
public partial class mod_menuBottom : System.Web.UI.UserControl
namespace MP_ADM.WebUserControls
{
protected void Page_Load(object sender, EventArgs e)
public partial class mod_menuBottom : BaseUserControl
{
if (!Page.IsPostBack)
protected void Page_Load(object sender, EventArgs e)
{
// sistemo le stringhe...
//lblApp.Text = string.Format("<b>{0}</b> v.{1}.{2}", ConfigurationManager.AppSettings.Get("appName"), ConfigurationManager.AppSettings.Get("mainRev"), ConfigurationManager.AppSettings.Get("minRev"));
var versionInfo = FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);
lblCopyRight.Text = string.Format("<b>{0}</b>", versionInfo.LegalCopyright);
lblApp.Text = string.Format("{0} v.{1}", ConfigurationManager.AppSettings.Get("appName"), System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
if (!Page.IsPostBack)
{
// sistemo le stringhe...
var versionInfo = FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);
lblCopyRight.Text = string.Format("<b>{0}</b>", versionInfo.LegalCopyright);
lblApp.Text = string.Format("{0} v.{1}", ConfigurationManager.AppSettings.Get("appName"), System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
}
}
}
}
+41 -37
View File
@@ -9,41 +9,45 @@
public partial class mod_menuBottom {
/// <summary>
/// Controllo lblrev.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblrev;
/// <summary>
/// Controllo lblApp.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblApp;
/// <summary>
/// Controllo lblCopyRight.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblCopyRight;
/// <summary>
/// Controllo updtRicerca.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.UpdateProgress updtRicerca;
namespace MP_ADM.WebUserControls
{
public partial class mod_menuBottom
{
/// <summary>
/// Controllo lblrev.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblrev;
/// <summary>
/// Controllo lblApp.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblApp;
/// <summary>
/// Controllo lblCopyRight.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblCopyRight;
/// <summary>
/// Controllo updtRicerca.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.UpdateProgress updtRicerca;
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
<%@ Control Language="C#" AutoEventWireup="true" Inherits="MoonPro_site.WebUserControls.mod_menuTop"
<%@ Control Language="C#" AutoEventWireup="true" Inherits="MP_ADM.WebUserControls.mod_menuTop"
CodeBehind="mod_menuTop.ascx.cs" %>
<%-- Gestione resize --%>
@@ -19,7 +19,7 @@
<%: DateTime.Now.ToString("HH.mm.ss") %>
<asp:Label runat="server" ID="lastUpdate" CssClass="dateTimeSmall"></asp:Label>
</span>
<asp:UpdateProgress ID="updtPage" runat="server" DisplayAfter="10" DynamicLayout="true">
<asp:UpdateProgress ID="updtPage" runat="server" DisplayAfter="10" DynamicLayout="true">
<ProgressTemplate>
<div id="progress_back">
</div>
+147 -158
View File
@@ -3,179 +3,168 @@ using System;
using System.Collections.Generic;
using System.Web.UI;
namespace MoonPro_site.WebUserControls
namespace MP_ADM.WebUserControls
{
public partial class mod_menuTop : System.Web.UI.UserControl
{
private string _titleString;
#region gestione eventi
public event EventHandler eh_toggleMenuSx;
public event EventHandler eh_reqUpdateMenu;
#endregion
protected void Page_Load(object sender, EventArgs e)
public partial class mod_menuTop : BaseUserControl
{
btnLogOut.Visible = user_std.UtSn.isForcedUser;
if (memLayer.ML.isInSessionObject("doUpdateNow"))
{
doFullDataUpdate();
memLayer.ML.emptySessionVal("doUpdateNow");
}
}
protected void btnLogOut_Click(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("forceUser.aspx");
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
doFullDataUpdate();
updateWindowSize();
}
private string _titleString;
private void doFullDataUpdate()
{
// salvo i dati attuali...
string cod_cdc = SteamWare.memLayer.ML.StringSessionObj("valRicercaCdC");
string lingua = user_std.UtSn.lingua;
string USER_NAME = SteamWare.memLayer.ML.StringSessionObj("USER_NAME");
string DOMINIO = SteamWare.memLayer.ML.StringSessionObj("DOMINIO");
bool isForceUser = user_std.UtSn.isForcedUser;
// salvo i valori delle tab in session...
Dictionary<string, string> sessionParam = SteamWare.memLayer.ML.valSess2SurvUpd;
#region gestione eventi
// svuoto session e cache per rileggere i dati da Db
Session.RemoveAll();
public event EventHandler eh_toggleMenuSx;
public event EventHandler eh_reqUpdateMenu;
SteamWare.memLayer.ML.flushRegisteredCache();
#endregion
// rimemorizzo
SteamWare.memLayer.ML.setSessionVal("valRicercaCdC", cod_cdc);
user_std.UtSn.startUpUtente(DOMINIO, USER_NAME);
user_std.UtSn.lingua = lingua;
user_std.UtSn.isForcedUser = isForceUser;
DataWrap.DW.resetVocabolario();
// risalvo in session i valori...
foreach (KeyValuePair<string, string> kvp in sessionParam)
{
SteamWare.memLayer.ML.setSessionVal(kvp.Key, kvp.Value, true);
}
// cambio visibilità del menù laterale...
if (eh_reqUpdateMenu != null)
{
eh_reqUpdateMenu(this, new EventArgs());
}
Response.Redirect(Page.Request.Url.ToString());
}
protected void bindControlli()
{
if (!Page.IsPostBack)
{
//lnkHelp.ToolTip = traduci("ApriManualeHelp");
// solo se user è auth...
if (user_std.UtSn.isAuth)
protected void Page_Load(object sender, EventArgs e)
{
//lnkShowHide.Text = user_std.UtSn.Traduci("lnkShowHide");
//lblTitle.Text = user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("titleApp"));
if (_titleString != "")
{
//// traduzione di tutti i termini
//lblMessUtente.Text = user_std.UtSn.Traduci(_titleString);
////doppio in english!
//lblMessUtenteEn.Text = "(" + user_std.UtSn.TraduciEn(_titleString) + ")";
_titleString = "";
Session["_titleString"] = _titleString;
Session["SessionUpdateMenu"] = true;
}
else
{
//string titolo = user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("welcomeApp"));
//lblMessUtente.Text = string.Format("{0} - {1}", titolo, memLayer.ML.CRS("SiteName"));
//lblMessUtenteEn.Text = "";
Session["SessionUpdateMenu"] = false;
}
btnLogOut.Text = user_std.UtSn.Traduci("LogOut");
btnUpdate.Text = user_std.UtSn.Traduci("Update");
//lblUser.Text = String.Format("{0}: {1}", user_std.UtSn.Traduci("User"), user_std.UtSn.CognomeNome);
setTimer();
setClock();
btnLogOut.Visible = user_std.UtSn.isForcedUser;
if (memLayer.ML.isInSessionObject("doUpdateNow"))
{
doFullDataUpdate();
memLayer.ML.emptySessionVal("doUpdateNow");
}
}
protected void btnLogOut_Click(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("forceUser.aspx");
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
doFullDataUpdate();
updateWindowSize();
}
}
}
/// <summary>
/// imposta il tempo di scadenza del timer x il refresh della pagina (della parte top) per evitare che la sessione sul server scada
/// </summary>
private void setTimer()
{
}
protected void lnkShowHide_Click(object sender, EventArgs e)
{
// cambio visibilità del menù laterale...
if (eh_toggleMenuSx != null)
{
eh_toggleMenuSx(this, new EventArgs());
}
}
protected void Timer1_Tick(object sender, EventArgs e)
{
setClock();
}
private void doFullDataUpdate()
{
// salvo i dati attuali...
string cod_cdc = memLayer.ML.StringSessionObj("valRicercaCdC");
string lingua = user_std.UtSn.lingua;
string USER_NAME = memLayer.ML.StringSessionObj("USER_NAME");
string DOMINIO = memLayer.ML.StringSessionObj("DOMINIO");
bool isForceUser = user_std.UtSn.isForcedUser;
// salvo i valori delle tab in session...
Dictionary<string, string> sessionParam = memLayer.ML.valSess2SurvUpd;
private void setClock()
{
//lblDateTime.Text = DateTime.Now.ToString("HH:mm:ss");
}
protected void lblUser_Click(object sender, EventArgs e)
{
Response.Redirect("./chLang.aspx");
}
// svuoto session e cache per rileggere i dati da Db
Session.RemoveAll();
memLayer.ML.flushRegisteredCache();
// rimemorizzo
memLayer.ML.setSessionVal("valRicercaCdC", cod_cdc);
user_std.UtSn.startUpUtente(DOMINIO, USER_NAME);
user_std.UtSn.lingua = lingua;
user_std.UtSn.isForcedUser = isForceUser;
DataWrap.DW.resetVocabolario();
// risalvo in session i valori...
foreach (KeyValuePair<string, string> kvp in sessionParam)
{
memLayer.ML.setSessionVal(kvp.Key, kvp.Value, true);
}
// cambio visibilità del menù laterale...
if (eh_reqUpdateMenu != null)
{
eh_reqUpdateMenu(this, new EventArgs());
}
Response.Redirect(Page.Request.Url.ToString());
}
protected void bindControlli()
{
if (!Page.IsPostBack)
{
// solo se user è auth...
if (user_std.UtSn.isAuth)
{
if (_titleString != "")
{
_titleString = "";
Session["_titleString"] = _titleString;
Session["SessionUpdateMenu"] = true;
}
else
{
Session["SessionUpdateMenu"] = false;
}
btnLogOut.Text = user_std.UtSn.Traduci("LogOut");
btnUpdate.Text = user_std.UtSn.Traduci("Update");
setTimer();
setClock();
}
}
}
/// <summary>
/// imposta il tempo di scadenza del timer x il refresh della pagina (della parte top) per evitare che la sessione sul server scada
/// </summary>
private void setTimer()
{
}
protected void lnkShowHide_Click(object sender, EventArgs e)
{
// cambio visibilità del menù laterale...
if (eh_toggleMenuSx != null)
{
eh_toggleMenuSx(this, new EventArgs());
}
}
protected void Timer1_Tick(object sender, EventArgs e)
{
setClock();
}
private void setClock()
{
//lblDateTime.Text = DateTime.Now.ToString("HH:mm:ss");
}
protected void lblUser_Click(object sender, EventArgs e)
{
Response.Redirect("./chLang.aspx");
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
btnUpdate.Text = "Update";
updateWindowSize();
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
btnUpdate.Text = "Update";
updateWindowSize();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
}
private void updateWindowSize()
{
if (HiddenHeight.Value != "")
{
memLayer.ML.setSessionVal("WindowHeight", HiddenHeight.Value, true);
}
if (HiddenWidth.Value != "")
{
memLayer.ML.setSessionVal("WindowWidth", HiddenWidth.Value);
}
}
private void updateWindowSize()
{
if (HiddenHeight.Value != "")
{
memLayer.ML.setSessionVal("WindowHeight", HiddenHeight.Value, true);
}
if (HiddenWidth.Value != "")
{
memLayer.ML.setSessionVal("WindowWidth", HiddenWidth.Value);
}
}
protected void HiddenHeight_ValueChanged(object sender, EventArgs e)
{
updateWindowSize();
}
protected void HiddenHeight_ValueChanged(object sender, EventArgs e)
{
updateWindowSize();
}
protected void HiddenWidth_ValueChanged(object sender, EventArgs e)
{
updateWindowSize();
}
protected void HiddenWidth_ValueChanged(object sender, EventArgs e)
{
updateWindowSize();
}
}
}
}
+1 -1
View File
@@ -7,7 +7,7 @@
// </generato automaticamente>
//------------------------------------------------------------------------------
namespace MoonPro_site.WebUserControls
namespace MP_ADM.WebUserControls
{
@@ -5,93 +5,93 @@ using System.Web.UI;
namespace MP_ADM.WebUserControls
{
public partial class mod_menuTopCompact : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
public partial class mod_menuTopCompact : BaseUserControl
{
string lastPage = Request.Url.LocalPath.Split('/').Last();
if (!Page.IsPostBack)
{
// fix visibilità TASK
hlTask.Visible = devicesAuthProxy.stObj.userHasRight("CT_userStart");
// se l'utente NON c'è torno a login...
if (!devicesAuthProxy.stObj.isAuth)
protected void Page_Load(object sender, EventArgs e)
{
if (lastPage != "" && lastPage != "login")
{
Session["nextPage"] = lastPage;
}
// SE non sono in "safe page"
if (memLayer.ML.CRS("_loginPages").IndexOf(lastPage) < 0)
{
Response.Redirect("login");
}
string lastPage = Request.Url.LocalPath.Split('/').Last();
if (!Page.IsPostBack)
{
// fix visibilità TASK
hlTask.Visible = devicesAuthProxy.stObj.userHasRight("CT_userStart");
// se l'utente NON c'è torno a login...
if (!devicesAuthProxy.stObj.isAuth)
{
if (lastPage != "" && lastPage != "login")
{
Session["nextPage"] = lastPage;
}
// SE non sono in "safe page"
if (memLayer.ML.CRS("_loginPages").IndexOf(lastPage) < 0)
{
Response.Redirect("login");
}
}
else
{
PagCorrente();
}
}
// controllo pagina...
bool pageAuth = devicesAuthProxy.stObj.isPageEnabled(lastPage);
// controllo pag auth...
if (!pageAuth)
{
Response.Redirect("~/login");
}
lblTitolo.Text = memLayer.ML.CRS("appName");
}
else
/// <summary>
/// salva in variabile pagina il nome della pagina corrente
/// </summary>
protected void PagCorrente()
{
PagCorrente();
string[] uri = Request.Url.LocalPath.Split('/');
// salvo pagina corrente
devicesAuthProxy.pagCorrente = uri.Last();
if (devicesAuthProxy.pagPrecedente == "")
{
devicesAuthProxy.pagPrecedente = devicesAuthProxy.pagCorrente;
}
}
}
// controllo pagina...
bool pageAuth = devicesAuthProxy.stObj.isPageEnabled(lastPage);
// controllo pag auth...
if (!pageAuth)
{
Response.Redirect("~/login");
}
lblTitolo.Text = memLayer.ML.CRS("appName");
}
/// <summary>
/// salva in variabile pagina il nome della pagina corrente
/// </summary>
protected void PagCorrente()
{
string[] uri = Request.Url.LocalPath.Split('/');
// salvo pagina corrente
devicesAuthProxy.pagCorrente = uri.Last();
if (devicesAuthProxy.pagPrecedente == "")
{
devicesAuthProxy.pagPrecedente = devicesAuthProxy.pagCorrente;
}
}
/// <summary>
/// Codice postazione di lavoro
/// </summary>
public string CodPost
{
get
{
return memLayer.ML.StringSessionObj("CodPost");
}
}
/// <summary>
/// Codice Operatore
/// </summary>
public string CodOpr
{
get
{
return memLayer.ML.StringSessionObj("CodOpr");
}
}
/// <summary>
/// Codice TASK corrente
/// </summary>
public string CurrNumTask
{
get
{
return memLayer.ML.StringSessionObj("CurrNumTask");
}
}
/// <summary>
/// Codice postazione di lavoro
/// </summary>
public string DescPost
{
get
{
string answ = "";
/// <summary>
/// Codice postazione di lavoro
/// </summary>
public string CodPost
{
get
{
return memLayer.ML.StringSessionObj("CodPost");
}
}
/// <summary>
/// Codice Operatore
/// </summary>
public string CodOpr
{
get
{
return memLayer.ML.StringSessionObj("CodOpr");
}
}
/// <summary>
/// Codice TASK corrente
/// </summary>
public string CurrNumTask
{
get
{
return memLayer.ML.StringSessionObj("CurrNumTask");
}
}
/// <summary>
/// Codice postazione di lavoro
/// </summary>
public string DescPost
{
get
{
string answ = "";
#if false
if (memLayer.ML.isInSessionObject("DescPost"))
{
@@ -107,17 +107,17 @@ namespace MP_ADM.WebUserControls
memLayer.ML.setSessionVal("DescPost", answ);
}
#endif
return answ;
}
}
/// <summary>
/// Codice Operatore
/// </summary>
public string NomeOpr
{
get
{
string answ = "";
return answ;
}
}
/// <summary>
/// Codice Operatore
/// </summary>
public string NomeOpr
{
get
{
string answ = "";
#if false
if (memLayer.ML.isInSessionObject("NomeOpr"))
{
@@ -133,8 +133,8 @@ namespace MP_ADM.WebUserControls
memLayer.ML.setSessionVal("NomeOpr", answ);
}
#endif
return answ;
}
return answ;
}
}
}
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_newOdl.ascx.cs"
Inherits="MoonPro_site.WebUserControls.mod_newOdl" %>
Inherits="MP_ADM.WebUserControls.mod_newOdl" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<div style="font-size: 0.8em; background-color: #EFEFEF;">
<div style="float: none; clear: both;">
+149 -153
View File
@@ -2,162 +2,158 @@
using SteamWare;
using System;
namespace MoonPro_site.WebUserControls
namespace MP_ADM.WebUserControls
{
public partial class mod_newOdl : System.Web.UI.UserControl
{
/// <summary>
/// Oggetto datalayer specifico
/// </summary>
DataLayer DataLayerObj = new DataLayer();
protected void Page_Load(object sender, EventArgs e)
public partial class mod_newOdl : BaseUserControl
{
}
#region gestione eventi
public event EventHandler eh_nuovoValore;
#endregion
/// <summary>
/// conferma inserimento TC
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOk_Click(object sender, EventArgs e)
{
// controllo se ho tutti i valori ok...
string CodArticolo = "";
string IdxMacchina = "";
int numPezzi = 0;
int pzPallet = 1;
decimal TCiclo = 0;
try
{
CodArticolo = ddlArticolo.SelectedValue;
IdxMacchina = ddlMacchine.SelectedValue;
//IdxMacchina = txtMacchina.Text.Trim();
// se IdxMacchina è vuoto metto null...
if (IdxMacchina == "")
protected void Page_Load(object sender, EventArgs e)
{
IdxMacchina = "0";
}
numPezzi = Convert.ToInt32(txtPezzi.Text.Trim());
TCiclo = Convert.ToDecimal(txtTempoCiclo.Text.Trim().Replace(".", ","));
pzPallet = Convert.ToInt32(txtPzPallet.Text.Trim());
DataLayerObj.taODL.InsertQuery(CodArticolo, DataLayerObj.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim());
}
catch
{
logger.lg.scriviLog(string.Format("Non sono riuscito ad inserire l'ODL con i seguenti parametri: {0} | {1} | {2} | {3} | {4}", CodArticolo, IdxMacchina, numPezzi, TCiclo, pzPallet), tipoLog.ERROR);
}
// segnalo update
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
/// <summary>
/// annullamento inserimento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCancel_Click(object sender, EventArgs e)
{
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
/// <summary>
/// aggiorno label min e centesimi
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtTempoCiclo_TextChanged(object sender, EventArgs e)
{
string text = "";
string txtMinCent = txtTempoCiclo.Text.Trim().Replace(".", ",");
int min = 0;
int sec = 0;
try
{
// cerco di convertire in min/sec
min = Convert.ToInt32(Math.Floor(Convert.ToDouble(txtMinCent)));
sec = Convert.ToInt32((Convert.ToDouble(txtMinCent) - min) * 60);
text = string.Format("{0}:{1:00}", min, sec);
}
catch
{ }
lblMinSec.Text = text;
}
/// <summary>
/// selezione articolo
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlArticolo_SelectedIndexChanged(object sender, EventArgs e)
{
showLastTimeAndNote();
}
/// <summary>
/// mostro elenco ultimi 5 tempi e note...
/// </summary>
private void showLastTimeAndNote()
{
// update tempi ciclo!
grViewTempi.DataBind();
}
/// <summary>
/// selezione impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlMacchine_SelectedIndexChanged(object sender, EventArgs e)
{
showLastTimeAndNote();
}
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
#region gestione eventi
public event EventHandler eh_nuovoValore;
#endregion
/// <summary>
/// conferma inserimento TC
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOk_Click(object sender, EventArgs e)
{
// controllo se ho tutti i valori ok...
string CodArticolo = "";
string IdxMacchina = "";
int numPezzi = 0;
int pzPallet = 1;
decimal TCiclo = 0;
try
{
CodArticolo = ddlArticolo.SelectedValue;
IdxMacchina = ddlMacchine.SelectedValue;
//IdxMacchina = txtMacchina.Text.Trim();
// se IdxMacchina è vuoto metto null...
if (IdxMacchina == "")
{
IdxMacchina = "0";
}
numPezzi = Convert.ToInt32(txtPezzi.Text.Trim());
TCiclo = Convert.ToDecimal(txtTempoCiclo.Text.Trim().Replace(".", ","));
pzPallet = Convert.ToInt32(txtPzPallet.Text.Trim());
DataLayerObj.taODL.InsertQuery(CodArticolo, DataLayerObj.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim());
}
catch
{
logger.lg.scriviLog(string.Format("Non sono riuscito ad inserire l'ODL con i seguenti parametri: {0} | {1} | {2} | {3} | {4}", CodArticolo, IdxMacchina, numPezzi, TCiclo, pzPallet), tipoLog.ERROR);
}
// segnalo update
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
/// <summary>
/// annullamento inserimento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCancel_Click(object sender, EventArgs e)
{
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
/// <summary>
/// aggiorno label min e centesimi
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtTempoCiclo_TextChanged(object sender, EventArgs e)
{
string text = "";
string txtMinCent = txtTempoCiclo.Text.Trim().Replace(".", ",");
int min = 0;
int sec = 0;
try
{
// cerco di convertire in min/sec
min = Convert.ToInt32(Math.Floor(Convert.ToDouble(txtMinCent)));
sec = Convert.ToInt32((Convert.ToDouble(txtMinCent) - min) * 60);
text = string.Format("{0}:{1:00}", min, sec);
}
catch
{ }
lblMinSec.Text = text;
}
/// <summary>
/// selezione articolo
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlArticolo_SelectedIndexChanged(object sender, EventArgs e)
{
showLastTimeAndNote();
}
/// <summary>
/// mostro elenco ultimi 5 tempi e note...
/// </summary>
private void showLastTimeAndNote()
{
// update tempi ciclo!
grViewTempi.DataBind();
}
/// <summary>
/// selezione impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlMacchine_SelectedIndexChanged(object sender, EventArgs e)
{
showLastTimeAndNote();
}
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
grViewTempi.SelectedIndex = -1;
grViewTempi.DataBind();
}
/// <summary>
/// evento selezione riga: salvo tempo e qta nei campi input...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grViewTempi_SelectedIndexChanged(object sender, EventArgs e)
{
// ricavo i dati selezionati
int idxOdl = 0;
try
{
idxOdl = Convert.ToInt32(grViewTempi.SelectedValue);
}
catch
{ }
MapoDb.DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0];
// precompilo dati pezzi/tempi
txtPezzi.Text = rigaOdl.NumPezzi.ToString();
txtTempoCiclo.Text = rigaOdl.TCAssegnato.ToString("0.00");
txtPzPallet.Text = rigaOdl.PzPallet.ToString();
}
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
grViewTempi.SelectedIndex = -1;
grViewTempi.DataBind();
}
/// <summary>
/// evento selezione riga: salvo tempo e qta nei campi input...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grViewTempi_SelectedIndexChanged(object sender, EventArgs e)
{
// ricavo i dati selezionati
int idxOdl = 0;
try
{
idxOdl = Convert.ToInt32(grViewTempi.SelectedValue);
}
catch
{ }
MapoDb.DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0];
// precompilo dati pezzi/tempi
txtPezzi.Text = rigaOdl.NumPezzi.ToString();
txtTempoCiclo.Text = rigaOdl.TCAssegnato.ToString("0.00");
txtPzPallet.Text = rigaOdl.PzPallet.ToString();
}
}
}
+80 -79
View File
@@ -1,177 +1,178 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// <generato automaticamente>
// Codice generato da uno strumento.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
// il codice viene rigenerato.
// </generato automaticamente>
//------------------------------------------------------------------------------
namespace MoonPro_site.WebUserControls
namespace MP_ADM.WebUserControls
{
public partial class mod_newOdl {
public partial class mod_newOdl
{
/// <summary>
/// ddlArticolo control.
/// Controllo ddlArticolo.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlArticolo;
/// <summary>
/// odsArticoli control.
/// Controllo odsArticoli.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsArticoli;
/// <summary>
/// ddlMacchine control.
/// Controllo ddlMacchine.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlMacchine;
/// <summary>
/// odsMacchine control.
/// Controllo odsMacchine.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsMacchine;
/// <summary>
/// txtPezzi control.
/// Controllo txtPezzi.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPezzi;
/// <summary>
/// rfvPezzi control.
/// Controllo rfvPezzi.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvPezzi;
/// <summary>
/// chkToAs400 control.
/// Controllo chkToAs400.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkToAs400;
/// <summary>
/// txtTempoCiclo control.
/// Controllo txtTempoCiclo.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtTempoCiclo;
/// <summary>
/// lblMinSec control.
/// Controllo lblMinSec.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblMinSec;
/// <summary>
/// rfvTempoCiclo control.
/// Controllo rfvTempoCiclo.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvTempoCiclo;
/// <summary>
/// txtPzPallet control.
/// Controllo txtPzPallet.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPzPallet;
/// <summary>
/// rfvPzPallet control.
/// Controllo rfvPzPallet.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvPzPallet;
/// <summary>
/// txtCommessa control.
/// Controllo txtCommessa.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtCommessa;
/// <summary>
/// btnOk control.
/// Controllo btnOk.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnOk;
/// <summary>
/// btnCancel control.
/// Controllo btnCancel.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnCancel;
/// <summary>
/// divTempi control.
/// Controllo divTempi.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divTempi;
/// <summary>
/// grViewTempi control.
/// Controllo grViewTempi.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.GridView grViewTempi;
/// <summary>
/// odsTempi control.
/// Controllo odsTempi.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsTempi;
}
+260 -264
View File
@@ -5,211 +5,207 @@ using System.Web.UI;
namespace MP_ADM.WebUserControls
{
public partial class mod_newPromessaODL : System.Web.UI.UserControl
{
/// <summary>
/// Oggetto datalayer specifico
/// </summary>
DataLayer DataLayerObj = new DataLayer();
protected void Page_Load(object sender, EventArgs e)
public partial class mod_newPromessaODL : BaseUserControl
{
if (!Page.IsPostBack)
{
setDefaults();
}
}
/// <summary>
/// Testo conferma salvataggio (create/Edit)
/// </summary>
public string testoConf
{
get
{
string answ = "Crea Promessa ODL";
if (memLayer.ML.isInSessionObject("idxProm2Edit"))
protected void Page_Load(object sender, EventArgs e)
{
answ = "Edit Promessa ODL";
if (!Page.IsPostBack)
{
setDefaults();
}
}
return answ;
}
}
public void doSelPODL()
{
// se ho una promessa da clonare copio dati da quella...
int idxProm = 0;
try
{
if (memLayer.ML.isInSessionObject("idxProm2Clone"))
/// <summary>
/// Testo conferma salvataggio (create/Edit)
/// </summary>
public string testoConf
{
idxProm = memLayer.ML.IntSessionObj("idxProm2Clone");
get
{
string answ = "Crea Promessa ODL";
if (memLayer.ML.isInSessionObject("idxProm2Edit"))
{
answ = "Edit Promessa ODL";
}
return answ;
}
}
else if (memLayer.ML.isInSessionObject("idxProm2Edit"))
public void doSelPODL()
{
idxProm = memLayer.ML.IntSessionObj("idxProm2Edit");
// se ho una promessa da clonare copio dati da quella...
int idxProm = 0;
try
{
if (memLayer.ML.isInSessionObject("idxProm2Clone"))
{
idxProm = memLayer.ML.IntSessionObj("idxProm2Clone");
}
else if (memLayer.ML.isInSessionObject("idxProm2Edit"))
{
idxProm = memLayer.ML.IntSessionObj("idxProm2Edit");
}
// provo a selezionare
var tPODL = DataLayerObj.taPODL.getByKey(idxProm);
if (tPODL.Rows.Count > 0)
{
var rPODL = tPODL[0];
txtSearch.Text = rPODL.CodArticolo;
ddlArticolo.DataBind();
ddlArticolo.SelectedValue = rPODL.CodArticolo;
ddlGruppi.DataBind();
ddlGruppi.SelectedValue = rPODL.CodGruppo;
txtNumPz.Text = rPODL.NumPezzi.ToString();
txtPzPallet.Text = rPODL.PzPallet.ToString();
txtPrio.Text = rPODL.Priorita.ToString();
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
txtTCms.Text = TempiCiclo.minSec(rPODL.TCAssegnato);
}
else
{
txtTCmc.Text = rPODL.TCAssegnato.ToString("N3");
}
ddlMacchine.SelectedValue = rPODL.IdxMacchina;
txtKeyExt.Text = rPODL.KeyRichiesta;
// svuoto se ci fosse cloning......
memLayer.ML.emptySessionVal("idxProm2Clone");
}
}
catch
{ }
}
// provo a selezionare
var tPODL = DataLayerObj.taPODL.getByKey(idxProm);
if (tPODL.Rows.Count > 0)
{
var rPODL = tPODL[0];
txtSearch.Text = rPODL.CodArticolo;
ddlArticolo.DataBind();
ddlArticolo.SelectedValue = rPODL.CodArticolo;
ddlGruppi.DataBind();
ddlGruppi.SelectedValue = rPODL.CodGruppo;
txtNumPz.Text = rPODL.NumPezzi.ToString();
txtPzPallet.Text = rPODL.PzPallet.ToString();
txtPrio.Text = rPODL.Priorita.ToString();
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
txtTCms.Text = TempiCiclo.minSec(rPODL.TCAssegnato);
}
else
{
txtTCmc.Text = rPODL.TCAssegnato.ToString("N3");
}
ddlMacchine.SelectedValue = rPODL.IdxMacchina;
txtKeyExt.Text = rPODL.KeyRichiesta;
// svuoto se ci fosse cloning......
memLayer.ML.emptySessionVal("idxProm2Clone");
}
}
catch
{ }
}
private void setDefaults()
{
// se abilitato in config inserisce i valori defaults x insert...
if (memLayer.ML.cdvb("resetDefaultPromessaOdl"))
{
txtNumPz.Text = "1";
txtPzPallet.Text = "1";
txtPrio.Text = "1";
// in base ad impostazione mostro TC come min:sec o min.cent
divTCms.Visible = false;
divTCmc.Visible = false;
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
private void setDefaults()
{
divTCms.Visible = true;
txtTCms.Text = "1:00";
// se abilitato in config inserisce i valori defaults x insert...
if (memLayer.ML.cdvb("resetDefaultPromessaOdl"))
{
txtNumPz.Text = "1";
txtPzPallet.Text = "1";
txtPrio.Text = "1";
// in base ad impostazione mostro TC come min:sec o min.cent
divTCms.Visible = false;
divTCmc.Visible = false;
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
divTCms.Visible = true;
txtTCms.Text = "1:00";
}
else
{
divTCmc.Visible = true;
txtTCmc.Text = "1.00";
}
memLayer.ML.emptySessionVal("idxProm2Clone");
memLayer.ML.emptySessionVal("idxProm2Edit");
}
}
else
protected void txtSearch_TextChanged(object sender, EventArgs e)
{
divTCmc.Visible = true;
txtTCmc.Text = "1.00";
ddlArticolo.DataBind();
}
memLayer.ML.emptySessionVal("idxProm2Clone");
memLayer.ML.emptySessionVal("idxProm2Edit");
}
}
protected void txtSearch_TextChanged(object sender, EventArgs e)
{
ddlArticolo.DataBind();
}
#region gestione eventi
#region gestione eventi
public event EventHandler eh_nuovoValore;
public event EventHandler eh_nuovoValore;
#endregion
#endregion
/// <summary>
/// conferma inserimento TC
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOk_Click(object sender, EventArgs e)
{
// controllo se ho tutti i valori ok...
string CodArticolo = "";
string Gruppo = "";
string IdxMacchina = "";
string KeyReq = "";
int numPezzi = 0;
int pzPallet = 1;
decimal TCiclo = 0;
bool attiv = false;
int prio = 0;
try
{
CodArticolo = ddlArticolo.SelectedValue;
Gruppo = ddlGruppi.SelectedValue;
IdxMacchina = ddlMacchine.SelectedValue;
KeyReq = txtKeyExt.Text.Trim();
//IdxMacchina = txtMacchina.Text.Trim();
// se IdxMacchina è vuoto metto null...
if (IdxMacchina == "")
/// <summary>
/// conferma inserimento TC
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOk_Click(object sender, EventArgs e)
{
IdxMacchina = "0";
}
numPezzi = Convert.ToInt32(txtNumPz.Text.Trim());
// controllo se ho tutti i valori ok...
string CodArticolo = "";
string Gruppo = "";
string IdxMacchina = "";
string KeyReq = "";
int numPezzi = 0;
int pzPallet = 1;
decimal TCiclo = 0;
bool attiv = false;
int prio = 0;
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
string[] sTC = txtTCms.Text.Trim().Split(':');
int numMin = 0;
int numSec = 0;
int.TryParse(sTC[0], out numMin);
int.TryParse(sTC[1], out numSec);
TCiclo = numMin + ((decimal)numSec) / 60;
}
else
{
decimal.TryParse(txtTCmc.Text.Replace(".", ","), out TCiclo);
}
pzPallet = Convert.ToInt32(txtPzPallet.Text.Trim());
attiv = chkAttiv.Checked;
int.TryParse(txtPrio.Text, out prio);
try
{
CodArticolo = ddlArticolo.SelectedValue;
Gruppo = ddlGruppi.SelectedValue;
IdxMacchina = ddlMacchine.SelectedValue;
KeyReq = txtKeyExt.Text.Trim();
//IdxMacchina = txtMacchina.Text.Trim();
// se IdxMacchina è vuoto metto null...
if (IdxMacchina == "")
{
IdxMacchina = "0";
}
numPezzi = Convert.ToInt32(txtNumPz.Text.Trim());
// controllo se sono in modalità EDIT faccio un update, altrimenti faccio un INSERT...
if (memLayer.ML.isInSessionObject("idxProm2Edit"))
{
int idxProm = memLayer.ML.IntSessionObj("idxProm2Edit");
DataLayerObj.taPODL.updateQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, idxProm);
memLayer.ML.emptySessionVal("idxProm2Edit");
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
string[] sTC = txtTCms.Text.Trim().Split(':');
int numMin = 0;
int numSec = 0;
int.TryParse(sTC[0], out numMin);
int.TryParse(sTC[1], out numSec);
TCiclo = numMin + ((decimal)numSec) / 60;
}
else
{
decimal.TryParse(txtTCmc.Text.Replace(".", ","), out TCiclo);
}
pzPallet = Convert.ToInt32(txtPzPallet.Text.Trim());
attiv = chkAttiv.Checked;
int.TryParse(txtPrio.Text, out prio);
// controllo se sono in modalità EDIT faccio un update, altrimenti faccio un INSERT...
if (memLayer.ML.isInSessionObject("idxProm2Edit"))
{
int idxProm = memLayer.ML.IntSessionObj("idxProm2Edit");
DataLayerObj.taPODL.updateQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, idxProm);
memLayer.ML.emptySessionVal("idxProm2Edit");
}
else
{
// 2018.09.25 --> inserisco PROMESSA ODL
//MapoDb.DataLayerObj.taODL.InsertQuery(CodArticolo, MapoDb.DataLayer.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim());
DataLayerObj.taPODL.insertQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, "");
}
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Non sono riuscito ad inserire la PromessaODL con i seguenti parametri: {0} | {1} | {2} | {3} | {4} | {5} | {6} | {7} | {8}{9}{10}", KeyReq, attiv, CodArticolo, IdxMacchina, numPezzi, TCiclo, prio, pzPallet, memLayer.ML.IntSessionObj("idxProm2Edit"), Environment.NewLine, exc), tipoLog.EXCEPTION);
memLayer.ML.emptySessionVal("idxProm2Edit");
}
// segnalo update
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
else
/// <summary>
/// annullamento inserimento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCancel_Click(object sender, EventArgs e)
{
// 2018.09.25 --> inserisco PROMESSA ODL
//MapoDb.DataLayerObj.taODL.InsertQuery(CodArticolo, MapoDb.DataLayer.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim());
DataLayerObj.taPODL.insertQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, "");
memLayer.ML.emptySessionVal("idxProm2Clone");
memLayer.ML.emptySessionVal("idxProm2Edit");
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Non sono riuscito ad inserire la PromessaODL con i seguenti parametri: {0} | {1} | {2} | {3} | {4} | {5} | {6} | {7} | {8}{9}{10}", KeyReq, attiv, CodArticolo, IdxMacchina, numPezzi, TCiclo, prio, pzPallet, memLayer.ML.IntSessionObj("idxProm2Edit"), Environment.NewLine, exc), tipoLog.EXCEPTION);
memLayer.ML.emptySessionVal("idxProm2Edit");
}
// segnalo update
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
/// <summary>
/// annullamento inserimento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnCancel_Click(object sender, EventArgs e)
{
memLayer.ML.emptySessionVal("idxProm2Clone");
memLayer.ML.emptySessionVal("idxProm2Edit");
if (eh_nuovoValore != null)
{
eh_nuovoValore(this, new EventArgs());
}
}
/// <summary>
/// aggiorno label min e centesimi
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtTempoCiclo_TextChanged(object sender, EventArgs e)
{
/// <summary>
/// aggiorno label min e centesimi
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtTempoCiclo_TextChanged(object sender, EventArgs e)
{
#if false
string text = "";
string txtMinCent = txtTempoCiclo.Text.Trim().Replace(".", ",");
@@ -226,87 +222,87 @@ namespace MP_ADM.WebUserControls
{ }
lblMinSec.Text = text;
#endif
}
/// <summary>
/// selezione articolo
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlArticolo_SelectedIndexChanged(object sender, EventArgs e)
{
showLastTimeAndNote();
}
/// <summary>
/// mostro elenco ultimi 5 tempi e note...
/// </summary>
private void showLastTimeAndNote()
{
// update tempi ciclo!
grViewTempi.DataBind();
}
/// <summary>
/// selezione impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlMacchine_SelectedIndexChanged(object sender, EventArgs e)
{
showLastTimeAndNote();
}
/// <summary>
/// selezione impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlGruppi_SelectedIndexChanged(object sender, EventArgs e)
{
ddlMacchine.DataBind();
}
}
/// <summary>
/// selezione articolo
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlArticolo_SelectedIndexChanged(object sender, EventArgs e)
{
showLastTimeAndNote();
}
/// <summary>
/// mostro elenco ultimi 5 tempi e note...
/// </summary>
private void showLastTimeAndNote()
{
// update tempi ciclo!
grViewTempi.DataBind();
}
/// <summary>
/// selezione impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlMacchine_SelectedIndexChanged(object sender, EventArgs e)
{
showLastTimeAndNote();
}
/// <summary>
/// selezione impianto
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlGruppi_SelectedIndexChanged(object sender, EventArgs e)
{
ddlMacchine.DataBind();
}
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
/// <summary>
/// reset della selezione
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnReset_Click(object sender, EventArgs e)
{
resetSelezione();
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
grViewTempi.SelectedIndex = -1;
grViewTempi.DataBind();
}
/// <summary>
/// evento selezione riga: salvo tempo e qta nei campi input...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grViewTempi_SelectedIndexChanged(object sender, EventArgs e)
{
// ricavo i dati selezionati
int idxOdl = 0;
try
{
idxOdl = Convert.ToInt32(grViewTempi.SelectedValue);
}
catch
{ }
DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0];
// precompilo dati pezzi/tempi
txtNumPz.Text = rigaOdl.NumPezzi.ToString();
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
txtTCms.Text = TempiCiclo.minSec(rigaOdl.TCAssegnato);
}
else
{
txtTCmc.Text = rigaOdl.TCAssegnato.ToString("N3");
}
txtPzPallet.Text = rigaOdl.PzPallet.ToString();
}
}
/// <summary>
/// resetta la selezione dei valori in caso di modifiche su altri controlli
/// </summary>
public void resetSelezione()
{
grViewTempi.SelectedIndex = -1;
grViewTempi.DataBind();
}
/// <summary>
/// evento selezione riga: salvo tempo e qta nei campi input...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void grViewTempi_SelectedIndexChanged(object sender, EventArgs e)
{
// ricavo i dati selezionati
int idxOdl = 0;
try
{
idxOdl = Convert.ToInt32(grViewTempi.SelectedValue);
}
catch
{ }
DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0];
// precompilo dati pezzi/tempi
txtNumPz.Text = rigaOdl.NumPezzi.ToString();
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
{
txtTCms.Text = TempiCiclo.minSec(rigaOdl.TCAssegnato);
}
else
{
txtTCmc.Text = rigaOdl.TCAssegnato.ToString("N3");
}
txtPzPallet.Text = rigaOdl.PzPallet.ToString();
}
}
}
@@ -67,12 +67,12 @@ public partial class mod_ricercaGenerica : ApplicationUserControl
{
if (testoRicerca == "")
{
SteamWare.memLayer.ML.emptySessionVal("valoreCercato");
SteamWare.memLayer.ML.emptySessionVal("listaMatricoleSearch");
memLayer.ML.emptySessionVal("valoreCercato");
memLayer.ML.emptySessionVal("listaMatricoleSearch");
}
else
{
SteamWare.memLayer.ML.setSessionVal("valoreCercato", testoRicerca);
memLayer.ML.setSessionVal("valoreCercato", testoRicerca);
// verifico ricerche accessorie
if (_cercaMatricole)
{
@@ -105,7 +105,7 @@ public partial class mod_ricercaGenerica : ApplicationUserControl
{
listaMatricoleSearch = listaMatricoleSearch.Remove(listaMatricoleSearch.Length - 2);
}
SteamWare.memLayer.ML.setSessionVal("listaMatricoleSearch", listaMatricoleSearch);
memLayer.ML.setSessionVal("listaMatricoleSearch", listaMatricoleSearch);
}
/// <summary>
/// ricerca utenti e salva lista username x SQL IN
@@ -123,7 +123,7 @@ public partial class mod_ricercaGenerica : ApplicationUserControl
{
listaUsernameSearch = listaUsernameSearch.Remove(listaUsernameSearch.Length - 2);
}
SteamWare.memLayer.ML.setSessionVal("listaUsernameSearch", listaUsernameSearch);
memLayer.ML.setSessionVal("listaUsernameSearch", listaUsernameSearch);
}
#endregion
@@ -135,9 +135,9 @@ public partial class mod_ricercaGenerica : ApplicationUserControl
/// </summary>
public void updateText()
{
if (SteamWare.memLayer.ML.StringSessionObj("valoreCercato") != "" && !Page.IsPostBack)
if (memLayer.ML.StringSessionObj("valoreCercato") != "" && !Page.IsPostBack)
{
testoRicerca = SteamWare.memLayer.ML.StringSessionObj("valoreCercato");
testoRicerca = memLayer.ML.StringSessionObj("valoreCercato");
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ using System.Web.UI;
namespace MP_ADM.WebUserControls
{
public partial class mod_storicoTC : System.Web.UI.UserControl
public partial class mod_storicoTC : BaseUserControl
{
protected void Page_Load(object sender, EventArgs e)
{
+13 -16
View File
@@ -1,16 +1,13 @@
<%@ Control Language="C#" AutoEventWireup="true" Inherits="MoonPro_site.WebUserControls.mod_unauthorized" Codebehind="mod_unauthorized.ascx.cs" %>
<table id="Table7" cellspacing="1" cellpadding="1" width="100%" border="0">
<tr>
<td class="UnauthAppTitle">
<asp:Label runat="server" ID="lblTitleMain" Text="MoonPro" />
</td>
</tr>
<tr>
<td>
<asp:Label id="lblTitle" CssClass="UnauthTitle" runat="server" /></td>
</tr>
<tr>
<td>
<asp:Label id="lblMess" CssClass="UnauthMess" runat="server" /></td>
</tr>
</table>
<%@ Control Language="C#" AutoEventWireup="true" Inherits="MP_ADM.WebUserControls.mod_unauthorized" CodeBehind="mod_unauthorized.ascx.cs" %>
<div class="row">
<div class="col-12">
<asp:Label runat="server" ID="lblTitleMain" CssClass="UnauthAppTitle" Text="MoonPro" />
</div>
<div class="col-12">
<asp:Label ID="lblTitle" CssClass="UnauthTitle" runat="server" />
</div>
<div class="col-12">
<asp:Label ID="lblMess" CssClass="UnauthMess" runat="server" />
</div>
</div>
@@ -1,14 +1,15 @@
using MP_ADM;
using SteamWare;
using System;
namespace MoonPro_site.WebUserControls
namespace MP_ADM.WebUserControls
{
public partial class mod_unauthorized : System.Web.UI.UserControl
public partial class mod_unauthorized : BaseUserControl
{
protected void Page_Load(object sender, EventArgs e)
{
lblTitle.Text = user_std.UtSn.Traduci("NonDisponibile");
lblMess.Text = user_std.UtSn.Traduci("NonAuth");
lblTitle.Text = traduci("NonDisponibile");
lblMess.Text = traduci("NonAuth");
}
}
}
+20 -20
View File
@@ -1,43 +1,43 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
// <generato automaticamente>
// Codice generato da uno strumento.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
// il codice viene rigenerato.
// </generato automaticamente>
//------------------------------------------------------------------------------
namespace MoonPro_site.WebUserControls
namespace MP_ADM.WebUserControls
{
public partial class mod_unauthorized {
public partial class mod_unauthorized
{
/// <summary>
/// lblTitleMain control.
/// Controllo lblTitleMain.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblTitleMain;
/// <summary>
/// lblTitle control.
/// Controllo lblTitle.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblTitle;
/// <summary>
/// lblMess control.
/// Controllo lblMess.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblMess;
}
+16 -16
View File
@@ -3,22 +3,22 @@ using System;
namespace MP_ADM
{
public partial class approvazioneODL : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
public partial class approvazioneODL : BasePage
{
checkEnabled();
protected void Page_Load(object sender, EventArgs e)
{
checkEnabled();
}
private void checkEnabled()
{
bool optPar = memLayer.ML.CRB("OptAdmApprTempiEnabled");
divContent.Visible = optPar;
string messaggio = "";
if (!optPar)
{
messaggio = "Attenzione: gestione approvazione cambio TC disabilitata";
}
lblDataImportOut.Text = messaggio;
}
}
private void checkEnabled()
{
bool optPar = memLayer.ML.CRB("OptAdmApprTempiEnabled");
divContent.Visible = optPar;
string messaggio = "";
if (!optPar)
{
messaggio = "Attenzione: gestione approvazione cambio TC disabilitata";
}
lblDataImportOut.Text = messaggio;
}
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
//------------------------------------------------------------------------------
 //------------------------------------------------------------------------------
// <generato automaticamente>
// Codice generato da uno strumento.
//
+1 -1
View File
@@ -5,7 +5,7 @@
<%@ Register Src="~/WebUserControls/mod_fixCal.ascx" tagname="mod_fixCal" tagprefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<uc2:mod_fixCal ID="mod_fixCal1" runat="server" />
<uc2:mod_fixCal runat="server" ID="mod_fixCal" />
<uc1:mod_calChiusura ID="mod_calChiusura1" runat="server" />
</asp:Content>
+6 -5
View File
@@ -9,17 +9,18 @@
public partial class calendChiusura {
public partial class calendChiusura
{
/// <summary>
/// Controllo mod_fixCal1.
/// Controllo mod_fixCal.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::mod_fixCal mod_fixCal1;
protected global::mod_fixCal mod_fixCal;
/// <summary>
/// Controllo mod_calChiusura1.
/// </summary>