Code cleanup con CodeMaid
This commit is contained in:
@@ -4,199 +4,215 @@ using System;
|
||||
|
||||
namespace MP_ADM.WebUserControls
|
||||
{
|
||||
public partial class mod_planStats : SteamWare.UserControl
|
||||
{
|
||||
public event EventHandler eh_selVal;
|
||||
public event EventHandler eh_reset;
|
||||
/// <summary>
|
||||
/// innalzo evento in base al tipo richiesto
|
||||
/// </summary>
|
||||
protected void raiseEvent(tipoEvento evReq)
|
||||
public partial class mod_planStats : SteamWare.UserControl
|
||||
{
|
||||
switch (evReq)
|
||||
{
|
||||
case tipoEvento.reset:
|
||||
// raise dell'evento
|
||||
if (eh_reset != null)
|
||||
{
|
||||
eh_reset(this, new EventArgs());
|
||||
}
|
||||
break;
|
||||
case tipoEvento.selection:
|
||||
// raise dell'evento
|
||||
if (eh_selVal != null)
|
||||
{
|
||||
eh_selVal(this, new EventArgs());
|
||||
}
|
||||
break;
|
||||
case tipoEvento.edit:
|
||||
case tipoEvento.delete:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
cmp_numRowReparti.numRowPag = memLayer.ML.CRI("_righeDataGridShort") / 2;
|
||||
cmp_numRowMacc.numRowPag = memLayer.ML.CRI("_righeDataGridShort") / 2;
|
||||
cmp_numRowArt.numRowPag = memLayer.ML.CRI("_righeDataGridShort") / 2;
|
||||
// sistemo i DataGrid...
|
||||
gvParetoGrp.PageSize = cmp_numRowReparti.numRowPag;
|
||||
gvParetoMac.PageSize = cmp_numRowMacc.numRowPag;
|
||||
gvParetoArt.PageSize = cmp_numRowArt.numRowPag;
|
||||
}
|
||||
cmp_numRowArt.eh_newNum += Cmp_numRowArt_eh_newNum;
|
||||
cmp_numRowMacc.eh_newNum += Cmp_numRowMacc_eh_newNum;
|
||||
cmp_numRowReparti.eh_newNum += Cmp_numRowReparti_eh_newNum;
|
||||
}
|
||||
public event EventHandler eh_selVal;
|
||||
|
||||
private void Cmp_numRowReparti_eh_newNum(object sender, EventArgs e)
|
||||
{
|
||||
gvParetoGrp.PageSize = cmp_numRowReparti.numRowPag;
|
||||
}
|
||||
public event EventHandler eh_reset;
|
||||
|
||||
private void Cmp_numRowMacc_eh_newNum(object sender, EventArgs e)
|
||||
{
|
||||
gvParetoMac.PageSize = cmp_numRowMacc.numRowPag;
|
||||
}
|
||||
/// <summary>
|
||||
/// innalzo evento in base al tipo richiesto
|
||||
/// </summary>
|
||||
protected void raiseEvent(tipoEvento evReq)
|
||||
{
|
||||
switch (evReq)
|
||||
{
|
||||
case tipoEvento.reset:
|
||||
// raise dell'evento
|
||||
if (eh_reset != null)
|
||||
{
|
||||
eh_reset(this, new EventArgs());
|
||||
}
|
||||
break;
|
||||
|
||||
private void Cmp_numRowArt_eh_newNum(object sender, EventArgs e)
|
||||
{
|
||||
gvParetoArt.PageSize = cmp_numRowArt.numRowPag;
|
||||
}
|
||||
case tipoEvento.selection:
|
||||
// raise dell'evento
|
||||
if (eh_selVal != null)
|
||||
{
|
||||
eh_selVal(this, new EventArgs());
|
||||
}
|
||||
break;
|
||||
|
||||
protected void ddlCodGruppo_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
case tipoEvento.edit:
|
||||
case tipoEvento.delete:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
cmp_numRowReparti.numRowPag = memLayer.ML.CRI("_righeDataGridShort") / 2;
|
||||
cmp_numRowMacc.numRowPag = memLayer.ML.CRI("_righeDataGridShort") / 2;
|
||||
cmp_numRowArt.numRowPag = memLayer.ML.CRI("_righeDataGridShort") / 2;
|
||||
// sistemo i DataGrid...
|
||||
gvParetoGrp.PageSize = cmp_numRowReparti.numRowPag;
|
||||
gvParetoMac.PageSize = cmp_numRowMacc.numRowPag;
|
||||
gvParetoArt.PageSize = cmp_numRowArt.numRowPag;
|
||||
}
|
||||
cmp_numRowArt.eh_newNum += Cmp_numRowArt_eh_newNum;
|
||||
cmp_numRowMacc.eh_newNum += Cmp_numRowMacc_eh_newNum;
|
||||
cmp_numRowReparti.eh_newNum += Cmp_numRowReparti_eh_newNum;
|
||||
}
|
||||
|
||||
private void Cmp_numRowReparti_eh_newNum(object sender, EventArgs e)
|
||||
{
|
||||
gvParetoGrp.PageSize = cmp_numRowReparti.numRowPag;
|
||||
}
|
||||
|
||||
private void Cmp_numRowMacc_eh_newNum(object sender, EventArgs e)
|
||||
{
|
||||
gvParetoMac.PageSize = cmp_numRowMacc.numRowPag;
|
||||
}
|
||||
|
||||
private void Cmp_numRowArt_eh_newNum(object sender, EventArgs e)
|
||||
{
|
||||
gvParetoArt.PageSize = cmp_numRowArt.numRowPag;
|
||||
}
|
||||
|
||||
protected void ddlCodGruppo_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
#if false
|
||||
// salvo in sessione selezione...
|
||||
memLayer.ML.setSessionVal("selFaseBCode", ddlCodGruppo.SelectedValue);
|
||||
memLayer.ML.setSessionVal("selFaseBCode", ddlCodGruppo.SelectedValue);
|
||||
#endif
|
||||
}
|
||||
/// <summary>
|
||||
/// Reset controllo
|
||||
/// </summary>
|
||||
public void doReset()
|
||||
{
|
||||
doResetGrp();
|
||||
doResetMac();
|
||||
doResetArt();
|
||||
}
|
||||
/// <summary>
|
||||
/// comando reset
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtResetGrp_Click(object sender, EventArgs e)
|
||||
{
|
||||
doResetGrp();
|
||||
doResetMac();
|
||||
doResetArt();
|
||||
}
|
||||
/// <summary>
|
||||
/// comando reset
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtResetArt_Click(object sender, EventArgs e)
|
||||
{
|
||||
doResetArt();
|
||||
}
|
||||
/// <summary>
|
||||
/// comando reset
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtResetMac_Click(object sender, EventArgs e)
|
||||
{
|
||||
doResetMac();
|
||||
}
|
||||
private void doResetGrp()
|
||||
{
|
||||
gvParetoGrp.SelectedIndex = -1;
|
||||
gvParetoGrp.DataBind();
|
||||
raiseEvent(tipoEvento.reset);
|
||||
}
|
||||
private void doResetMac()
|
||||
{
|
||||
gvParetoMac.SelectedIndex = -1;
|
||||
gvParetoMac.DataBind();
|
||||
raiseEvent(tipoEvento.reset);
|
||||
}
|
||||
private void doResetArt()
|
||||
{
|
||||
gvParetoArt.SelectedIndex = -1;
|
||||
gvParetoArt.DataBind();
|
||||
raiseEvent(tipoEvento.reset);
|
||||
}
|
||||
protected void gvParetoGrp_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
doResetArt();
|
||||
}
|
||||
|
||||
protected void gvParetoMac_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
raiseEvent(tipoEvento.selection);
|
||||
}
|
||||
|
||||
protected void gvParetoArt_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
raiseEvent(tipoEvento.selection);
|
||||
}
|
||||
/// <summary>
|
||||
/// CodArticoloo selezionato in GridView
|
||||
/// </summary>
|
||||
public string CodArticolo
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = gvParetoArt.SelectedValue.ToString();
|
||||
}
|
||||
catch { }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// CodGruppo selezionato in GridView
|
||||
/// </summary>
|
||||
public string CodGruppo
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = gvParetoGrp.SelectedValue.ToString();
|
||||
}
|
||||
catch { }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// IdxMacchina selezionato in GridView
|
||||
/// </summary>
|
||||
public string IdxMacchina
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = gvParetoMac.SelectedValue.ToString();
|
||||
}
|
||||
catch { }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
protected void lbtToggle_Click(object sender, EventArgs e)
|
||||
{
|
||||
divDetail.Visible = !divDetail.Visible;
|
||||
tgIcon.Attributes["class"] = divDetail.Visible ? "fa fa-chevron-up" : "fa fa-chevron-down";
|
||||
/// <summary>
|
||||
/// Reset controllo
|
||||
/// </summary>
|
||||
public void doReset()
|
||||
{
|
||||
doResetGrp();
|
||||
doResetMac();
|
||||
doResetArt();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// comando reset
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtResetGrp_Click(object sender, EventArgs e)
|
||||
{
|
||||
doResetGrp();
|
||||
doResetMac();
|
||||
doResetArt();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// comando reset
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtResetArt_Click(object sender, EventArgs e)
|
||||
{
|
||||
doResetArt();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// comando reset
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtResetMac_Click(object sender, EventArgs e)
|
||||
{
|
||||
doResetMac();
|
||||
}
|
||||
|
||||
private void doResetGrp()
|
||||
{
|
||||
gvParetoGrp.SelectedIndex = -1;
|
||||
gvParetoGrp.DataBind();
|
||||
raiseEvent(tipoEvento.reset);
|
||||
}
|
||||
|
||||
private void doResetMac()
|
||||
{
|
||||
gvParetoMac.SelectedIndex = -1;
|
||||
gvParetoMac.DataBind();
|
||||
raiseEvent(tipoEvento.reset);
|
||||
}
|
||||
|
||||
private void doResetArt()
|
||||
{
|
||||
gvParetoArt.SelectedIndex = -1;
|
||||
gvParetoArt.DataBind();
|
||||
raiseEvent(tipoEvento.reset);
|
||||
}
|
||||
|
||||
protected void gvParetoGrp_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
doResetArt();
|
||||
}
|
||||
|
||||
protected void gvParetoMac_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
raiseEvent(tipoEvento.selection);
|
||||
}
|
||||
|
||||
protected void gvParetoArt_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
raiseEvent(tipoEvento.selection);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CodArticoloo selezionato in GridView
|
||||
/// </summary>
|
||||
public string CodArticolo
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = gvParetoArt.SelectedValue.ToString();
|
||||
}
|
||||
catch { }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CodGruppo selezionato in GridView
|
||||
/// </summary>
|
||||
public string CodGruppo
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = gvParetoGrp.SelectedValue.ToString();
|
||||
}
|
||||
catch { }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// IdxMacchina selezionato in GridView
|
||||
/// </summary>
|
||||
public string IdxMacchina
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = gvParetoMac.SelectedValue.ToString();
|
||||
}
|
||||
catch { }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
protected void lbtToggle_Click(object sender, EventArgs e)
|
||||
{
|
||||
divDetail.Visible = !divDetail.Visible;
|
||||
tgIcon.Attributes["class"] = divDetail.Visible ? "fa fa-chevron-up" : "fa fa-chevron-down";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user