Files
MoonPro.net/MP-Tablet/ODL.aspx.cs
T
2016-11-14 11:10:03 +01:00

74 lines
2.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using MapoDb;
namespace MoonProTablet
{
public partial class ODL : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Session["TipoLink"] = "EditMacch";
checkConfProd();
}
}/// <summary>
/// idx macchina selezionata
/// </summary>
public int idxMacchina
{
get
{
return memLayer.ML.IntSessionObj("IdxMacchina");
}
set
{
memLayer.ML.setSessionVal("IdxMacchina", value);
}
}
/// <summary>
/// verifica se sia necessario confermare la produzione PRIMA di operare sull'ODL
/// </summary>
private void checkConfProd()
{
bool needConfProd = true;
int pz2conf = 0;
//int idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina.ToString())[0].IdxODL;
DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd;
try
{
rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina.ToString())[0];
pz2conf = rigaProd.pezziNonConfermati;
needConfProd = (pz2conf > 0);
}
catch
{
logger.lg.scriviLog(string.Format("Errore recupero pezzi da confermare per la macchina {0}", idxMacchina), tipoLog.ERROR);
}
// se necessario mostro warning...
if (needConfProd)
{
lblWarningHead.Text = traduci("ConfProdBeforeContinueHead");
lblWarningBody.Text = traduci("ConfProdBeforeContinueBody");
lblNumPz2Conf.Text = string.Format("{0} pz NC", pz2conf);
}
divPz2Conf.Visible = needConfProd;
mod_ODL1.isEnabled = !needConfProd;
}
/// <summary>
/// effettua traduzione del lemma
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(string lemma)
{
return user_std.UtSn.Traduci(lemma);
}
}
}