diff --git a/WebSites/WebGIM/mod_tipoGuasto.ascx b/WebSites/WebGIM/mod_tipoGuasto.ascx new file mode 100644 index 0000000..25ad6d9 --- /dev/null +++ b/WebSites/WebGIM/mod_tipoGuasto.ascx @@ -0,0 +1,85 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_tipoGuasto.ascx.cs" Inherits="mod_tipoGuasto" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebSites/WebGIM/mod_tipoGuasto.ascx.cs b/WebSites/WebGIM/mod_tipoGuasto.ascx.cs new file mode 100644 index 0000000..895e09f --- /dev/null +++ b/WebSites/WebGIM/mod_tipoGuasto.ascx.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using SteamWare; + +public partial class mod_tipoGuasto : ApplicationUserControl +{ + public event EventHandler eh_selezioneValore; + public event EventHandler eh_resetSelezione; + /// + /// evento dati associati a controllo + /// + /// + /// + protected void grView_DataBound(object sender, EventArgs e) + { + if (grView.Rows.Count > 0) + { + LinkButton lb; + // aggiorno gli headers + foreach (TableCell cella in grView.HeaderRow.Cells) + { + try + { + lb = (LinkButton)cella.Controls[0]; + lb.Text = traduci(lb.Text); + } + catch + { } + } + int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1); + lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord); + } + else + { + lblNumRec.Text = ""; + } + } + /// + /// reset delle selezioni + /// + /// + /// + protected void btnReset_Click(object sender, EventArgs e) + { + resetSelezione(); + } + /// + /// resetta la selezione dei valori in caso di modifiche su altri controlli + /// + public void resetSelezione() + { + grView.SelectedIndex = -1; + grView.DataBind(); + if (eh_resetSelezione != null) + { + eh_resetSelezione(this, new EventArgs()); + } + } + /// + /// seleziono valore in editing... + /// + /// + /// + protected void grView_RowEditing(object sender, GridViewEditEventArgs e) + { + // seleziono la riga corrente... + grView.SelectedIndex = e.NewEditIndex; + } + /// + /// gestione evento inserimento nuovo record standard (se ZERO presenti) + /// + /// + /// + protected void btnNewFromEmpty_Click(object sender, EventArgs e) + { + // reset selezione... + resetSelezione(); + // i primi valori ("0") di default sono "ND"... li inserisco come standard... + DS_applicazioneTableAdapters.AnagTipoGuastoTableAdapter taTipo = new DS_applicazioneTableAdapters.AnagTipoGuastoTableAdapter(); + taTipo.Insert("-- [NUOVO] non definito --"); + grView.DataBind(); + } +} \ No newline at end of file diff --git a/WebSites/WebGIM/tipoGuasto.aspx b/WebSites/WebGIM/tipoGuasto.aspx new file mode 100644 index 0000000..4d33c5b --- /dev/null +++ b/WebSites/WebGIM/tipoGuasto.aspx @@ -0,0 +1,8 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/AjaxSearch.master" AutoEventWireup="true" CodeFile="tipoGuasto.aspx.cs" Inherits="tipoGuasto" %> + +<%@ Register src="mod_tipoGuasto.ascx" tagname="mod_tipoGuasto" tagprefix="uc1" %> + + + + + diff --git a/WebSites/WebGIM/tipoGuasto.aspx.cs b/WebSites/WebGIM/tipoGuasto.aspx.cs new file mode 100644 index 0000000..c31fe0b --- /dev/null +++ b/WebSites/WebGIM/tipoGuasto.aspx.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +public partial class tipoGuasto : System.Web.UI.Page +{ + protected void Page_Load(object sender, EventArgs e) + { + + } +}