96 lines
2.4 KiB
C#
96 lines
2.4 KiB
C#
using SteamWare;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace WebSCR.WebUserControls
|
|
{
|
|
public partial class mod_selDataOra : System.Web.UI.UserControl
|
|
{
|
|
/// <summary>
|
|
/// selezionata NUOVA data
|
|
/// </summary>
|
|
public event EventHandler eh_update;
|
|
/// <summary>
|
|
/// solleva evento selezione data
|
|
/// </summary>
|
|
protected void reportEvent()
|
|
{
|
|
// evento!
|
|
if (eh_update != null)
|
|
{
|
|
eh_update(this, new EventArgs());
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// stringa UID univoca
|
|
/// </summary>
|
|
public string uid
|
|
{
|
|
get
|
|
{
|
|
return this.UniqueID.Replace("$", "_").Replace("-", "_");
|
|
}
|
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
}
|
|
/// <summary>
|
|
/// data-ora selezionata
|
|
/// </summary>
|
|
public DateTime dataOraSel
|
|
{
|
|
get
|
|
{
|
|
DateTime answ = DateTime.Now;
|
|
try
|
|
{
|
|
answ = Convert.ToDateTime(txtDataSel.Text.Trim());
|
|
// aggiungo ora
|
|
DateTime oraSel = Convert.ToDateTime(ddlOrario.SelectedValue);
|
|
double ore = oraSel.Hour + Convert.ToDouble(oraSel.Minute) / 60;
|
|
answ = answ.AddHours(ore);
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
set
|
|
{
|
|
ddlOrario.DataBind();
|
|
try
|
|
{
|
|
txtDataSel.Text = string.Format("{0:yyyy-MM-dd}", value);
|
|
ddlOrario.SelectedValue = string.Format("{0:HH:mm:00}", value);
|
|
}
|
|
catch
|
|
{ }
|
|
}
|
|
}
|
|
public bool showData
|
|
{
|
|
get
|
|
{
|
|
return txtDataSel.Visible;
|
|
}
|
|
set
|
|
{
|
|
txtDataSel.Visible = value;
|
|
}
|
|
}
|
|
public bool showOra
|
|
{
|
|
get
|
|
{
|
|
return ddlOrario.Visible;
|
|
}
|
|
set
|
|
{
|
|
ddlOrario.Visible = value;
|
|
}
|
|
}
|
|
}
|
|
} |