using System; using System.Web.UI.WebControls; namespace NKC_WF.WebUserControls { public partial class cmp_kitReqRunning : BaseUserControl { #region Public Properties public bool enableSuspend { get { bool answ = false; bool.TryParse(hfEnableSuspend.Value, out answ); return answ; } set { hfEnableSuspend.Value = value.ToString(); grView.DataBind(); } } public bool showFull { get { bool answ = false; bool.TryParse(hfShowFull.Value, out answ); return answ; } set { hfShowFull.Value = value.ToString(); grView.DataBind(); } } public bool showTitle { get { bool answ = false; bool.TryParse(hfShowTitle.Value, out answ); return answ; } set { hfShowTitle.Value = value.ToString(); fixVisibility(); } } #endregion Public Properties #region Public Methods /// /// Verifica se sia da mostrare pagina MissingInAction /// public bool showPartMIA(object plIdRaw) { bool answ = false; int plID = 0; if (int.TryParse($"{plIdRaw}", out plID)) { try { answ = DLMan.taISD.getMissingByPLID(plID).Count > 0; } catch { } } return answ; } #endregion Public Methods #region Internal Methods internal void doUpdate() { grView.DataBind(); fixVisibility(); cmp_KR_cart.doUpdate(); } #endregion Internal Methods #region Protected Methods protected void grView_SelectedIndexChanged(object sender, EventArgs e) { int PackListId = 0; int.TryParse(grView.SelectedValue.ToString(), out PackListId); // mostra dettaglio CART cmp_KR_cart.PackListID = PackListId; cmp_KR_cart.Visible = true; } /// /// comando reset /// /// /// protected void lbtReset_Click(object sender, EventArgs e) { grView.SelectedIndex = -1; doUpdate(); } protected void lbtSuspendJob_Click(object sender, EventArgs e) { int PackListId = 0; LinkButton lbtBtn = (LinkButton)sender; if (lbtBtn != null) { int.TryParse(lbtBtn.CommandArgument, out PackListId); // SOSPENDO il job selezionato e indico status approvato DLMan.taPL.updateStatus(PackListId, 2); DLMan.taPL.updateSchedPrior(PackListId, 0); DLMan.taPL.fixSched(); // resetto CART e BIN che al KIT siano NON completati... DLMan.taCR.resetKitIncomplete(); DLMan.taBN.resetKitIncomplete(); lgInfo($"Eseguito registrazione KIT INCOMPLETE x CART/BIN da lbtSuspendJob_Click | KittingStart = null"); // fix grafico! grView.SelectedIndex = -1; doUpdate(); raiseEvent(); } } protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { fixVisibility(); } } #endregion Protected Methods #region Private Methods private void fixVisibility() { cmp_KR_cart.Visible = (grView.SelectedIndex >= 0); divHeader.Visible = showTitle; } #endregion Private Methods } }