diff --git a/NKC_WF/WebUserControls/cmp_stackList.ascx.cs b/NKC_WF/WebUserControls/cmp_stackList.ascx.cs index aa0848f..1e21d0d 100644 --- a/NKC_WF/WebUserControls/cmp_stackList.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_stackList.ascx.cs @@ -7,120 +7,123 @@ using System.Web.UI.WebControls; namespace NKC_WF.WebUserControls { - public partial class cmp_stackList : BaseUserControl - { - protected void Page_Load(object sender, EventArgs e) + public partial class cmp_stackList : BaseUserControl { - if (!Page.IsPostBack) - { - checkVisibility(); - } - } - - private void checkVisibility() - { - divSelected.Visible = StackIdSel > 0; - grView.Visible = !divSelected.Visible; - // imposto css titolo... - string titleClass = "row"; - if (divSelected.Visible) - { - titleClass += " table-info"; - } - divTitle.Attributes.Remove("class"); - divTitle.Attributes.Add("class", titleClass); - } - public int BatchId - { - set - { - hfBatchId.Value = value.ToString(); - grView.DataBind(); - } - get - { - int answ = 0; - int.TryParse(hfBatchId.Value, out answ); - return answ; - } - } - protected void grView_SelectedIndexChanged(object sender, EventArgs e) - { - checkVisibility(); - raiseEvent(); - } - /// - /// comando reset - /// - /// - /// - protected void lbtReset_Click(object sender, EventArgs e) - { - resetSelezione(); - } - - public void resetSelezione() - { - lblStack.Text = ""; - grView.SelectedIndex = -1; - grView.DataBind(); - checkVisibility(); - raiseEvent(); - } - /// - /// StackId selezionato - /// - public int StackIdSel - { - get - { - int answ = 0; - try + protected void Page_Load(object sender, EventArgs e) { - int.TryParse(grView.SelectedValue.ToString(), out answ); + if (!Page.IsPostBack) + { + checkVisibility(); + } } - catch - { } - return answ; - } - } - protected void grView_RowCommand(object sender, GridViewCommandEventArgs e) - { - // recupero argomento = Takt... - try - { - string stack = e.CommandArgument.ToString(); - lblStack.Text = stack; - } - catch - { } - } - /// - /// Calcola il css x il blocco dato la condizione del num di sheets totali e preparati - /// - /// - /// - /// - public string cssByPrepared(object _numSheets, object _numPrepared) - { - string answ = "table-secondary border border-secondary border-thick rounded"; - int numSheets = 0; - int numPrepared = 0; - int.TryParse(_numSheets.ToString(), out numSheets); - int.TryParse(_numPrepared.ToString(), out numPrepared); - if (numPrepared > 0) - { - if (numPrepared == numSheets) + private void checkVisibility() { - answ = "table-success border border-success border-thick rounded"; + divSelected.Visible = StackIdSel > 0; + grView.Visible = !divSelected.Visible; + // imposto css titolo... + string titleClass = "row"; + if (divSelected.Visible) + { + titleClass += " table-info"; + } + divTitle.Attributes.Remove("class"); + divTitle.Attributes.Add("class", titleClass); } - else + public int BatchId { - answ = "table-primary flashColor rounded"; + set + { + hfBatchId.Value = value.ToString(); + grView.DataBind(); + } + get + { + int answ = 0; + int.TryParse(hfBatchId.Value, out answ); + return answ; + } + } + protected void grView_SelectedIndexChanged(object sender, EventArgs e) + { + checkVisibility(); + raiseEvent(); + } + /// + /// comando reset + /// + /// + /// + protected void lbtReset_Click(object sender, EventArgs e) + { + resetSelezione(); + } + + public void resetSelezione() + { + lblStack.Text = ""; + grView.SelectedIndex = -1; + grView.DataBind(); + checkVisibility(); + raiseEvent(); + } + /// + /// StackId selezionato + /// + public int StackIdSel + { + get + { + int answ = 0; + try + { + if (grView.SelectedValue != null) + { + int.TryParse(grView.SelectedValue.ToString(), out answ); + } + } + catch + { } + return answ; + } + } + + protected void grView_RowCommand(object sender, GridViewCommandEventArgs e) + { + // recupero argomento = Takt... + try + { + string stack = e.CommandArgument.ToString(); + lblStack.Text = stack; + } + catch + { } + } + /// + /// Calcola il css x il blocco dato la condizione del num di sheets totali e preparati + /// + /// + /// + /// + public string cssByPrepared(object _numSheets, object _numPrepared) + { + string answ = "table-secondary border border-secondary border-thick rounded"; + int numSheets = 0; + int numPrepared = 0; + int.TryParse(_numSheets.ToString(), out numSheets); + int.TryParse(_numPrepared.ToString(), out numPrepared); + if (numPrepared > 0) + { + if (numPrepared == numSheets) + { + answ = "table-success border border-success border-thick rounded"; + } + else + { + answ = "table-primary flashColor rounded"; + } + } + return answ; } - } - return answ; } - } } \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs b/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs index 11545d7..7908706 100644 --- a/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_stackLoading.ascx.cs @@ -119,37 +119,46 @@ namespace NKC_WF.WebUserControls // controllo sia quello RICHIESTO if (decoData.codeInt == cmp_stackNextloading.StackIdReq) { - // verifico SE i BUNKS correnti siano tutti stati completati (NumSheet == NumWorking) - if (currentBunkPrinted) + // controllo se il bunk richiesto sia stato caricato coi materiali... + if (!isBunkFilled(decoData.codeInt)) { - cmp_barcode.showOutput("badge badge-success", $"BUNK OK, {decoData.rawData}"); - ComLib.taktMLCurrStack = decoData.code; - // processo DB e salvo che lo stack è stato caricato in MACHINE LOAD - int stackId = 0; - try - { - var tabStacks = DataLayer.man.taSTL.getByDtmx(decoData.rawData); - if (tabStack.Count == 1) - { - stackId = tabStack[0].StackID; - } - } - catch - { } - // SE HO uno stackId valido (>0)... - if (stackId > 0) - { - DataLayer.man.taSTL.updatePos(stackId, 5); - // controllo status del bunk nel suo insieme... - ComLib.updateBatchPositionByBunk(stackId); - doRaiseEv = true; - } + cmp_barcode.showOutput("badge badge-danger", $"NEXT BUNK NOT PREPARED, {decoData.rawData}"); + doRaiseEv = true; } - // altrimenti segnalo NON pronto x caricare prossimo else { - cmp_barcode.showOutput("badge badge-danger", $"PREV BUNK NOT COMPLETED, {decoData.rawData}"); - doRaiseEv = true; + // verifico SE i BUNKS correnti siano tutti stati completati (NumSheet == NumWorking) + if (currentBunkPrinted) + { + cmp_barcode.showOutput("badge badge-success", $"BUNK OK, {decoData.rawData}"); + ComLib.taktMLCurrStack = decoData.code; + // processo DB e salvo che lo stack è stato caricato in MACHINE LOAD + int stackId = 0; + try + { + var tabStacks = DataLayer.man.taSTL.getByDtmx(decoData.rawData); + if (tabStack.Count == 1) + { + stackId = tabStack[0].StackID; + } + } + catch + { } + // SE HO uno stackId valido (>0)... + if (stackId > 0) + { + DataLayer.man.taSTL.updatePos(stackId, 5); + // controllo status del bunk nel suo insieme... + ComLib.updateBatchPositionByBunk(stackId); + doRaiseEv = true; + } + } + // altrimenti segnalo NON pronto x caricare prossimo + else + { + cmp_barcode.showOutput("badge badge-danger", $"PREV BUNK NOT COMPLETED, {decoData.rawData}"); + doRaiseEv = true; + } } } else @@ -220,6 +229,20 @@ namespace NKC_WF.WebUserControls return answ; } } + /// + /// verifica se il bunk sia stato completato come caricamento dei fogli richiesti) + /// + protected bool isBunkFilled(int BunkId) + { + bool answ = false; + // leggo i dati del bunk... + var currBunk = DataLayer.man.taSTL.getByKey(BunkId); + if (currBunk.Count == 1) + { + answ = currBunk[0].Position == 4; + } + return answ; + } protected void checkVisibility() { diff --git a/NKC_WF/WebUserControls/cmp_taktList.ascx.cs b/NKC_WF/WebUserControls/cmp_taktList.ascx.cs index 2f0da53..821e4c6 100644 --- a/NKC_WF/WebUserControls/cmp_taktList.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_taktList.ascx.cs @@ -8,159 +8,162 @@ using System.Web.UI.WebControls; namespace NKC_WF.WebUserControls { - public partial class cmp_taktList : BaseUserControl - { - protected void Page_Load(object sender, EventArgs e) + public partial class cmp_taktList : BaseUserControl { - if (!Page.IsPostBack) - { - checkVisibility(); - } - } - - private void checkVisibility() - { - divSelected.Visible = BatchIdSel > 0; - grView.Visible = !divSelected.Visible; - // imposto css titolo... - string titleClass = "row"; - if (divSelected.Visible) - { - titleClass += " table-primary"; - } - divTitle.Attributes.Remove("class"); - divTitle.Attributes.Add("class", titleClass); - } - - /// - /// Codice CSS in base a status... - /// - /// - /// - public string cssByStatus(object _status) - { - string answ = "text-muted"; - int status = -1; - int.TryParse(_status.ToString(), out status); - switch (status) - { - case 1: - answ = "font-weight-bold text-info"; - break; - case 2: - answ = "font-weight-bold text-primary"; - break; - case 3: - answ = "font-weight-bold text-warning"; - break; - case 4: - answ = "font-weight-bold text-danger"; - break; - case 5: - answ = "font-weight-bold text-success"; - break; - case 6: - answ = "font-weight-bold text-secondary"; - break; - default: - break; - } - return answ; - } - /// - /// Converte il codice stato in effettivo campo - /// - /// - /// - public string BStatus(object _status) - { - string answ = ComLib.BatchStatusDescr(_status); - return answ; - } - /// - /// Converte il codice POSITION di un BATCH in traduzione - /// - /// - /// - public string BatchPositionStatus(object _status) - { - string answ = ComLib.PositionStatusDescr(_status); - return answ; - } - /// - /// comando reset - /// - /// - /// - protected void lbtReset_Click(object sender, EventArgs e) - { - resetSelezione(); - } - - private void resetSelezione() - { - lblTakt.Text = ""; - grView.SelectedIndex = -1; - grView.DataBind(); - checkVisibility(); - raiseReset(); - } - /// - /// BatchId selezionato - /// - public int BatchIdSel - { - get - { - int answ = 0; - try + protected void Page_Load(object sender, EventArgs e) { - int.TryParse(grView.SelectedValue.ToString(), out answ); + if (!Page.IsPostBack) + { + checkVisibility(); + } } - catch - { } - return answ; - } - } - protected void grView_SelectedIndexChanged(object sender, EventArgs e) - { - checkVisibility(); - raiseEvent(); - } - protected void grView_RowCommand(object sender, GridViewCommandEventArgs e) - { - // recupero argomento = Takt... - try - { - string takt = e.CommandArgument.ToString(); - lblTakt.Text = takt; - } - catch - { } + private void checkVisibility() + { + divSelected.Visible = BatchIdSel > 0; + grView.Visible = !divSelected.Visible; + // imposto css titolo... + string titleClass = "row"; + if (divSelected.Visible) + { + titleClass += " table-primary"; + } + divTitle.Attributes.Remove("class"); + divTitle.Attributes.Add("class", titleClass); + } + + /// + /// Codice CSS in base a status... + /// + /// + /// + public string cssByStatus(object _status) + { + string answ = "text-muted"; + int status = -1; + int.TryParse(_status.ToString(), out status); + switch (status) + { + case 1: + answ = "font-weight-bold text-info"; + break; + case 2: + answ = "font-weight-bold text-primary"; + break; + case 3: + answ = "font-weight-bold text-warning"; + break; + case 4: + answ = "font-weight-bold text-danger"; + break; + case 5: + answ = "font-weight-bold text-success"; + break; + case 6: + answ = "font-weight-bold text-secondary"; + break; + default: + break; + } + return answ; + } + /// + /// Converte il codice stato in effettivo campo + /// + /// + /// + public string BStatus(object _status) + { + string answ = ComLib.BatchStatusDescr(_status); + return answ; + } + /// + /// Converte il codice POSITION di un BATCH in traduzione + /// + /// + /// + public string BatchPositionStatus(object _status) + { + string answ = ComLib.PositionStatusDescr(_status); + return answ; + } + /// + /// comando reset + /// + /// + /// + protected void lbtReset_Click(object sender, EventArgs e) + { + resetSelezione(); + } + + private void resetSelezione() + { + lblTakt.Text = ""; + grView.SelectedIndex = -1; + grView.DataBind(); + checkVisibility(); + raiseReset(); + } + /// + /// BatchId selezionato + /// + public int BatchIdSel + { + get + { + int answ = 0; + try + { + if (grView.SelectedValue != null) + { + int.TryParse(grView.SelectedValue.ToString(), out answ); + } + } + catch + { } + return answ; + } + } + protected void grView_SelectedIndexChanged(object sender, EventArgs e) + { + checkVisibility(); + raiseEvent(); + } + + protected void grView_RowCommand(object sender, GridViewCommandEventArgs e) + { + // recupero argomento = Takt... + try + { + string takt = e.CommandArgument.ToString(); + lblTakt.Text = takt; + } + catch + { } + } + /// + /// Calcola il css x il blocco dato la positioj (logica) del TAKT + /// + /// + /// + public string cssByPosition(object _Position) + { + string answ = "table-secondary border border-secondary border-thick rounded"; + int Position = 0; + int.TryParse(_Position.ToString(), out Position); + switch (Position) + { + case 1: + answ = "table-primary flashColor rounded"; + break; + case 2: + answ = "table-success border border-success border-thick rounded"; + break; + default: + break; + } + return answ; + } } - /// - /// Calcola il css x il blocco dato la positioj (logica) del TAKT - /// - /// - /// - public string cssByPosition(object _Position) - { - string answ = "table-secondary border border-secondary border-thick rounded"; - int Position = 0; - int.TryParse(_Position.ToString(), out Position); - switch (Position) - { - case 1: - answ = "table-primary flashColor rounded"; - break; - case 2: - answ = "table-success border border-success border-thick rounded"; - break; - default: - break; - } - return answ; - } - } } \ No newline at end of file