- Inserito modulo gestione priorità
- aggiornati script creazione DB git-svn-id: https://keyhammer.ath.cx/svn/WebGIM/trunk@11 3e04ef4b-3b25-4b6c-be27-bb5389ca777b
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
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"
|
||||
DataKeyNames="idxAmbito" DataSourceID="ods" OnDataBound="grView_DataBound"
|
||||
OnRowEditing="grView_RowEditing">
|
||||
<RowStyle CssClass="ctrRowStyle" />
|
||||
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
|
||||
@@ -73,7 +73,7 @@
|
||||
<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">
|
||||
FilterExpression="descrAmbitoGuasto LIKE '%{0}%' " InsertMethod="Insert">
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="descrAmbitoGuasto" Type="String" />
|
||||
<asp:Parameter Name="Original_idxAmbito" Type="Int32" />
|
||||
|
||||
@@ -38,7 +38,11 @@ public partial class mod_anagAmbitiGuasto : ApplicationUserControl
|
||||
lblNumRec.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// reset delle selezioni
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetSelezione();
|
||||
@@ -55,27 +59,15 @@ public partial class mod_anagAmbitiGuasto : ApplicationUserControl
|
||||
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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// seleziono valore in editing...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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)
|
||||
@@ -91,5 +83,4 @@ public partial class mod_anagAmbitiGuasto : ApplicationUserControl
|
||||
taAnagAmbito.Insert("-- [NUOVO] non definito --");
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_priorita.ascx.cs"
|
||||
Inherits="mod_priorita" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
|
||||
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
|
||||
DataKeyNames="idxPriorita" DataSourceID="ods" OnDataBound="grView_DataBound"
|
||||
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="idxPriorita" HeaderText="idxPriorita" InsertVisible="False"
|
||||
SortExpression="idxPriorita" />
|
||||
<asp:TemplateField HeaderText="descrPriorita" SortExpression="descrPriorita">
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="TextBox1" runat="server" Width="30em" Text='<%# Bind("descrPriorita") %>'></asp:TextBox>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Bind("descrPriorita") %>'></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.AnagPrioritaTableAdapter"
|
||||
UpdateMethod="UpdateQuery" DeleteMethod="DeleteQuery" OldValuesParameterFormatString="original_{0}"
|
||||
FilterExpression="descrPriorita LIKE '%{0}%' " InsertMethod="Insert">
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="idxPriorita" Type="Int32" />
|
||||
<asp:Parameter Name="descrPriorita" Type="String" />
|
||||
<asp:Parameter Name="Original_idxPriorita" Type="Int32" />
|
||||
</UpdateParameters>
|
||||
<FilterParameters>
|
||||
<asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
|
||||
</FilterParameters>
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_idxPriorita" Type="Int32" />
|
||||
</DeleteParameters>
|
||||
<InsertParameters>
|
||||
<asp:Parameter Name="idxPriorita" Type="Int32" />
|
||||
<asp:Parameter Name="descrPriorita" Type="String" />
|
||||
</InsertParameters>
|
||||
</asp:ObjectDataSource>
|
||||
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using SteamWare;
|
||||
|
||||
public partial class mod_priorita : 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 = "";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// reset delle selezioni
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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());
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// seleziono valore in editing...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_RowEditing(object sender, GridViewEditEventArgs e)
|
||||
{
|
||||
// seleziono la riga corrente...
|
||||
grView.SelectedIndex = e.NewEditIndex;
|
||||
}
|
||||
/// <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.AnagPrioritaTableAdapter taPrior = new DS_applicazioneTableAdapters.AnagPrioritaTableAdapter();
|
||||
// calcolo ultimo libero e aggiungo 1...
|
||||
int nextFree = 1;
|
||||
try
|
||||
{
|
||||
nextFree = (int)taPrior.getMaxPriorita() + 1;
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog("Errore nel recupero del max idx di prorità", tipoLog.EXCEPTION);
|
||||
}
|
||||
taPrior.Insert(nextFree, "-- [NUOVA] non definita --");
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/AjaxSearch.master" AutoEventWireup="true" CodeFile="priorita.aspx.cs" Inherits="priorita" %>
|
||||
|
||||
<%@ Register src="mod_priorita.ascx" tagname="mod_priorita" tagprefix="uc1" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
|
||||
<uc1:mod_priorita ID="mod_priorita1" 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 priorita : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,12 @@ BEGIN
|
||||
END
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'AnagPriorita' AND TABLE_SCHEMA = 'dbo')
|
||||
BEGIN
|
||||
DROP TABLE dbo.AnagPriorita
|
||||
END
|
||||
GO
|
||||
|
||||
|
||||
/* elimino stored e funzioni */
|
||||
|
||||
|
||||
@@ -168,6 +168,14 @@ GO
|
||||
COMMIT
|
||||
GO
|
||||
|
||||
-- gestione priorità
|
||||
CREATE TABLE AnagPriorita(
|
||||
idxPriorita INT NOT NULL CONSTRAINT PK_AnagPriorita PRIMARY KEY,
|
||||
descrPriorita NVARCHAR(50)
|
||||
)
|
||||
GO
|
||||
|
||||
|
||||
/*registro versione...*/
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(1, GETDATE())
|
||||
GO
|
||||
|
||||
@@ -23,9 +23,11 @@ INSERT INTO dbo.Permessi
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('ANAG_ambitiGuasto', 'anagAmbitiGuasto.aspx', 1, 1, 'AnagAmbitiGuasto', 'AnagAmbitiGuastoLong')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('ANAG_causali', 'gestioneCausali.aspx', 1, 3, 'GestioneCausali', 'GestioneCausaliLong')
|
||||
VALUES ('ANAG_causali', 'gestioneCausali.aspx', 1, 4, 'GestioneCausali', 'GestioneCausaliLong')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('ANAG_impianti', 'impianti.aspx', 1, 2, 'GestImpianti', 'GestImpiantiLong')
|
||||
VALUES ('ANAG_impianti', 'impianti.aspx', 1, 3, 'GestImpianti', 'GestImpiantiLong')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('ANAG_priorita', 'priorita.aspx', 1, 2, 'AnagPriorita', 'AnagPrioritaLong')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('PRINT', 'menu.aspx', 3, 0, 'AreaStampati', 'AreaStampatiLong')
|
||||
INSERT INTO dbo.Permessi
|
||||
@@ -63,8 +65,12 @@ INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('ANAG', N'GIM_SU', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('ANAG_ambitiGuasto', N'GIM_SU', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('ANAG_causali', N'GIM_SU', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('ANAG_impianti', N'GIM_SU', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('ANAG_priorita', N'GIM_SU', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('PRINT', N'GIM_U', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
@@ -86,6 +92,7 @@ GO
|
||||
COMMIT TRANSACTION
|
||||
GO
|
||||
|
||||
|
||||
-- inserisco valori di default degli ambiti di guasto
|
||||
SET xact_abort ON
|
||||
GO
|
||||
@@ -131,6 +138,26 @@ GO
|
||||
COMMIT TRANSACTION
|
||||
GO
|
||||
|
||||
-- elenco priorità
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
INSERT INTO dbo.AnagPriorita
|
||||
VALUES (1, N'Pericolo di infortunio')
|
||||
INSERT INTO dbo.AnagPriorita
|
||||
VALUES (2, N'Produzione Ferma')
|
||||
INSERT INTO dbo.AnagPriorita
|
||||
VALUES (3, N'Intervento fine lavoro')
|
||||
INSERT INTO dbo.AnagPriorita
|
||||
VALUES (4, N'Intervento nel mese')
|
||||
GO
|
||||
|
||||
COMMIT TRANSACTION
|
||||
GO
|
||||
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(2, GETDATE())
|
||||
|
||||
Reference in New Issue
Block a user