Inserita gestione ambiti guasto
git-svn-id: https://keyhammer.ath.cx/svn/WebGIM/trunk@10 3e04ef4b-3b25-4b6c-be27-bb5389ca777b
This commit is contained in:
@@ -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
|
||||
- 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
|
||||
|
||||
@@ -193,6 +193,11 @@ public partial class adminDB : System.Web.UI.Page
|
||||
lblResult.Text = "Creato DB Anagrafica!";
|
||||
#endif
|
||||
}
|
||||
/// <summary>
|
||||
/// update dell'anagrafica
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnUpdAnag_Click(object sender, EventArgs e)
|
||||
{
|
||||
lblResult.Text = "...non implementato...";
|
||||
|
||||
@@ -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" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
|
||||
<uc1:mod_anagAmbitiGuasto ID="mod_anagAmbitiGuasto1" runat="server" />
|
||||
</asp:Content>
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_anagAmbitiGuasto.ascx.cs"
|
||||
Inherits="mod_anagAmbitiGuasto" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
|
||||
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
|
||||
DataKeyNames="idxAmbito" DataSourceID="ods" OnDataBound="grView_DataBound" OnSelectedIndexChanged="grView_SelectedIndexChanged"
|
||||
OnRowEditing="grView_RowEditing">
|
||||
<RowStyle CssClass="ctrRowStyle" />
|
||||
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
|
||||
<EditRowStyle CssClass="ctrEditRowStyle" />
|
||||
<SelectedRowStyle CssClass="ctrSelRowStyle" />
|
||||
<FooterStyle CssClass="ctrFooter" />
|
||||
<PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
|
||||
<HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
|
||||
<EmptyDataRowStyle CssClass="ctrRowStyle" />
|
||||
<EmptyDataTemplate>
|
||||
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
|
||||
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
|
||||
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
|
||||
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
|
||||
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
|
||||
</EditItemTemplate>
|
||||
<HeaderTemplate>
|
||||
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click" />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
|
||||
Visible="false" ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
|
||||
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
|
||||
ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
|
||||
</ItemTemplate>
|
||||
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="idxAmbito" HeaderText="idxAmbito" InsertVisible="False"
|
||||
Visible="false" ReadOnly="True" SortExpression="idxAmbito" />
|
||||
<asp:TemplateField HeaderText="descrAmbitoGuasto"
|
||||
SortExpression="descrAmbitoGuasto">
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TextBox1" runat="server" Width="30em"
|
||||
Text='<%# Bind("descrAmbitoGuasto") %>'></asp:TextBox>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Bind("descrAmbitoGuasto") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<HeaderTemplate>
|
||||
<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />
|
||||
</HeaderTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
|
||||
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma, SteamWare.dimImg.small) %>' />
|
||||
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
|
||||
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla, SteamWare.dimImg.small) %>' />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
|
||||
ToolTip='<%# traduci("Delete") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina, SteamWare.dimImg.small) %>' />
|
||||
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
|
||||
TargetControlID="imgDelete">
|
||||
</cc1:ConfirmButtonExtender>
|
||||
</ItemTemplate>
|
||||
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini"></asp:Label>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.AnagAmbitoGuastoTableAdapter"
|
||||
UpdateMethod="Update" DeleteMethod="DeleteQuery" OldValuesParameterFormatString="Original_{0}"
|
||||
FilterExpression="descrAmbitoGuasto LIKE '%{0}%' " OnUpdated="ods_Updated" InsertMethod="Insert">
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="descrAmbitoGuasto" Type="String" />
|
||||
<asp:Parameter Name="Original_idxAmbito" Type="Int32" />
|
||||
</UpdateParameters>
|
||||
<FilterParameters>
|
||||
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
|
||||
</FilterParameters>
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_idxAmbito" Type="Int32" />
|
||||
</DeleteParameters>
|
||||
<InsertParameters>
|
||||
<asp:Parameter Name="descrAmbitoGuasto" Type="String" />
|
||||
</InsertParameters>
|
||||
</asp:ObjectDataSource>
|
||||
@@ -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;
|
||||
/// <summary>
|
||||
/// evento dati associati a controllo
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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();
|
||||
}
|
||||
/// <summary>
|
||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||
/// </summary>
|
||||
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();
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento inserimento nuovo record standard (se ZERO presenti)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -70,7 +70,8 @@
|
||||
<EditRowStyle CssClass="ctrEditRowStyle"></EditRowStyle>
|
||||
<AlternatingRowStyle CssClass="ctrAltRowStyle"></AlternatingRowStyle>
|
||||
</asp:GridView>
|
||||
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini"></asp:Label><asp:ObjectDataSource ID="ods" runat="server" SelectMethod="getVocabolario" TypeName="selData"
|
||||
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini"></asp:Label>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="getVocabolario" TypeName="selData"
|
||||
UpdateMethod="updateLemmaVoc" DeleteMethod="deleteLemmaVoc" OldValuesParameterFormatString="Original_{0}"
|
||||
FilterExpression="Traduzione LIKE '%{0}%' OR Lemma LIKE '%{0}%' " OnUpdated="ods_Updated">
|
||||
<UpdateParameters>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user