122 lines
2.9 KiB
C#
122 lines
2.9 KiB
C#
using SteamWare;
|
|
using System;
|
|
using System.Web.UI;
|
|
|
|
namespace GPW_Admin.WebUserControls
|
|
{
|
|
public partial class cmp_righePag : BaseUserControl
|
|
{
|
|
#region Public Events
|
|
|
|
/// <summary>
|
|
/// indicato (nuovo) numero righe x pagina
|
|
/// </summary>
|
|
public event EventHandler eh_newNum;
|
|
|
|
#endregion Public Events
|
|
|
|
#region Protected Properties
|
|
|
|
/// <summary>
|
|
/// numero righe gridview da mostrare legato a controllo textbox
|
|
/// </summary>
|
|
protected int numRowReq
|
|
{
|
|
get
|
|
{
|
|
int answ = numRowPag;
|
|
try
|
|
{
|
|
answ = Convert.ToInt32(txtNumRighe.Text.Trim());
|
|
if (answ == 0)
|
|
{
|
|
answ = numRowPag;
|
|
txtNumRighe.Text = answ.ToString();
|
|
}
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
set
|
|
{
|
|
txtNumRighe.Text = value.ToString();
|
|
}
|
|
}
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Public Properties
|
|
|
|
/// <summary>
|
|
/// numero righe per pagina (in sessione)
|
|
/// </summary>
|
|
public int numRowPag
|
|
{
|
|
get
|
|
{
|
|
int answ = 10;
|
|
try
|
|
{
|
|
answ = memLayer.ML.IntSessionObj(uid + "_numRowPag");
|
|
}
|
|
catch
|
|
{
|
|
answ = 10;
|
|
}
|
|
return answ;
|
|
}
|
|
set
|
|
{
|
|
memLayer.ML.setSessionVal(uid + "_numRowPag", value);
|
|
numRowReq = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// stringa UID univoca
|
|
/// </summary>
|
|
public string uid
|
|
{
|
|
get
|
|
{
|
|
return this.UniqueID.Replace("$", "_").Replace("-", "_");
|
|
}
|
|
}
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Protected Methods
|
|
|
|
/// <summary>
|
|
/// caricamento pagina
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
numRowReq = numRowPag;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// aggiorno controllo paginazione...
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void txtNumRighe_TextChanged(object sender, EventArgs e)
|
|
{
|
|
// salvo num righe...
|
|
numRowPag = numRowReq;
|
|
// sollevo evento nuovo valore...
|
|
if (eh_newNum != null)
|
|
{
|
|
eh_newNum(this, new EventArgs());
|
|
}
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
}
|
|
} |