101 lines
2.9 KiB
C#
101 lines
2.9 KiB
C#
using MapoDb;
|
|
using SteamWare;
|
|
using System;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace MoonProTablet.WebUserControls
|
|
{
|
|
public partial class mod_commenti : BaseUserControl
|
|
{
|
|
/// <summary>
|
|
/// registrata richiesta
|
|
/// </summary>
|
|
public event EventHandler eh_reqEdit;
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
ddlPageSize.DataBind();
|
|
// verifico SE deve rileggere da sessione
|
|
if (memLayer.ML.CRB("preselFromSession"))
|
|
{
|
|
try
|
|
{
|
|
ddlPageSize.SelectedValue = numPagSize.ToString();
|
|
}
|
|
catch
|
|
{ }
|
|
}
|
|
else
|
|
{
|
|
// imposto da valore DEFAULT
|
|
ddlPageSize.SelectedValue = memLayer.ML.CRS("mod_commenti_ddlPageSize");
|
|
}
|
|
}
|
|
}
|
|
|
|
protected int numPagSize
|
|
{
|
|
get
|
|
{
|
|
return memLayer.ML.IntSessionObj("mod_commenti_numPagSize");
|
|
}
|
|
set
|
|
{
|
|
memLayer.ML.setSessionVal("mod_commenti_numPagSize", value);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// abilitazione edit commenti
|
|
/// </summary>
|
|
public bool enableEdit
|
|
{
|
|
get
|
|
{
|
|
return memLayer.ML.CRB("commEnableEditDel");
|
|
}
|
|
}
|
|
|
|
public void doUpdate()
|
|
{
|
|
repComm.DataBind();
|
|
}
|
|
|
|
/// <summary>
|
|
/// carico x edit commento
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void lbtEdit_Click(object sender, EventArgs e)
|
|
{
|
|
LinkButton imgBtn = (LinkButton)sender;
|
|
DateTime inizioStato = Convert.ToDateTime(imgBtn.CommandArgument);
|
|
memLayer.ML.setSessionVal("inizioStato", inizioStato);
|
|
// sollevo evento!
|
|
if (eh_reqEdit != null)
|
|
{
|
|
eh_reqEdit(this, new EventArgs());
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// elimina commento
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void lbtDel_Click(object sender, EventArgs e)
|
|
{
|
|
LinkButton imgBtn = (LinkButton)sender;
|
|
DateTime inizioStato = Convert.ToDateTime(imgBtn.CommandArgument);
|
|
string idxMacchina = memLayer.ML.StringSessionObj("idxMacchina");
|
|
DataLayerObj.taEventi.DeleteQuery(idxMacchina, inizioStato);
|
|
doUpdate();
|
|
}
|
|
|
|
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
numPagSize = Convert.ToInt16(ddlPageSize.SelectedValue);
|
|
}
|
|
}
|
|
} |