From e757d7ad9f47bef1d1df77826b9a2fbc90aa240f Mon Sep 17 00:00:00 2001 From: samuele Date: Wed, 14 Jan 2009 13:25:24 +0000 Subject: [PATCH] Inserita gestione ambiti guasto git-svn-id: https://keyhammer.ath.cx/svn/WebGIM/trunk@10 3e04ef4b-3b25-4b6c-be27-bb5389ca777b --- WebSites/WebGIM/Appunti.txt | 3 +- WebSites/WebGIM/adminDB.aspx.cs | 5 ++ WebSites/WebGIM/anagAmbitiGuasto.aspx | 8 ++ WebSites/WebGIM/anagAmbitiGuasto.aspx.cs | 13 +++ WebSites/WebGIM/mod_anagAmbitiGuasto.ascx | 90 +++++++++++++++++++ WebSites/WebGIM/mod_anagAmbitiGuasto.ascx.cs | 95 ++++++++++++++++++++ WebSites/WebGIM/mod_vocabolario.ascx | 3 +- WebSites/WebGIM/sql/GIM_0000.sql | 10 +-- WebSites/WebGIM/sql/GIM_0002.sql | 45 ++++++++++ 9 files changed, 262 insertions(+), 10 deletions(-) create mode 100644 WebSites/WebGIM/anagAmbitiGuasto.aspx create mode 100644 WebSites/WebGIM/anagAmbitiGuasto.aspx.cs create mode 100644 WebSites/WebGIM/mod_anagAmbitiGuasto.ascx create mode 100644 WebSites/WebGIM/mod_anagAmbitiGuasto.ascx.cs diff --git a/WebSites/WebGIM/Appunti.txt b/WebSites/WebGIM/Appunti.txt index 191e2ef..2c49e51 100644 --- a/WebSites/WebGIM/Appunti.txt +++ b/WebSites/WebGIM/Appunti.txt @@ -19,4 +19,5 @@ NOTE: copiare versione anagrafica di Steamware SOLO CON GIM (anche ci fosse altro cambia poco comunque...) Iscrizione automatica utenti - - poiché non daremo URM e alla bse gli utenti DEVONo essere di tipo GIM_U, va creata una pagina x inserire il cliente in caso di unauth nella tab DIRITTI con ruolo base da WebConfig ("dirittoAutoEnroll") - deve anche chiedere nome/cognome/email utenteS \ No newline at end of file + - poiché non daremo URM e alla bse gli utenti DEVONo essere di tipo GIM_U, va creata una pagina x inserire il cliente in caso di unauth nella tab DIRITTI con ruolo base da WebConfig ("dirittoAutoEnroll") - deve anche chiedere nome/cognome/email utente + \ No newline at end of file diff --git a/WebSites/WebGIM/adminDB.aspx.cs b/WebSites/WebGIM/adminDB.aspx.cs index 57b4e88..acfdf8f 100644 --- a/WebSites/WebGIM/adminDB.aspx.cs +++ b/WebSites/WebGIM/adminDB.aspx.cs @@ -193,6 +193,11 @@ public partial class adminDB : System.Web.UI.Page lblResult.Text = "Creato DB Anagrafica!"; #endif } + /// + /// update dell'anagrafica + /// + /// + /// protected void btnUpdAnag_Click(object sender, EventArgs e) { lblResult.Text = "...non implementato..."; diff --git a/WebSites/WebGIM/anagAmbitiGuasto.aspx b/WebSites/WebGIM/anagAmbitiGuasto.aspx new file mode 100644 index 0000000..69cc709 --- /dev/null +++ b/WebSites/WebGIM/anagAmbitiGuasto.aspx @@ -0,0 +1,8 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/AjaxSearch.master" AutoEventWireup="true" CodeFile="anagAmbitiGuasto.aspx.cs" Inherits="anagAmbitiGuasto" %> + +<%@ Register src="mod_anagAmbitiGuasto.ascx" tagname="mod_anagAmbitiGuasto" tagprefix="uc1" %> + + + + + diff --git a/WebSites/WebGIM/anagAmbitiGuasto.aspx.cs b/WebSites/WebGIM/anagAmbitiGuasto.aspx.cs new file mode 100644 index 0000000..22362a8 --- /dev/null +++ b/WebSites/WebGIM/anagAmbitiGuasto.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 anagAmbitiGuasto : System.Web.UI.Page +{ + protected void Page_Load(object sender, EventArgs e) + { + + } +} diff --git a/WebSites/WebGIM/mod_anagAmbitiGuasto.ascx b/WebSites/WebGIM/mod_anagAmbitiGuasto.ascx new file mode 100644 index 0000000..f81644f --- /dev/null +++ b/WebSites/WebGIM/mod_anagAmbitiGuasto.ascx @@ -0,0 +1,90 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_anagAmbitiGuasto.ascx.cs" + Inherits="mod_anagAmbitiGuasto" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebSites/WebGIM/mod_anagAmbitiGuasto.ascx.cs b/WebSites/WebGIM/mod_anagAmbitiGuasto.ascx.cs new file mode 100644 index 0000000..92a80d9 --- /dev/null +++ b/WebSites/WebGIM/mod_anagAmbitiGuasto.ascx.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using SteamWare; + +public partial class mod_anagAmbitiGuasto : 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 = ""; + } + } + + 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()); + } + } + protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e) + { + selezionatoValore(); + } + private void selezionatoValore() + { + if (eh_selezioneValore != null) + { + eh_selezioneValore(this, new EventArgs()); + } + } + protected void grView_SelectedIndexChanged(object sender, EventArgs e) + { + selezionatoValore(); + } + + protected void grView_RowEditing(object sender, GridViewEditEventArgs e) + { + // seleziono la riga corrente... + grView.SelectedIndex = e.NewEditIndex; + selezionatoValore(); + } + /// + /// 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.AnagAmbitoGuastoTableAdapter taAnagAmbito = new DS_applicazioneTableAdapters.AnagAmbitoGuastoTableAdapter(); + taAnagAmbito.Insert("-- [NUOVO] non definito --"); + grView.DataBind(); + } + +} diff --git a/WebSites/WebGIM/mod_vocabolario.ascx b/WebSites/WebGIM/mod_vocabolario.ascx index 244c8fa..712309e 100644 --- a/WebSites/WebGIM/mod_vocabolario.ascx +++ b/WebSites/WebGIM/mod_vocabolario.ascx @@ -70,7 +70,8 @@ - + diff --git a/WebSites/WebGIM/sql/GIM_0000.sql b/WebSites/WebGIM/sql/GIM_0000.sql index 9dc4bfc..55bc51e 100644 --- a/WebSites/WebGIM/sql/GIM_0000.sql +++ b/WebSites/WebGIM/sql/GIM_0000.sql @@ -7,9 +7,9 @@ * ****************************************************************/ - /*Svuoto eventuali tabelle già presenti...*/ + IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Permessi2Funzione' AND TABLE_SCHEMA = 'dbo') BEGIN DROP TABLE dbo.[Permessi2Funzione] @@ -46,6 +46,7 @@ BEGIN END GO + /* elimino stored e funzioni */ IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[f_padLeft]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT')) @@ -54,11 +55,4 @@ DROP FUNCTION [dbo].[f_padLeft] IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[rightDivision]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT')) DROP FUNCTION [dbo].[rightDivision] -/* -IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.ROUTINES WHERE SPECIFIC_NAME = 'rightDivision' AND ROUTINE_SCHEMA = 'dbo') -BEGIN - DROP ROUTINES dbo.rightDivision -END -*/ - GO diff --git a/WebSites/WebGIM/sql/GIM_0002.sql b/WebSites/WebGIM/sql/GIM_0002.sql index 80c05f4..5612157 100644 --- a/WebSites/WebGIM/sql/GIM_0002.sql +++ b/WebSites/WebGIM/sql/GIM_0002.sql @@ -86,6 +86,51 @@ GO COMMIT TRANSACTION GO +-- inserisco valori di default degli ambiti di guasto +SET xact_abort ON +GO + +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT dbo.AnagAmbitoGuasto ON +GO + +INSERT INTO dbo.AnagAmbitoGuasto + (idxAmbito, descrAmbitoGuasto) + VALUES (1, N'non definito') +INSERT INTO dbo.AnagAmbitoGuasto + (idxAmbito, descrAmbitoGuasto) + VALUES (2, N'usura') +INSERT INTO dbo.AnagAmbitoGuasto + (idxAmbito, descrAmbitoGuasto) + VALUES (3, N'accidentale - urti') +INSERT INTO dbo.AnagAmbitoGuasto + (idxAmbito, descrAmbitoGuasto) + VALUES (4, N'set-up') +INSERT INTO dbo.AnagAmbitoGuasto + (idxAmbito, descrAmbitoGuasto) + VALUES (5, N'rottura inserto') +INSERT INTO dbo.AnagAmbitoGuasto + (idxAmbito, descrAmbitoGuasto) + VALUES (6, N'mancanza energia') +INSERT INTO dbo.AnagAmbitoGuasto + (idxAmbito, descrAmbitoGuasto) + VALUES (7, N'preventivo') +INSERT INTO dbo.AnagAmbitoGuasto + (idxAmbito, descrAmbitoGuasto) + VALUES (8, N'errata programmazione') +INSERT INTO dbo.AnagAmbitoGuasto + (idxAmbito, descrAmbitoGuasto) + VALUES (9, N'pulizia') +GO + +SET IDENTITY_INSERT dbo.AnagAmbitoGuasto OFF +GO + +COMMIT TRANSACTION +GO + -- registro versione... INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(2, GETDATE())