inizio fix gestione ODL
This commit is contained in:
@@ -7,18 +7,8 @@
|
||||
<% } %>
|
||||
<div class="clearDiv" style="background-color: transparent;">
|
||||
|
||||
<div class="ui-grid-a">
|
||||
<div class="ui-block-a" data-role="content">
|
||||
<h1>Dichiarazione Attrezzaggio</h1>
|
||||
</div>
|
||||
<div class="ui-block-b" data-role="content" runat="server" id="divSelMacc">
|
||||
<asp:DropDownList runat="server" ID="ddlSubMacc" DataSourceID="ods" DataTextField="CodMaccArticolo" DataValueField="IdxMacchina" AutoPostBack="True" OnSelectedIndexChanged="ddlSubMacc_SelectedIndexChanged"></asp:DropDownList>
|
||||
<asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="original_{0}" SelectMethod="getMulti" TypeName="MapoDb.DS_applicazioneTableAdapters.MSFDTableAdapter" FilterExpression="idxMacchina LIKE '%#%'">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="0" Name="IdxMacchina" SessionField="IdxMacchina" Type="String" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
</div>
|
||||
<div class="ui-grid-solo">
|
||||
<h1>Dichiarazione Attrezzaggio</h1>
|
||||
</div>
|
||||
<div class="ui-grid-a semaforoRosso" id="divWarningArt" runat="server" visible="false">
|
||||
<div class="ui-block-a" data-role="content">
|
||||
|
||||
@@ -14,58 +14,11 @@ namespace MoonProTablet.WebUserControls
|
||||
/// <summary>
|
||||
/// Determina se sia abilitato il controllo x editing
|
||||
/// </summary>
|
||||
public bool isEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.BoolSessionObj(string.Format("OdlEnab_{0}", idxMacchina));
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal(string.Format("OdlEnab_{0}", idxMacchina), value);
|
||||
}
|
||||
}
|
||||
public bool isEnabled { get; set; }
|
||||
/// <summary>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
public string idxMacchina
|
||||
{
|
||||
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>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
public string idxMacchinaSession
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.StringSessionObj("IdxMacchina");
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", value);
|
||||
}
|
||||
}
|
||||
public string idxMacchina { get; set; }
|
||||
/// <summary>
|
||||
/// codice odl selezionato
|
||||
/// </summary>
|
||||
@@ -107,38 +60,19 @@ namespace MoonProTablet.WebUserControls
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
checkBtnStatus();
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
checkAll();
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAll()
|
||||
public void checkAll()
|
||||
{
|
||||
fixSelMacc();
|
||||
lblOut.Text = "";
|
||||
checkBtnStatus();
|
||||
chkCloseOdl.Checked = memLayer.ML.cdvb("chkCloseOdl");
|
||||
chkCloseOdl.Visible = memLayer.ML.cdvb("showChkCloseOdl");
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica se la macchina MAIN sia MULTI (da DatiMacchina / redis...)
|
||||
/// </summary>
|
||||
protected bool isMulti
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataLayer.isMulti(idxMacchinaSession);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Se la machcina è MULTI --> mostro selettore
|
||||
/// </summary>
|
||||
private void fixSelMacc()
|
||||
{
|
||||
divSelMacc.Visible = isMulti;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// controlla stato bottoni abilitato
|
||||
@@ -157,7 +91,7 @@ namespace MoonProTablet.WebUserControls
|
||||
DS_applicazione.StatoMacchineRow rigaStato = null;
|
||||
try
|
||||
{
|
||||
rigaStato = DataLayer.obj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina.ToString())[0];
|
||||
rigaStato = DataLayer.obj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina)[0];
|
||||
inAttr = (rigaStato.IdxStato == 2);
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -166,7 +100,7 @@ namespace MoonProTablet.WebUserControls
|
||||
}
|
||||
try
|
||||
{
|
||||
currHasOdl = DataLayer.obj.taMSE.getByIdxMacchina(idxMacchina.ToString())[0].idxODL != 0;
|
||||
currHasOdl = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL != 0;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -189,7 +123,7 @@ namespace MoonProTablet.WebUserControls
|
||||
int idxOdl = 0;
|
||||
try
|
||||
{
|
||||
idxOdl = DataLayer.obj.taMSE.getByIdxMacchina(idxMacchina.ToString())[0].idxODL;
|
||||
idxOdl = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
updateTempoTc(idxOdl);
|
||||
updateNoteTC(idxOdl);
|
||||
}
|
||||
@@ -223,11 +157,11 @@ namespace MoonProTablet.WebUserControls
|
||||
/// <param name="idxODL"></param>
|
||||
private void processaEvento(int idxEvento, string userMsg, int idxODL)
|
||||
{
|
||||
DS_applicazione.StatoMacchineRow rigaStato = DataLayer.obj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina.ToString())[0];
|
||||
DS_applicazione.StatoMacchineRow rigaStato = DataLayer.obj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina)[0];
|
||||
// ricavo codice articolo...
|
||||
string CodArticolo = DataLayer.obj.taODL.getByIdx(idxODL, false)[0].CodArticolo;
|
||||
// processo evento...
|
||||
MapoDb.inputComando inCmd = controllerMapo.scriviRigaEventoBarcode(idxMacchina.ToString(), idxEvento, CodArticolo, "", rigaStato.MatrOpr, rigaStato.pallet);
|
||||
MapoDb.inputComando inCmd = controllerMapo.scriviRigaEventoBarcode(idxMacchina, idxEvento, CodArticolo, "", rigaStato.MatrOpr, rigaStato.pallet);
|
||||
if (inCmd.needStatusRefresh)
|
||||
{
|
||||
// chiamo refresh MSE
|
||||
@@ -289,13 +223,13 @@ namespace MoonProTablet.WebUserControls
|
||||
int idxODL = 0;
|
||||
try
|
||||
{
|
||||
idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina.ToString())[0].IdxODL;
|
||||
DataLayer.obj.taODL.splitODL(idxODL, idxMacchina.ToString(), TCAssegnato(idxODL), string.Format("inizio attrezzaggio, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxODL, TCAssegnato(idxODL)), false);
|
||||
idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
DataLayer.obj.taODL.splitODL(idxODL, idxMacchina, TCAssegnato(idxODL), string.Format("inizio attrezzaggio, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxODL, TCAssegnato(idxODL)), false);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// avvio NUOVO ODL
|
||||
DataLayer.obj.taODL.inizioSetup(idxODLSel, idxMacchina.ToString(), TCRichAttr, txtNote.Text);
|
||||
DataLayer.obj.taODL.inizioSetup(idxODLSel, idxMacchina, TCRichAttr, txtNote.Text);
|
||||
int idxEvento = 2; // !!!HARD CODED
|
||||
processaEvento(idxEvento, String.Format("Registrata inizio attrezzaggio per ODL {0}", idxODLSel), idxODLSel);
|
||||
// ricarico...
|
||||
@@ -320,7 +254,7 @@ namespace MoonProTablet.WebUserControls
|
||||
TCRichAttr = TCAssegnato(idxODLSel);
|
||||
}
|
||||
// leggo idxOdl da ultimo odl attivo x macchina
|
||||
int idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina.ToString())[0].IdxODL;
|
||||
int idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
int idxEvento = 1; // !!!HARD CODED
|
||||
// aggiorno (se necessario) note e tempo setup
|
||||
DataLayer.obj.taODL.updateSetup(idxODL, TCRichAttr, txtNote.Text);
|
||||
@@ -345,7 +279,7 @@ namespace MoonProTablet.WebUserControls
|
||||
protected void btnEndProd_Click(object sender, EventArgs e)
|
||||
{
|
||||
// leggo idxOdl da ultimo odl attivo x macchina
|
||||
int idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina.ToString())[0].IdxODL;
|
||||
int idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
int idxEvento = 7; // !!!HARD CODED
|
||||
|
||||
// confermo prod vecchio ODL
|
||||
@@ -359,7 +293,7 @@ namespace MoonProTablet.WebUserControls
|
||||
try
|
||||
{
|
||||
// processo
|
||||
DataLayer.obj.taODL.fineProd(idxODL, idxMacchina.ToString());
|
||||
DataLayer.obj.taODL.fineProd(idxODL, idxMacchina);
|
||||
processaEvento(idxEvento, String.Format("Registrata fine produzione per ODL {0}", idxODL), idxODL);
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -374,7 +308,7 @@ namespace MoonProTablet.WebUserControls
|
||||
try
|
||||
{
|
||||
// effettuo split su nuovo ODL
|
||||
DataLayer.obj.taODL.splitODL(idxODL, idxMacchina.ToString(), TCAssegnato(idxODL), string.Format("Fine Produzione, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxODL, TCAssegnato(idxODL)), false);
|
||||
DataLayer.obj.taODL.splitODL(idxODL, idxMacchina, TCAssegnato(idxODL), string.Format("Fine Produzione, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxODL, TCAssegnato(idxODL)), false);
|
||||
|
||||
// processo chiusura setup
|
||||
processaEvento(idxEvento, String.Format("Registrata fine produzione per ODL {0}, nuovo ODL per quantità residua", idxODL), idxODL);
|
||||
@@ -401,15 +335,15 @@ namespace MoonProTablet.WebUserControls
|
||||
if (confZero)
|
||||
{
|
||||
// confermo produzione ZERO pezzi (in setup)
|
||||
DataLayer.obj.confermaProdMacchina(idxMacchina.ToString(), memLayer.ML.confReadInt("modoConfProd"), 0, 0);
|
||||
DataLayer.obj.confermaProdMacchina(idxMacchina, memLayer.ML.confReadInt("modoConfProd"), 0, 0);
|
||||
}
|
||||
else // se NON sono in setup verifico se ho pz da confermare
|
||||
{
|
||||
// recupero pz da confermare
|
||||
DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina.ToString())[0];
|
||||
DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina)[0];
|
||||
if (rigaProd.pezziNonConfermati > 0)
|
||||
{
|
||||
DataLayer.obj.confermaProdMacchina(idxMacchina.ToString(), memLayer.ML.confReadInt("modoConfProd"), rigaProd.pezziNonConfermati, 0);
|
||||
DataLayer.obj.confermaProdMacchina(idxMacchina, memLayer.ML.confReadInt("modoConfProd"), rigaProd.pezziNonConfermati, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -423,7 +357,7 @@ namespace MoonProTablet.WebUserControls
|
||||
bool splitOdl = true;
|
||||
fixSplitBtn(splitOdl);
|
||||
// recupero current idx
|
||||
int currODL = DataLayer.obj.taODL.getByMacchina(idxMacchina.ToString())[0].IdxODL;
|
||||
int currODL = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
updateTempoTc(currODL);
|
||||
updateNoteTC(currODL);
|
||||
}
|
||||
@@ -450,7 +384,7 @@ namespace MoonProTablet.WebUserControls
|
||||
protected void btnSplitODL_Click(object sender, EventArgs e)
|
||||
{
|
||||
// chiamo stored che genera nuovo ODL, mette note e tempo, chiude vecchi e assegna nuovo...
|
||||
int currODL = DataLayer.obj.taODL.getByMacchina(idxMacchina.ToString())[0].IdxODL;
|
||||
int currODL = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
int idxEvento = 1; // !!!HARD CODED
|
||||
// controllo se TC è valorizzato..
|
||||
if (TCRichAttr == 0)
|
||||
@@ -462,7 +396,7 @@ namespace MoonProTablet.WebUserControls
|
||||
confermaProdOdl(false);
|
||||
|
||||
// effettuo split su nuovo ODL
|
||||
DataLayer.obj.taODL.splitODL(currODL, idxMacchina.ToString(), TCRichAttr, txtNote.Text, true);
|
||||
DataLayer.obj.taODL.splitODL(currODL, idxMacchina, TCRichAttr, txtNote.Text, true);
|
||||
|
||||
// invio email!
|
||||
DataLayer.obj.sendWarnTcChangeReq(memLayer.ML.confReadString("_adminEmail"));
|
||||
@@ -548,9 +482,5 @@ namespace MoonProTablet.WebUserControls
|
||||
}
|
||||
|
||||
|
||||
protected void ddlSubMacc_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
checkAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
-27
@@ -12,33 +12,6 @@ namespace MoonProTablet.WebUserControls {
|
||||
|
||||
public partial class mod_ODL {
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divSelMacc.
|
||||
/// </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.HtmlControls.HtmlGenericControl divSelMacc;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo ddlSubMacc.
|
||||
/// </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.DropDownList ddlSubMacc;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo ods.
|
||||
/// </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.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divWarningArt.
|
||||
/// </summary>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<!-- timer refresh dettaglio macchina: 1 sec, 1'000 ms -->
|
||||
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick">
|
||||
<asp:Timer ID="dmTimer" runat="server" Interval="1000" OnTick="Timer1_Tick">
|
||||
</asp:Timer>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace MoonProTablet.WebUserControls
|
||||
// controllo se ho dett macchina altrimenti ritorno a pagina generale...
|
||||
if (idxMacchina == "")
|
||||
{
|
||||
dmTimer.Interval = memLayer.ML.CRI("dtTimerInt");
|
||||
Response.Redirect("~/MappaStato.aspx");
|
||||
}
|
||||
}
|
||||
|
||||
+5
-6
@@ -7,10 +7,9 @@
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
|
||||
|
||||
namespace MoonProTablet.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_dettMacchina {
|
||||
|
||||
/// <summary>
|
||||
@@ -68,12 +67,12 @@ namespace MoonProTablet.WebUserControls
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo Timer1.
|
||||
/// Controllo dmTimer.
|
||||
/// </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.Timer Timer1;
|
||||
protected global::System.Web.UI.Timer dmTimer;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user