using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace NKC_WF.WebUserControls { public partial class cmp_BP_sheetList : BaseUserControl { protected void Page_Load(object sender, EventArgs e) { } /// /// Bunk corrente... /// public int BunkId { set { hfStackID.Value = value.ToString(); grView.DataBind(); } get { int answ = 0; int.TryParse(hfStackID.Value, out answ); return answ; } } // /// Indice selezionato /// public int selIndex { get { return grView.SelectedIndex; } set { grView.SelectedIndex = value; } } /// /// SheetId selezionato /// public int SheetIdSel { get { int answ = 0; try { int.TryParse(grView.SelectedValue.ToString(), out answ); } catch { } return answ; } } /// /// comando reset /// /// /// protected void lbtReset_Click(object sender, EventArgs e) { resetSelezione(); } public void resetSelezione() { //lblStack.Text = ""; grView.SelectedIndex = -1; grView.DataBind(); raiseEvent(); } protected void grView_SelectedIndexChanged(object sender, EventArgs e) { raiseEvent(); } /// /// Formatta in min/sec il tempo in sec decimale /// /// /// public string formatMinSec(object _timeSec) { int totSec = 0; string answ = ""; int.TryParse(_timeSec.ToString().Replace(".",""), out totSec); int numMin = totSec / 60; int numSec = totSec - (60 * numMin); answ = $"{numMin:00}:{numSec:00}"; return answ; } /// /// Num totale Sheets /// public int numSheets { get { return grView.Rows.Count; } } } }