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 { /// /// registrata richiesta /// public event EventHandler eh_reqEdit; protected void Page_Load(object sender, EventArgs e) { } /// /// abilitazione edit commenti /// public bool enableEdit { get { return memLayer.ML.confReadBool("commEnableEditDel"); } } public void doUpdate() { repComm.DataBind(); } /// /// carico x edit commento /// /// /// 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); } /// /// elimina commento /// /// /// 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(); } } }