Files
MoonPro.net/MP-Tablet/WebUserControls/mod_commenti.ascx.cs
T
2016-11-14 11:10:03 +01:00

83 lines
2.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MapoDb;
using SteamWare;
namespace MoonProTablet.WebUserControls
{
public partial class mod_commenti : System.Web.UI.UserControl
{
/// <summary>
/// registrata richiesta
/// </summary>
public event EventHandler eh_reqEdit;
protected void Page_Load(object sender, EventArgs e)
{
}
/// <summary>
/// abilitazione edit commenti
/// </summary>
public bool enableEdit
{
get
{
return memLayer.ML.confReadBool("commEnableEditDel");
}
}
public void doUpdate()
{
repComm.DataBind();
}
/// <summary>
/// carico x edit commento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnEdit_Click(object sender, ImageClickEventArgs e)
{
ImageButton imgBtn = (ImageButton)sender;
DateTime inizioStato = Convert.ToDateTime(imgBtn.CommandArgument);
memLayer.ML.setSessionVal("inizioStato", inizioStato);
// sollevo evento!
if (eh_reqEdit != null)
{
eh_reqEdit(this, new EventArgs());
}
//string idxMacchina = memLayer.ML.StringSessionObj("idxMacchina");
//DS_applicazione.EventListRow riga = null;
//try
//{
// riga = DataLayer.obj.taEventi.GetByMacchinaPeriodo(idxMacchina, inizioStato, inizioStato)[0];
//txtDate.Text = riga.InizioStato.ToString("yyyy-MM-dd");
//txtTime.Text = riga.InizioStato.ToString("HH:mm");
//txtCommento.Text = riga.Value;
//}
//catch
//{ }
//fixPanels(false, true, false);
}
/// <summary>
/// elimina commento
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDel_Click(object sender, ImageClickEventArgs e)
{
ImageButton imgBtn = (ImageButton)sender;
DateTime inizioStato = Convert.ToDateTime(imgBtn.CommandArgument);
string idxMacchina = memLayer.ML.StringSessionObj("idxMacchina");
DataLayer.obj.taEventi.DeleteQuery(idxMacchina, inizioStato);
doUpdate();
}
}
}