From 3f294845c3f9783e536afacca4b05955c2daa3da Mon Sep 17 00:00:00 2001 From: Samuele Date: Mon, 17 Sep 2012 12:09:16 +0200 Subject: [PATCH] aggiunta anag fasi (funziona insert e delete) --- ETS-WS/ETS-WS/AnagFasi.aspx | 5 + ETS-WS/ETS-WS/AnagFasi.aspx.cs | 17 +++ ETS-WS/ETS-WS/AnagFasi.aspx.designer.cs | 24 ++++ .../ETS-WS/WebUserControls/mod_anagFasi.ascx | 125 ++++++++++++++++++ .../WebUserControls/mod_anagFasi.ascx.cs | 103 +++++++++++++++ .../mod_anagFasi.ascx.designer.cs | 33 +++++ 6 files changed, 307 insertions(+) create mode 100644 ETS-WS/ETS-WS/AnagFasi.aspx create mode 100644 ETS-WS/ETS-WS/AnagFasi.aspx.cs create mode 100644 ETS-WS/ETS-WS/AnagFasi.aspx.designer.cs create mode 100644 ETS-WS/ETS-WS/WebUserControls/mod_anagFasi.ascx create mode 100644 ETS-WS/ETS-WS/WebUserControls/mod_anagFasi.ascx.cs create mode 100644 ETS-WS/ETS-WS/WebUserControls/mod_anagFasi.ascx.designer.cs diff --git a/ETS-WS/ETS-WS/AnagFasi.aspx b/ETS-WS/ETS-WS/AnagFasi.aspx new file mode 100644 index 0000000..13a0442 --- /dev/null +++ b/ETS-WS/ETS-WS/AnagFasi.aspx @@ -0,0 +1,5 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/AjaxSimpleFull.Master" AutoEventWireup="true" CodeBehind="AnagFasi.aspx.cs" Inherits="ETS_WS.AnagFasi" %> +<%@ Register src="WebUserControls/mod_anagFasi.ascx" tagname="mod_anagFasi" tagprefix="uc1" %> + + + diff --git a/ETS-WS/ETS-WS/AnagFasi.aspx.cs b/ETS-WS/ETS-WS/AnagFasi.aspx.cs new file mode 100644 index 0000000..e6f2ff2 --- /dev/null +++ b/ETS-WS/ETS-WS/AnagFasi.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace ETS_WS +{ + public partial class AnagFasi : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/ETS-WS/ETS-WS/AnagFasi.aspx.designer.cs b/ETS-WS/ETS-WS/AnagFasi.aspx.designer.cs new file mode 100644 index 0000000..71b8703 --- /dev/null +++ b/ETS-WS/ETS-WS/AnagFasi.aspx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ETS_WS { + + + public partial class AnagFasi { + + /// + /// mod_anagFasi1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ETS_WS.WebUserControls.mod_anagFasi mod_anagFasi1; + } +} diff --git a/ETS-WS/ETS-WS/WebUserControls/mod_anagFasi.ascx b/ETS-WS/ETS-WS/WebUserControls/mod_anagFasi.ascx new file mode 100644 index 0000000..bfee961 --- /dev/null +++ b/ETS-WS/ETS-WS/WebUserControls/mod_anagFasi.ascx @@ -0,0 +1,125 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_anagFasi.ascx.cs" + Inherits="ETS_WS.WebUserControls.mod_anagFasi" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ETS-WS/ETS-WS/WebUserControls/mod_anagFasi.ascx.cs b/ETS-WS/ETS-WS/WebUserControls/mod_anagFasi.ascx.cs new file mode 100644 index 0000000..f05f646 --- /dev/null +++ b/ETS-WS/ETS-WS/WebUserControls/mod_anagFasi.ascx.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using ETS_Data; + +namespace ETS_WS.WebUserControls +{ + public partial class mod_anagFasi : System.Web.UI.UserControl + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + /// + /// reset della selezione + /// + /// + /// + 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(); + } + /// + /// inserisce nuovo valore da footer + /// + /// + /// + protected void lblIns_click(object sender, EventArgs e) + { + // click su inserimento, chiamo il metodo insert dell'ObjectDataSource + ods.Insert(); + } + /// + /// gestione evento richeista nuovo valore (mostra footer, ...) + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + // reset selezione... + resetSelezione(); + // mostro il footer oppure la riga dei dettagli x nuovo... + if (grView.FooterRow != null) + { + grView.FooterRow.Visible = true; + } + } + /// + /// determina se sia eliminabile il record (=non usato) + /// + /// + /// + public bool delEnabled(object idxObj) + { + bool answ = true; + return answ; + } + /// + /// recupera i dati di un nuovo record contenuti nel footer di un gridView; + /// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...) + /// + /// + /// + protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e) + { + // leggo i valori! + e.InputParameters["codFase"] = ((TextBox)grView.FooterRow.FindControl("txtCodFase")).Text.Substring(0, 2); + e.InputParameters["descrizione"] = ((TextBox)grView.FooterRow.FindControl("txtDescrizione")).Text; + e.InputParameters["folderName"] = ((TextBox)grView.FooterRow.FindControl("txtFolderName")).Text; + } + + /// + /// refresh post edit + /// + /// + /// + protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e) + { + grView.DataBind(); + } + /// + /// refresh post delete + /// + /// + /// + protected void ods_Deleted(object sender, ObjectDataSourceStatusEventArgs e) + { + grView.DataBind(); + } + } +} \ No newline at end of file diff --git a/ETS-WS/ETS-WS/WebUserControls/mod_anagFasi.ascx.designer.cs b/ETS-WS/ETS-WS/WebUserControls/mod_anagFasi.ascx.designer.cs new file mode 100644 index 0000000..1252d8f --- /dev/null +++ b/ETS-WS/ETS-WS/WebUserControls/mod_anagFasi.ascx.designer.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ETS_WS.WebUserControls { + + + public partial class mod_anagFasi { + + /// + /// grView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView grView; + + /// + /// ods control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource ods; + } +}