80 lines
2.9 KiB
C#
80 lines
2.9 KiB
C#
using MapoDb;
|
|
using SteamWare;
|
|
using System;
|
|
using System.Web.UI;
|
|
|
|
namespace MoonProTablet.WebUserControls
|
|
{
|
|
public partial class cmp_newODL : BaseUserControl
|
|
{
|
|
#region Public Events
|
|
|
|
/// <summary>
|
|
/// registrato nuovo valore
|
|
/// </summary>
|
|
public event EventHandler eh_newVal;
|
|
|
|
#endregion Public Events
|
|
|
|
#region Private Methods
|
|
|
|
/// <summary>
|
|
/// imposta valori std
|
|
/// </summary>
|
|
private void setDefaults()
|
|
{
|
|
txtNumPz.Text = "1";
|
|
txtTC_min.Text = "1";
|
|
txtTC_sec.Text = "0";
|
|
}
|
|
|
|
#endregion Private Methods
|
|
|
|
#region Protected Methods
|
|
|
|
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;
|
|
string note = txtNote.Text.Trim();
|
|
// insert su DB
|
|
DataLayerObj.taODL.insertProvv(ddlArticolo.SelectedValue, DataLayerObj.MatrOpr, idxMacchinaFix, numPz, tCiclo, note);
|
|
// calcolo stringa macchina e articolo...
|
|
var rMacchina = DataLayerObj.taMacchine.GetByIdx(idxMacchinaFix)[0];
|
|
var rArticolo = DataLayerObj.taAnagArt.getByCod(ddlArticolo.SelectedValue)[0];
|
|
string macchina = string.Format("{0} ({1} | {2} | {3})", rMacchina.Nome, idxMacchinaFix, rMacchina.CodMacchina, rMacchina.Descrizione);
|
|
string articolo = string.Format("{0} ({1} | {2})", rArticolo.DescArticolo, rArticolo.CodArticolo, rArticolo.Disegno);
|
|
// invio email notifica creazione ODL PROVVISORIO (da riconciliare...)
|
|
string subject = "Effettuato attrezzaggio con ODL provvisorio";
|
|
string oggetto = string.Format("E' stato effettuato un attrezzaggio con ODL provvisorio.<br/>Macchina: <b>{0}</b><br>Articolo: <b>{1}</b><br>Lanciati <b>{2}</b> pezzi con T.Ciclo <b>{3:N3}</b> (min.cent) / <b>{4}:{5}</b> (min:sec).<br><br>Note operatore: <b>{6}</b>", macchina, articolo, numPz, tCiclo, numMin, numSec, note);
|
|
gestEmail.geAuth.mandaEmail(memLayer.ML.CRS("_fromEmail"), memLayer.ML.CRS("_adminEmail"), subject, oggetto);
|
|
// sollevo evento!
|
|
if (eh_newVal != null)
|
|
{
|
|
eh_newVal(this, new EventArgs());
|
|
}
|
|
}
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
setDefaults();
|
|
}
|
|
}
|
|
|
|
protected void txtSearch_TextChanged(object sender, EventArgs e)
|
|
{
|
|
// bind dati!
|
|
ddlArticolo.DataBind();
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
}
|
|
} |