Files
SSC/CMS_SC/WebUserControls/mod_validVal.ascx.cs
T
2015-06-10 12:07:03 +02:00

169 lines
4.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 CMS_SC_Data;
using SteamWare;
namespace CMS_SC.WebUserControls
{
public partial class mod_validVal : System.Web.UI.UserControl
{
/// <summary>
/// selezione valore in DettScheda
/// </summary>
public event EventHandler eh_selezioneValore;
/// <summary>
/// sollevo evento selezione
/// </summary>
protected void raiseEvent()
{
// sollevo evento nuovo valore...
if (eh_selezioneValore != null)
{
eh_selezioneValore(this, new EventArgs());
}
}
/// <summary>
/// caricamento macchina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
btnNewFromEmpty.DataBind();
}
}
/// <summary>
/// dimensione pagina grid view
/// </summary>
public int pageSize
{
get
{
return grView.PageSize;
}
set
{
grView.PageSize = value;
}
}
/// <summary>
/// richiesta di aggiunta record, tutto a zero!
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbAddNew_Click(object sender, EventArgs e)
{
insertNewRec();
}
/// <summary>
/// inserisco un nuovo record da completare...
/// </summary>
private void insertNewRec()
{
// inserisco nuovo record SE HO una selezione da URL
if (memLayer.ML.QSS("CodSchedaVers") != "")
{
DtProxy.man.taVV.insertNew(memLayer.ML.QSS("CodSchedaVers"), CodMisuraSel);
// update!
grView.DataBind();
}
}
/// <summary>
/// crea un nuovo record ...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
{
insertNewRec();
}
/// <summary>
/// wrapper traduzione
/// </summary>
/// <param name="lemma"></param>
/// <returns></returns>
public string traduci(string lemma)
{
return user_std.UtSn.Traduci(lemma);
}
/// <summary>
/// Scheda selezionata
/// </summary>
public string CodSchedaSel
{
get
{
string answ = "";
try
{
answ = grView.SelectedDataKey["CodScheda"].ToString();
}
catch
{ }
return answ;
}
}
/// <summary>
/// Versione selezionata
/// </summary>
public int VersSel
{
get
{
int answ = -1;
try
{
answ = Convert.ToInt32(grView.SelectedDataKey["Vers"].ToString());
}
catch
{ }
return answ;
}
}
/// <summary>
/// Misura selezionata
/// </summary>
public string CodMisuraSel
{
get
{
string answ = "";
try
{
answ = hfCodMisura.Value;
}
catch
{ }
return answ;
}
set
{
hfCodMisura.Value = value;
grView.DataBind();
}
}
/// <summary>
/// Misura selezionata
/// </summary>
public string MinParSel
{
get
{
string answ = "";
try
{
answ = grView.SelectedDataKey["MinPar"].ToString();
}
catch
{ }
return answ;
}
}
}
}