112 lines
2.2 KiB
C#
112 lines
2.2 KiB
C#
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)
|
|
{
|
|
|
|
}
|
|
/// <summary>
|
|
/// Bunk corrente...
|
|
/// </summary>
|
|
public int BunkId
|
|
{
|
|
set
|
|
{
|
|
hfStackID.Value = value.ToString();
|
|
grView.DataBind();
|
|
}
|
|
get
|
|
{
|
|
int answ = 0;
|
|
int.TryParse(hfStackID.Value, out answ);
|
|
return answ;
|
|
}
|
|
}
|
|
// <summary>
|
|
/// Indice selezionato
|
|
/// </summary>
|
|
public int selIndex
|
|
{
|
|
get
|
|
{
|
|
return grView.SelectedIndex;
|
|
}
|
|
set
|
|
{
|
|
grView.SelectedIndex = value;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// SheetId selezionato
|
|
/// </summary>
|
|
public int SheetIdSel
|
|
{
|
|
get
|
|
{
|
|
int answ = 0;
|
|
try
|
|
{
|
|
int.TryParse(grView.SelectedValue.ToString(), out answ);
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// comando reset
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
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();
|
|
}
|
|
/// <summary>
|
|
/// Formatta in min/sec il tempo in sec decimale
|
|
/// </summary>
|
|
/// <param name="_timeSec"></param>
|
|
/// <returns></returns>
|
|
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;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Num totale Sheets
|
|
/// </summary>
|
|
public int numSheets
|
|
{
|
|
get
|
|
{
|
|
return grView.Rows.Count;
|
|
}
|
|
}
|
|
}
|
|
} |