Check ODL presente x macchina + basePbj
This commit is contained in:
@@ -804,6 +804,9 @@
|
||||
<Compile Include="MappaStato.aspx.designer.cs">
|
||||
<DependentUpon>MappaStato.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MpTabPage.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ODL.aspx.cs">
|
||||
<DependentUpon>ODL.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -1191,7 +1194,7 @@
|
||||
<Compile Include="WebUserControls\mod_turni.ascx.designer.cs">
|
||||
<DependentUpon>mod_turni.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WebUserControls\MpTabControl.cs">
|
||||
<Compile Include="WebUserControls\MpTabUserControl.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="windowSize.ashx.cs">
|
||||
|
||||
@@ -4,12 +4,12 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace MoonProTablet.WebUserControls
|
||||
namespace MoonProTablet
|
||||
{
|
||||
public class MpTabControl : System.Web.UI.UserControl
|
||||
public class MpTabPage : System.Web.UI.Page
|
||||
{
|
||||
/// <summary>
|
||||
/// idxMacchina
|
||||
/// idxMacchina corrente
|
||||
/// </summary>
|
||||
public string idxMacchina
|
||||
{
|
||||
@@ -23,14 +23,18 @@ namespace MoonProTablet.WebUserControls
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// idxODL corrente
|
||||
/// </summary>
|
||||
/// <param name="_lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(object _lemma)
|
||||
public int idxODL
|
||||
{
|
||||
_lemma = _lemma == null ? "":_lemma;
|
||||
return user_std.UtSn.Traduci(_lemma.ToString());
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("idxODL");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxODL", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public class MpTabUserControl : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// idxMacchina corrente in sessione
|
||||
/// </summary>
|
||||
public string idxMacchina
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("idxMacchina");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxMacchina", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Sotto sistema (macchina) selezionato in sessione
|
||||
/// </summary>
|
||||
public string subMaccSel
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("subMaccSel");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("subMaccSel", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// idxOdl corrente in sessione
|
||||
/// </summary>
|
||||
public int idxOdl
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.IntSessionObj("idxODL");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("idxODL", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
/// <param name="_lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(object _lemma)
|
||||
{
|
||||
_lemma = _lemma == null ? "":_lemma;
|
||||
return user_std.UtSn.Traduci(_lemma.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,26 +2,7 @@
|
||||
<%@ Register Src="~/WebUserControls/cmp_ST_objView.ascx" TagPrefix="uc1" TagName="cmp_ST_objView" %>
|
||||
|
||||
|
||||
|
||||
|
||||
<%--<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="IdxST,Label,Oggetto" DataSourceID="ods" AllowSorting="True" Width="100%">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Label" SortExpression="Label">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblLabel" runat="server" Text='<%# traduci(Eval("Label")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Oggetto" HeaderText="Oggetto" ReadOnly="True" SortExpression="Oggetto" />
|
||||
<asp:BoundField DataField="Num" HeaderText="Num" SortExpression="Num" />
|
||||
<asp:BoundField DataField="CodTipo" HeaderText="CodTipo" SortExpression="CodTipo" />
|
||||
<asp:BoundField DataField="Value" HeaderText="Value" SortExpression="Value" />
|
||||
<asp:BoundField DataField="CheckType" HeaderText="CheckType" SortExpression="CheckType" />
|
||||
<asp:CheckBoxField DataField="Required" HeaderText="Required" SortExpression="Required" />
|
||||
<asp:BoundField DataField="ExtCode" HeaderText="ExtCode" SortExpression="ExtCode" />
|
||||
<asp:BoundField DataField="Note" HeaderText="Note" SortExpression="Note" />
|
||||
<asp:BoundField DataField="DescTipo" HeaderText="DescTipo" SortExpression="DescTipo" />
|
||||
</Columns>
|
||||
</asp:GridView>--%>
|
||||
<asp:Label runat="server" ID="lblWarning" Visible="false" CssClass="text-danger text-center" Font-Size="2em" />
|
||||
|
||||
<asp:Repeater ID="repDetail" runat="server" DataSourceID="ods">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -7,11 +7,32 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class cmp_ST_detail : MpTabControl
|
||||
public partial class cmp_ST_detail : MpTabUserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
fixWarning();
|
||||
}
|
||||
/// <summary>
|
||||
/// check ODL presente
|
||||
/// </summary>
|
||||
private void fixWarning()
|
||||
{
|
||||
if (idxMacchina == "")
|
||||
{
|
||||
lblWarning.Text = traduci("MancaMacchina");
|
||||
lblWarning.Visible = true;
|
||||
}
|
||||
else if (idxOdl == 0)
|
||||
{
|
||||
lblWarning.Text = traduci("MancaOdl");
|
||||
lblWarning.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
lblWarning.Text = "";
|
||||
lblWarning.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
public string CodArticolo
|
||||
|
||||
@@ -14,6 +14,15 @@ namespace MoonProTablet.WebUserControls
|
||||
public partial class cmp_ST_detail
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblWarning.
|
||||
/// </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 lblWarning;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo repDetail.
|
||||
/// </summary>
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class cmp_ST_objView : MpTabControl
|
||||
public partial class cmp_ST_objView : MpTabUserControl
|
||||
{
|
||||
public string dataType
|
||||
{
|
||||
|
||||
@@ -5,517 +5,492 @@ using System.Web.UI;
|
||||
|
||||
namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class mod_confProd : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// indica conferma con rettifica (evento 121)
|
||||
/// </summary>
|
||||
protected bool confRett = memLayer.ML.CRB("confRett");
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
public event EventHandler eh_inserting;
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
public event EventHandler eh_newVal;
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
public event EventHandler eh_reset;
|
||||
/// <summary>
|
||||
/// Data-Ora ultimo update valori produzione
|
||||
/// </summary>
|
||||
public DateTime dtReqUpdate
|
||||
public partial class mod_confProd : MpTabUserControl
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Now;
|
||||
DateTime.TryParse(memLayer.ML.StringSessionObj("dtReqUpdate"), out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("dtReqUpdate", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Dati produzioen rilevati
|
||||
/// </summary>
|
||||
public DS_ProdTempi.StatoProdRow datiProdAct;
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
checkAll();
|
||||
if (isMulti)
|
||||
/// <summary>
|
||||
/// indica conferma con rettifica (evento 121)
|
||||
/// </summary>
|
||||
protected bool confRett = memLayer.ML.CRB("confRett");
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
public event EventHandler eh_inserting;
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
public event EventHandler eh_newVal;
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
public event EventHandler eh_reset;
|
||||
/// <summary>
|
||||
/// Data-Ora ultimo update valori produzione
|
||||
/// </summary>
|
||||
public DateTime dtReqUpdate
|
||||
{
|
||||
// sollevo evento!
|
||||
if (eh_reset != null)
|
||||
{
|
||||
eh_reset(this, new EventArgs());
|
||||
}
|
||||
get
|
||||
{
|
||||
DateTime answ = DateTime.Now;
|
||||
DateTime.TryParse(memLayer.ML.StringSessionObj("dtReqUpdate"), out answ);
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("dtReqUpdate", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Reset parametri x calcolo pezzi (no pezzi lasciati, dataora attuale...)
|
||||
/// </summary>
|
||||
private void resetParam()
|
||||
{
|
||||
dtReqUpdate = DateTime.Now;
|
||||
numPzLasciati = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorno valori produzione alla data richiesta...
|
||||
/// </summary>
|
||||
/// <param name="newDate"></param>
|
||||
public void doUpdate()
|
||||
{
|
||||
datiProdAct = DataLayerObj.taStatoProd.GetData(idxMacchina, dtReqUpdate)[0];
|
||||
// aggiorno visualizzazione...
|
||||
numPzProdotti = datiProdAct.PzTotODL;
|
||||
numPz2Rec = datiProdAct.Pz2RecTot;
|
||||
numPzScaConf = datiProdAct.PzConfScarto;
|
||||
numPzBuoniConf = datiProdAct.PzConfBuoni;
|
||||
numPzProdotti2Rec = datiProdAct.Pz2RecTot;
|
||||
numPzScarto2Rec = datiProdAct.Pz2RecScarto;
|
||||
}
|
||||
/// <summary>
|
||||
/// Numero pezzi PRODOTTI GLOBALI
|
||||
/// </summary>
|
||||
protected int numPzProdotti
|
||||
{
|
||||
set
|
||||
{
|
||||
lblPzTotODL.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Numero pezzi da LASCIARE non dichiarati
|
||||
/// </summary>
|
||||
protected int numPzLasciati
|
||||
{
|
||||
set
|
||||
{
|
||||
txtNumLasciati.Text = value.ToString();
|
||||
}
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
/// <summary>
|
||||
/// Dati produzioen rilevati
|
||||
/// </summary>
|
||||
public DS_ProdTempi.StatoProdRow datiProdAct;
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
answ = Convert.ToInt32(txtNumLasciati.Text);
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
checkAll();
|
||||
if (isMulti)
|
||||
{
|
||||
// sollevo evento!
|
||||
if (eh_reset != null)
|
||||
{
|
||||
eh_reset(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Numero pezzi PRODOTTI da ultima conferma
|
||||
/// </summary>
|
||||
protected int numPz2Rec
|
||||
{
|
||||
set
|
||||
{
|
||||
lblPz2RecTot.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Numero pezzi SCARTO già confermati
|
||||
/// </summary>
|
||||
protected int numPzScaConf
|
||||
{
|
||||
set
|
||||
{
|
||||
lblPzConfScarto.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Numero pezzi BUONI già confermati
|
||||
/// </summary>
|
||||
protected int numPzBuoniConf
|
||||
{
|
||||
set
|
||||
{
|
||||
lblPzConfBuoni.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Numero pezzi PRODOTTI da registrare
|
||||
/// </summary> da ultima conferma
|
||||
protected int numPzProdotti2Rec
|
||||
{
|
||||
set
|
||||
{
|
||||
txtNumPezzi.Text = value.ToString();
|
||||
}
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
/// <summary>
|
||||
/// Reset parametri x calcolo pezzi (no pezzi lasciati, dataora attuale...)
|
||||
/// </summary>
|
||||
private void resetParam()
|
||||
{
|
||||
answ = Convert.ToInt32(txtNumPezzi.Text);
|
||||
dtReqUpdate = DateTime.Now;
|
||||
numPzLasciati = 0;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Numero pezzi SCARTATI da registrare
|
||||
/// </summary>
|
||||
protected int numPzScarto2Rec
|
||||
{
|
||||
set
|
||||
{
|
||||
lblPz2RecScarto.Text = value.ToString();
|
||||
memLayer.ML.setSessionVal("lblPz2RecScarto", value);
|
||||
}
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorno valori produzione alla data richiesta...
|
||||
/// </summary>
|
||||
/// <param name="newDate"></param>
|
||||
public void doUpdate()
|
||||
{
|
||||
answ = memLayer.ML.IntSessionObj("lblPz2RecScarto");
|
||||
datiProdAct = DataLayerObj.taStatoProd.GetData(idxMacchinaSel, dtReqUpdate)[0];
|
||||
// aggiorno visualizzazione...
|
||||
numPzProdotti = datiProdAct.PzTotODL;
|
||||
numPz2Rec = datiProdAct.Pz2RecTot;
|
||||
numPzScaConf = datiProdAct.PzConfScarto;
|
||||
numPzBuoniConf = datiProdAct.PzConfBuoni;
|
||||
numPzProdotti2Rec = datiProdAct.Pz2RecTot;
|
||||
numPzScarto2Rec = datiProdAct.Pz2RecScarto;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Numero pezzi confermati (buoni - scarto)
|
||||
/// </summary>
|
||||
protected int numPzConfermati
|
||||
{
|
||||
get
|
||||
{
|
||||
return numPzProdotti2Rec - numPzScarto2Rec;
|
||||
}
|
||||
}
|
||||
private void checkAll()
|
||||
{
|
||||
checkConfig();
|
||||
fixSelMacc();
|
||||
checkOdl();
|
||||
lblOut.Text = "";
|
||||
switchBtnConferma(false);
|
||||
lbtShowConfProd.Visible = odlOk;
|
||||
lblConfProd.Visible = !odlOk;
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica config x modalità permesse
|
||||
/// </summary>
|
||||
private void checkConfig()
|
||||
{
|
||||
// verifico SE sia permesso gestire i "Pezzi lasciati" in macchina...
|
||||
lblNumLasciati.Visible = memLayer.ML.cdvb("enablePzProdLasciati");
|
||||
txtNumLasciati.Visible = memLayer.ML.cdvb("enablePzProdLasciati");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se abbia un ODL ATTIVO
|
||||
/// </summary>
|
||||
private void checkOdl()
|
||||
{
|
||||
lbtShowConfProd.Visible = odlOk;
|
||||
lblConfProd.Visible = !odlOk;
|
||||
lblMancaODL.Visible = !odlOk;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se la macchina MAIN sia MULTI (da DatiMacchina / redis...)
|
||||
/// </summary>
|
||||
protected bool isMulti
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataLayerObj.isMulti(idxMacchinaSession);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Se la machcina è MULTI --> mostro selettore
|
||||
/// </summary>
|
||||
private void fixSelMacc()
|
||||
{
|
||||
divSelMacc.Visible = isMulti;
|
||||
if (isMulti)
|
||||
{
|
||||
// salvo selezione submacc
|
||||
ddlSubMacc.DataBind();
|
||||
subMaccSel = ddlSubMacc.SelectedValue;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce css disabled SE odl NON OK...
|
||||
/// </summary>
|
||||
public string cssBtnConf
|
||||
{
|
||||
get
|
||||
{
|
||||
return odlOk ? "" : "disabled";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica ODL OK (ovvero caricato x macchina...)
|
||||
/// </summary>
|
||||
public bool odlOk
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = true;
|
||||
// se ODL > 0 è ok!!!
|
||||
answ = (idxOdl > 0);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// ODL correntemente sulla macchina
|
||||
/// - cerca in Redis (TTL 5 sec)
|
||||
/// - altrimenti recupera da DB...
|
||||
/// </summary>
|
||||
protected int idxOdl
|
||||
{
|
||||
get
|
||||
{
|
||||
// userò ODL del turno
|
||||
int answ = 0;
|
||||
// cerco da redis...
|
||||
int.TryParse(DataLayerObj.currODL(idxMacchina, true), out answ);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
public string idxMacchina
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = memLayer.ML.StringSessionObj("IdxMacchina");
|
||||
// verifoc: se multi uso selettore tendina...
|
||||
if (isMulti)
|
||||
/// <summary>
|
||||
/// Numero pezzi PRODOTTI GLOBALI
|
||||
/// </summary>
|
||||
protected int numPzProdotti
|
||||
{
|
||||
if (ddlSubMacc.SelectedValue == "")
|
||||
{
|
||||
ddlSubMacc.DataBind();
|
||||
}
|
||||
if (ddlSubMacc.SelectedValue != "")
|
||||
{
|
||||
answ = ddlSubMacc.SelectedValue;
|
||||
}
|
||||
set
|
||||
{
|
||||
lblPzTotODL.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
public string idxMacchinaSession
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("IdxMacchina");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// cambio stato visibilità pannello e testo button
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtShowConfProd_Click(object sender, EventArgs e)
|
||||
{
|
||||
switchBtnConferma(!divInnovazioni.Visible);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// determina comportamento btn conferma
|
||||
/// </summary>
|
||||
private void switchBtnConferma(bool showConf)
|
||||
{
|
||||
// aggiorno valori rilevati
|
||||
resetParam();
|
||||
doUpdate();
|
||||
divInnovazioni.Visible = showConf;
|
||||
if (showConf)
|
||||
{
|
||||
// continuo update
|
||||
lbtSalva.Visible = showConf;
|
||||
try
|
||||
/// <summary>
|
||||
/// Numero pezzi da LASCIARE non dichiarati
|
||||
/// </summary>
|
||||
protected int numPzLasciati
|
||||
{
|
||||
updatePzBuoni();
|
||||
// sollevo evento!
|
||||
if (eh_inserting != null)
|
||||
{
|
||||
eh_inserting(this, new EventArgs());
|
||||
}
|
||||
set
|
||||
{
|
||||
txtNumLasciati.Text = value.ToString();
|
||||
}
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToInt32(txtNumLasciati.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
catch
|
||||
/// <summary>
|
||||
/// Numero pezzi PRODOTTI da ultima conferma
|
||||
/// </summary>
|
||||
protected int numPz2Rec
|
||||
{
|
||||
txtNumPezzi.Text = "0";
|
||||
logger.lg.scriviLog(string.Format("Errore recupero pezzi da confermare per la macchina {0}", idxMacchina), tipoLog.ERROR);
|
||||
set
|
||||
{
|
||||
lblPz2RecTot.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (showConf)
|
||||
{
|
||||
lblShowConfProd.Text = "Nascondi Conferma";
|
||||
}
|
||||
else
|
||||
{
|
||||
lblShowConfProd.Text = "Mostra Conferma";
|
||||
// sollevo evento!
|
||||
if (eh_reset != null)
|
||||
/// <summary>
|
||||
/// Numero pezzi SCARTO già confermati
|
||||
/// </summary>
|
||||
protected int numPzScaConf
|
||||
{
|
||||
eh_reset(this, new EventArgs());
|
||||
set
|
||||
{
|
||||
lblPzConfScarto.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// salvo produzione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtSalva_Click(object sender, EventArgs e)
|
||||
{
|
||||
// effettua conferma con conf da DB del tipo (giorni / turni / periodo
|
||||
bool fatto = effettuaConfermaProd();
|
||||
// refresh tabella dati tablet...
|
||||
DataLayerObj.taMSE.forceRecalc(0, idxMacchina);
|
||||
// mostro output
|
||||
lblOut.Text = string.Format("Confermata la produzione per {0} pezzi! (+{1} pz scarto) alle {2:yyyy-MM-dd HH:mm:ss}", numPzConfermati, numPzScarto2Rec, dtReqUpdate);
|
||||
// cambio button conferma...
|
||||
switchBtnConferma(!txtNumPezzi.Enabled);
|
||||
// sollevo evento!
|
||||
if (eh_newVal != null)
|
||||
{
|
||||
eh_newVal(this, new EventArgs());
|
||||
}
|
||||
doUpdate();
|
||||
}
|
||||
/// <summary>
|
||||
/// Registra conferma produzione in modalità nuova (con rettifica pezzi lasciati) o legacy (con anticipo periodo)
|
||||
/// </summary>
|
||||
private bool effettuaConfermaProd()
|
||||
{
|
||||
bool fatto = false;
|
||||
if (confRett)
|
||||
{
|
||||
// confermo al netto dei pezzi lasciati...
|
||||
fatto = DataLayerObj.confermaProdMacchinaFull(idxMacchina, memLayer.ML.CRI("modoConfProd"), numPzConfermati - numPzLasciati, numPzLasciati, numPzScarto2Rec, dtReqUpdate);
|
||||
}
|
||||
else
|
||||
{
|
||||
fatto = DataLayerObj.confermaProdMacchina(idxMacchina, memLayer.ML.CRI("modoConfProd"), numPzConfermati, numPzScarto2Rec, dtReqUpdate);
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// update post modifica pz buoni
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtNumPezzi_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
lblOut.Text = "";
|
||||
updatePzBuoni();
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna visualizzazione pz buoni /prodotti - scarti)
|
||||
/// </summary>
|
||||
private void updatePzBuoni()
|
||||
{
|
||||
if (confRett)
|
||||
{
|
||||
// cambio le qta di pezzi confermati...
|
||||
lblPz2RecBuoni.Text = (numPzConfermati - numPzLasciati).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
// se ho dei pezzi lasciati RICALCOLO la data...
|
||||
if (numPzLasciati > 0)
|
||||
/// <summary>
|
||||
/// Numero pezzi BUONI già confermati
|
||||
/// </summary>
|
||||
protected int numPzBuoniConf
|
||||
{
|
||||
// calcolo la data..
|
||||
DS_ProdTempi.TempiCicloRilevatiDataTable tab = DataLayerObj.taTempiCicloRilevati.getLastPzByMaccQta(idxMacchina, DateTime.Now, numPzLasciati);
|
||||
if (tab.Rows.Count > 0)
|
||||
{
|
||||
dtReqUpdate = tab[0].DataOraRif.AddSeconds(1);
|
||||
}
|
||||
// aggiorno
|
||||
doUpdate();
|
||||
set
|
||||
{
|
||||
lblPzConfBuoni.Text = value.ToString();
|
||||
}
|
||||
}
|
||||
lblPz2RecBuoni.Text = numPzConfermati.ToString();
|
||||
}
|
||||
// aggiorno la data calcolo + pezzi buoni...
|
||||
lblDtRec.Text = dtReqUpdate.ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// Update pz lasciati --> aggiorno!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtNumLasciati_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
lblOut.Text = "";
|
||||
updatePzBuoni();
|
||||
}
|
||||
protected void ddlSubMacc_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
subMaccSel = ddlSubMacc.SelectedValue;
|
||||
checkAll();
|
||||
}
|
||||
|
||||
protected void ddlSubMacc_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
// se ho in memoria un valore LO REIMPOSTO...
|
||||
if (subMaccSel != "")
|
||||
{
|
||||
// provo a preselezionare...
|
||||
try
|
||||
/// <summary>
|
||||
/// Numero pezzi PRODOTTI da registrare
|
||||
/// </summary> da ultima conferma
|
||||
protected int numPzProdotti2Rec
|
||||
{
|
||||
ddlSubMacc.SelectedValue = subMaccSel;
|
||||
set
|
||||
{
|
||||
txtNumPezzi.Text = value.ToString();
|
||||
}
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToInt32(txtNumPezzi.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Numero pezzi SCARTATI da registrare
|
||||
/// </summary>
|
||||
protected int numPzScarto2Rec
|
||||
{
|
||||
set
|
||||
{
|
||||
lblPz2RecScarto.Text = value.ToString();
|
||||
memLayer.ML.setSessionVal("lblPz2RecScarto", value);
|
||||
}
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
{
|
||||
answ = memLayer.ML.IntSessionObj("lblPz2RecScarto");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Numero pezzi confermati (buoni - scarto)
|
||||
/// </summary>
|
||||
protected int numPzConfermati
|
||||
{
|
||||
get
|
||||
{
|
||||
return numPzProdotti2Rec - numPzScarto2Rec;
|
||||
}
|
||||
}
|
||||
private void checkAll()
|
||||
{
|
||||
updateOdl();
|
||||
checkConfig();
|
||||
fixSelMacc();
|
||||
checkOdl();
|
||||
lblOut.Text = "";
|
||||
switchBtnConferma(false);
|
||||
lbtShowConfProd.Visible = odlOk;
|
||||
lblConfProd.Visible = !odlOk;
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica config x modalità permesse
|
||||
/// </summary>
|
||||
private void checkConfig()
|
||||
{
|
||||
// verifico SE sia permesso gestire i "Pezzi lasciati" in macchina...
|
||||
lblNumLasciati.Visible = memLayer.ML.cdvb("enablePzProdLasciati");
|
||||
txtNumLasciati.Visible = memLayer.ML.cdvb("enablePzProdLasciati");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Sotto sistema (macchina) selezionato
|
||||
/// </summary>
|
||||
public string subMaccSel
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("subMaccSel");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("subMaccSel", value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se abbia un ODL ATTIVO
|
||||
/// </summary>
|
||||
private void checkOdl()
|
||||
{
|
||||
lbtShowConfProd.Visible = odlOk;
|
||||
lblConfProd.Visible = !odlOk;
|
||||
lblMancaODL.Visible = !odlOk;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifica se la macchina MAIN sia MULTI (da DatiMacchina / redis...)
|
||||
/// </summary>
|
||||
protected bool isMulti
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataLayerObj.isMulti(idxMacchina);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Se la machcina è MULTI --> mostro selettore
|
||||
/// </summary>
|
||||
private void fixSelMacc()
|
||||
{
|
||||
divSelMacc.Visible = isMulti;
|
||||
if (isMulti)
|
||||
{
|
||||
// salvo selezione submacc
|
||||
ddlSubMacc.DataBind();
|
||||
subMaccSel = ddlSubMacc.SelectedValue;
|
||||
}
|
||||
updateOdl();
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce css disabled SE odl NON OK...
|
||||
/// </summary>
|
||||
public string cssBtnConf
|
||||
{
|
||||
get
|
||||
{
|
||||
return odlOk ? "" : "disabled";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica ODL OK (ovvero caricato x macchina...)
|
||||
/// </summary>
|
||||
public bool odlOk
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = true;
|
||||
// se ODL > 0 è ok!!!
|
||||
answ = (idxOdl > 0);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// ODL correntemente sulla macchina
|
||||
/// - cerca in Redis (TTL 5 sec)
|
||||
/// - altrimenti recupera da DB...
|
||||
/// </summary>
|
||||
protected void updateOdl()
|
||||
{
|
||||
// userò ODL del turno
|
||||
int answ = 0;
|
||||
// cerco da redis...
|
||||
int.TryParse(DataLayerObj.currODL(idxMacchinaSel, true), out answ);
|
||||
// salvo!
|
||||
idxOdl = answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
public string idxMacchinaSel
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = memLayer.ML.StringSessionObj("IdxMacchina");
|
||||
// verifoc: se multi uso selettore tendina...
|
||||
if (isMulti)
|
||||
{
|
||||
if (ddlSubMacc.SelectedValue == "")
|
||||
{
|
||||
ddlSubMacc.DataBind();
|
||||
}
|
||||
if (ddlSubMacc.SelectedValue != "")
|
||||
{
|
||||
answ = ddlSubMacc.SelectedValue;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// cambio stato visibilità pannello e testo button
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtShowConfProd_Click(object sender, EventArgs e)
|
||||
{
|
||||
switchBtnConferma(!divInnovazioni.Visible);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// determina comportamento btn conferma
|
||||
/// </summary>
|
||||
private void switchBtnConferma(bool showConf)
|
||||
{
|
||||
// aggiorno valori rilevati
|
||||
resetParam();
|
||||
doUpdate();
|
||||
divInnovazioni.Visible = showConf;
|
||||
if (showConf)
|
||||
{
|
||||
// continuo update
|
||||
lbtSalva.Visible = showConf;
|
||||
try
|
||||
{
|
||||
updatePzBuoni();
|
||||
// sollevo evento!
|
||||
if (eh_inserting != null)
|
||||
{
|
||||
eh_inserting(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
txtNumPezzi.Text = "0";
|
||||
logger.lg.scriviLog(string.Format("Errore recupero pezzi da confermare per la macchina {0}", idxMacchinaSel), tipoLog.ERROR);
|
||||
}
|
||||
}
|
||||
if (showConf)
|
||||
{
|
||||
lblShowConfProd.Text = "Nascondi Conferma";
|
||||
}
|
||||
else
|
||||
{
|
||||
lblShowConfProd.Text = "Mostra Conferma";
|
||||
// sollevo evento!
|
||||
if (eh_reset != null)
|
||||
{
|
||||
eh_reset(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// salvo produzione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtSalva_Click(object sender, EventArgs e)
|
||||
{
|
||||
// effettua conferma con conf da DB del tipo (giorni / turni / periodo
|
||||
bool fatto = effettuaConfermaProd();
|
||||
// refresh tabella dati tablet...
|
||||
DataLayerObj.taMSE.forceRecalc(0, idxMacchinaSel);
|
||||
// mostro output
|
||||
lblOut.Text = string.Format("Confermata la produzione per {0} pezzi! (+{1} pz scarto) alle {2:yyyy-MM-dd HH:mm:ss}", numPzConfermati, numPzScarto2Rec, dtReqUpdate);
|
||||
// cambio button conferma...
|
||||
switchBtnConferma(!txtNumPezzi.Enabled);
|
||||
// sollevo evento!
|
||||
if (eh_newVal != null)
|
||||
{
|
||||
eh_newVal(this, new EventArgs());
|
||||
}
|
||||
doUpdate();
|
||||
}
|
||||
/// <summary>
|
||||
/// Registra conferma produzione in modalità nuova (con rettifica pezzi lasciati) o legacy (con anticipo periodo)
|
||||
/// </summary>
|
||||
private bool effettuaConfermaProd()
|
||||
{
|
||||
bool fatto = false;
|
||||
if (confRett)
|
||||
{
|
||||
// confermo al netto dei pezzi lasciati...
|
||||
fatto = DataLayerObj.confermaProdMacchinaFull(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), numPzConfermati - numPzLasciati, numPzLasciati, numPzScarto2Rec, dtReqUpdate);
|
||||
}
|
||||
else
|
||||
{
|
||||
fatto = DataLayerObj.confermaProdMacchina(idxMacchinaSel, memLayer.ML.CRI("modoConfProd"), numPzConfermati, numPzScarto2Rec, dtReqUpdate);
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// update post modifica pz buoni
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtNumPezzi_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
lblOut.Text = "";
|
||||
updatePzBuoni();
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna visualizzazione pz buoni /prodotti - scarti)
|
||||
/// </summary>
|
||||
private void updatePzBuoni()
|
||||
{
|
||||
if (confRett)
|
||||
{
|
||||
// cambio le qta di pezzi confermati...
|
||||
lblPz2RecBuoni.Text = (numPzConfermati - numPzLasciati).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
// se ho dei pezzi lasciati RICALCOLO la data...
|
||||
if (numPzLasciati > 0)
|
||||
{
|
||||
// calcolo la data..
|
||||
DS_ProdTempi.TempiCicloRilevatiDataTable tab = DataLayerObj.taTempiCicloRilevati.getLastPzByMaccQta(idxMacchinaSel, DateTime.Now, numPzLasciati);
|
||||
if (tab.Rows.Count > 0)
|
||||
{
|
||||
dtReqUpdate = tab[0].DataOraRif.AddSeconds(1);
|
||||
}
|
||||
// aggiorno
|
||||
doUpdate();
|
||||
}
|
||||
lblPz2RecBuoni.Text = numPzConfermati.ToString();
|
||||
}
|
||||
// aggiorno la data calcolo + pezzi buoni...
|
||||
lblDtRec.Text = dtReqUpdate.ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// Update pz lasciati --> aggiorno!
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtNumLasciati_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
lblOut.Text = "";
|
||||
updatePzBuoni();
|
||||
}
|
||||
protected void ddlSubMacc_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
subMaccSel = ddlSubMacc.SelectedValue;
|
||||
// salvo ODL
|
||||
DataLayerObj.taMSE.getByIdxMaccAndSub(idxMacchinaSel, subMaccSel);
|
||||
//altri controlli
|
||||
checkAll();
|
||||
}
|
||||
|
||||
protected void ddlSubMacc_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
// se ho in memoria un valore LO REIMPOSTO...
|
||||
if (subMaccSel != "")
|
||||
{
|
||||
// provo a preselezionare...
|
||||
try
|
||||
{
|
||||
ddlSubMacc.SelectedValue = subMaccSel;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using System.Web.UI;
|
||||
|
||||
namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class mod_dettMacchina : System.Web.UI.UserControl
|
||||
public partial class mod_dettMacchina : MpTabUserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
@@ -15,20 +15,6 @@ namespace MoonProTablet.WebUserControls
|
||||
/// fatto refresh --> chiedo remove modal (se c'è)
|
||||
/// </summary>
|
||||
public event EventHandler eh_reqRemoveModal;
|
||||
/// <summary>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
public string idxMacchina
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("IdxMacchina");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", value);
|
||||
}
|
||||
}
|
||||
|
||||
public bool showDisegno(object _codArticolo)
|
||||
{
|
||||
|
||||
+177
-190
@@ -5,209 +5,196 @@ using System.Web.UI;
|
||||
|
||||
namespace MoonProTablet
|
||||
{
|
||||
public partial class fixODL : System.Web.UI.Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// Caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
public partial class fixODL : MpTabPage
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
fixSelMacc();
|
||||
hfIdxMacchina.Value = idxMacchina;
|
||||
fixBtnImpostaODL();
|
||||
DateTime adesso = DateTime.Now;
|
||||
hfDataTo.Value = adesso.ToString();
|
||||
hfDataFrom.Value = adesso.AddMonths(-1).ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// Caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
fixSelMacc();
|
||||
hfIdxMacchina.Value = idxMacchinaSel;
|
||||
fixBtnImpostaODL();
|
||||
DateTime adesso = DateTime.Now;
|
||||
hfDataTo.Value = adesso.ToString();
|
||||
hfDataFrom.Value = adesso.AddMonths(-1).ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
public string idxMacchinaSel
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = idxMacchina;
|
||||
// verifico: se multi uso selettore tendina...
|
||||
if (isMulti)
|
||||
{
|
||||
if (ddlSubMacc.SelectedValue == "")
|
||||
{
|
||||
ddlSubMacc.DataBind();
|
||||
}
|
||||
if (ddlSubMacc.SelectedValue != "")
|
||||
{
|
||||
answ = ddlSubMacc.SelectedValue;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se la macchina MAIN sia MULTI (da DatiMacchina / redis...)
|
||||
/// </summary>
|
||||
protected bool isMulti
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
answ = DataLayerObj.isMulti(idxMacchina);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
protected void ddlSubMacc_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
// se ho in memoria un valore LO REIMPOSTO...
|
||||
if (subMaccSel != "")
|
||||
{
|
||||
// provo a preselezionare...
|
||||
try
|
||||
{
|
||||
ddlSubMacc.SelectedValue = subMaccSel;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
protected void ddlSubMacc_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
subMaccSel = ddlSubMacc.SelectedValue;
|
||||
checkAll();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
public string idxMacchinaSession
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("IdxMacchina");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
public string idxMacchina
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = idxMacchinaSession;
|
||||
// verifico: se multi uso selettore tendina...
|
||||
if (isMulti)
|
||||
private void checkAll()
|
||||
{
|
||||
if (ddlSubMacc.SelectedValue == "")
|
||||
{
|
||||
ddlSubMacc.DataBind();
|
||||
}
|
||||
if (ddlSubMacc.SelectedValue != "")
|
||||
{
|
||||
answ = ddlSubMacc.SelectedValue;
|
||||
}
|
||||
fixSelMacc();
|
||||
hfIdxMacchina.Value = idxMacchinaSel;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se la macchina MAIN sia MULTI (da DatiMacchina / redis...)
|
||||
/// </summary>
|
||||
protected bool isMulti
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
answ = DataLayerObj.isMulti(idxMacchinaSession);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
protected void ddlSubMacc_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
// se ho in memoria un valore LO REIMPOSTO...
|
||||
if (subMaccSel != "")
|
||||
{
|
||||
// provo a preselezionare...
|
||||
try
|
||||
/// <summary>
|
||||
/// Se la machcina è MULTI --> mostro selettore
|
||||
/// </summary>
|
||||
private void fixSelMacc()
|
||||
{
|
||||
ddlSubMacc.SelectedValue = subMaccSel;
|
||||
divSelMacc.Visible = isMulti;
|
||||
if (isMulti)
|
||||
{
|
||||
// salvo selezione submacc
|
||||
ddlSubMacc.DataBind();
|
||||
subMaccSel = ddlSubMacc.SelectedValue;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
}
|
||||
protected void ddlSubMacc_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
subMaccSel = ddlSubMacc.SelectedValue;
|
||||
checkAll();
|
||||
}
|
||||
|
||||
private void checkAll()
|
||||
{
|
||||
fixSelMacc();
|
||||
hfIdxMacchina.Value = idxMacchina;
|
||||
}
|
||||
/// <summary>
|
||||
/// Se la machcina è MULTI --> mostro selettore
|
||||
/// </summary>
|
||||
private void fixSelMacc()
|
||||
{
|
||||
divSelMacc.Visible = isMulti;
|
||||
if (isMulti)
|
||||
{
|
||||
// salvo selezione submacc
|
||||
ddlSubMacc.DataBind();
|
||||
subMaccSel = ddlSubMacc.SelectedValue;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Sotto sistema (macchina) selezionato
|
||||
/// </summary>
|
||||
public string subMaccSel
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("subMaccSel");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("subMaccSel", value);
|
||||
}
|
||||
}
|
||||
private void fixBtnImpostaODL()
|
||||
{
|
||||
// verifico se selezionato un ODL sorgente...
|
||||
lbtSetODL.Visible = idxODL > 0;
|
||||
}
|
||||
/// <summary>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
public int idxODL
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
/// <summary>
|
||||
/// Sotto sistema (macchina) selezionato
|
||||
/// </summary>
|
||||
public string subMaccSel
|
||||
{
|
||||
answ = Convert.ToInt32(ddlODL.SelectedValue);
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("subMaccSel");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("subMaccSel", value);
|
||||
}
|
||||
}
|
||||
private void fixBtnImpostaODL()
|
||||
{
|
||||
// verifico se selezionato un ODL sorgente...
|
||||
lbtSetODL.Visible = idxOdlSel > 0;
|
||||
// salvo in sessione...
|
||||
idxODL = idxOdlSel;
|
||||
}
|
||||
/// <summary>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
public int idxOdlSel
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
try
|
||||
{
|
||||
answ = Convert.ToInt32(ddlODL.SelectedValue);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void ddlODL_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
fixBtnImpostaODL();
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica (su tab config) se sia abilitata la gestione flusso RPO (Richieste - Promesse - ODL)
|
||||
/// </summary>
|
||||
protected bool enableRPO
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.cdvb("enableRPO");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Registra attivazione ODL per macchina corrente...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtSetODL_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (idxMacchina != "" && idxODL > 0)
|
||||
{
|
||||
if (enableRPO)
|
||||
protected void ddlODL_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// registro ODL retroattivamente...
|
||||
DataLayerObj.taODL.inizioSetupPromessaPostuma(idxODL, DataLayerObj.MatrOpr, idxMacchina);
|
||||
fixBtnImpostaODL();
|
||||
}
|
||||
else
|
||||
/// <summary>
|
||||
/// Verifica (su tab config) se sia abilitata la gestione flusso RPO (Richieste - Promesse - ODL)
|
||||
/// </summary>
|
||||
protected bool enableRPO
|
||||
{
|
||||
// registro ODL retroattivamente...
|
||||
DataLayerObj.taODL.insPostumo(idxODL, idxMacchina);
|
||||
get
|
||||
{
|
||||
return memLayer.ML.cdvb("enableRPO");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Registra attivazione ODL per macchina corrente...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtSetODL_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (idxMacchinaSel != "" && idxOdlSel > 0)
|
||||
{
|
||||
if (enableRPO)
|
||||
{
|
||||
// registro ODL retroattivamente...
|
||||
DataLayerObj.taODL.inizioSetupPromessaPostuma(idxOdlSel, DataLayerObj.MatrOpr, idxMacchinaSel);
|
||||
}
|
||||
else
|
||||
{
|
||||
// registro ODL retroattivamente...
|
||||
DataLayerObj.taODL.insPostumo(idxOdlSel, idxMacchinaSel);
|
||||
}
|
||||
}
|
||||
// controllo: se il nuovo ODL è stato registrato --> rimando a pagina ODL/Attrezzaggio...
|
||||
bool odlOk = false;
|
||||
try
|
||||
{
|
||||
// ricalcolo MSE
|
||||
DataLayerObj.taMSE.getByRefreshData(0);
|
||||
// verifico!
|
||||
int idxODL = DataLayerObj.taMSE.getByIdxMacchina(idxMacchinaSel)[0].idxODL;
|
||||
odlOk = (idxODL > 0);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore recupero ODL corrente da confermare per la macchina {0}{1}{2}", idxMacchinaSel, Environment.NewLine, exc), tipoLog.ERROR);
|
||||
}
|
||||
// forzo COMUNQUE redirect...
|
||||
Response.Redirect("ODL");
|
||||
}
|
||||
}
|
||||
// controllo: se il nuovo ODL è stato registrato --> rimando a pagina ODL/Attrezzaggio...
|
||||
bool odlOk = false;
|
||||
try
|
||||
{
|
||||
// ricalcolo MSE
|
||||
DataLayerObj.taMSE.getByRefreshData(0);
|
||||
// verifico!
|
||||
int idxODL = DataLayerObj.taMSE.getByIdxMacchina(idxMacchina)[0].idxODL;
|
||||
odlOk = (idxODL > 0);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore recupero ODL corrente da confermare per la macchina {0}{1}{2}", idxMacchina, Environment.NewLine, exc), tipoLog.ERROR);
|
||||
}
|
||||
// forzo COMUNQUE redirect...
|
||||
Response.Redirect("ODL");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user