using MapoDb; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace MoonProTablet.WebUserControls { public partial class cmp_newODL : System.Web.UI.UserControl { /// /// registrato nuovo valore /// public event EventHandler eh_newVal; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { setDefaults(); } } /// /// idxMacchina selezionata /// public string idxMacchina { get { return hfIdxMacchina.Value; } set { hfIdxMacchina.Value = value; } } /// /// imposta valori std /// private void setDefaults() { txtNumPz.Text = "1"; txtTC_min.Text = "1"; txtTC_sec.Text = "0"; } protected void lbtCreaOdlProvv_Click(object sender, EventArgs e) { // effettua creazione ODL provvisorio e riporta a parent... int numPz = 1; int.TryParse(txtNumPz.Text, out numPz); int numMin = 0; int numSec = 0; int.TryParse(txtTC_min.Text, out numMin); int.TryParse(txtTC_sec.Text, out numSec); decimal tCiclo = numMin + ((decimal)numSec) / 60; // !!!FARE!!! //DataLayer.obj.taODL.insertProvv(ddlArticolo.SelectedValue, idxMacchina, numPz, tCiclo, txtNote.Text.Trim()); // invio email notifica creazione ODL PROVVISORIO (da riconciliare...) // sollevo evento! if (eh_newVal != null) { eh_newVal(this, new EventArgs()); } } protected void txtSearch_TextChanged(object sender, EventArgs e) { ddlArticolo.DataBind(); } } }