Inizio aggiunta modulo gestione creazione/update del DB
git-svn-id: https://keyhammer.ath.cx/svn/WebGIM/trunk@4 3e04ef4b-3b25-4b6c-be27-bb5389ca777b
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
------------------------
|
||||
- 20080113
|
||||
------------------------
|
||||
|
||||
Prerequisiti:
|
||||
- DB:
|
||||
- SteamWare_Anagrafica
|
||||
- SteamWare_Vocabolario
|
||||
- GIM
|
||||
|
||||
To Do's:
|
||||
- Realizzare modulo gestione db steamware che faccia creazione/update secondo versione
|
||||
|
||||
NOTE:
|
||||
- se la versione del db è nel web.config di sviluppo, va riportata anche nel web.config del cliente! o trovare un altro modo?!?
|
||||
@@ -86,7 +86,7 @@
|
||||
<add key="_righeDataGridMed" value="15"/>
|
||||
<add key="_righeDataGridShort" value="10"/>
|
||||
<add key="_fromEmail" value="info@steamware.net"/>
|
||||
<add key="_logLevel" value="6"/>
|
||||
<add key="_logLevel" value="5"/>
|
||||
<add key="_logMaxMb" value="30"/>
|
||||
<add key="_allowForceUser" value="true"/>
|
||||
<add key="_safePages" value="jumper.aspx#unauthorized.aspx#allegati.aspx#forceUser.aspx#login.aspx#test.aspx#istruzioni.aspx"/>
|
||||
@@ -110,6 +110,16 @@
|
||||
<add key="PermessiConnectionString" value="Data Source=localhost;Initial Catalog=SteamWare_Anagrafica;Persist Security Info=True;User id=sa;Password=keyhammer"/>
|
||||
<add key="UtenteCdcConnectionString" value="Data Source=localhost;Initial Catalog=SteamWare_Anagrafica;Persist Security Info=True;User id=sa;Password=keyhammer"/>
|
||||
<add key="VocabolarioConnectionString" value="Data Source=localhost;Initial Catalog=SteamWare_Vocabolario;Persist Security Info=True;User id=sa;Password=keyhammer"/>
|
||||
<add key="AppConnectionString" value="Data Source=localhost;Initial Catalog=GIM;Persist Security Info=True;User id=sa;Password=keyhammer"/>
|
||||
<!-- Configuraizone parte db -->
|
||||
<add key="_sqlDir" value="sql"/>
|
||||
<add key="dbUpdateEnabled" value="true"/>
|
||||
<add key="dbAuthName" value="SteamWare_Anagrafica"/>
|
||||
<add key="dbVocabName" value="SteamWare_Vocabolario"/>
|
||||
<add key="dbAppName" value="GIM"/>
|
||||
<add key="dbAuthVers" value="1"/>
|
||||
<add key="dbVocabVers" value="1"/>
|
||||
<add key="dbAppVers" value="1"/>
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<!--<add name="SteamWare_BremboConnectionString" connectionString="Data Source=localhost;Initial Catalog=SteamWare_Brembo;Persist Security Info=True;User id=sa;Password=keyhammer"
|
||||
|
||||
@@ -1,49 +1 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Note: As an alternative to hand editing this file you can use the
|
||||
web admin tool to configure settings for your application. Use
|
||||
the Website->Asp.Net Configuration option in Visual Studio.
|
||||
A full list of settings and comments can be found in
|
||||
machine.config.comments usually located in
|
||||
\Windows\Microsoft.Net\Framework\v2.x\Config
|
||||
-->
|
||||
<configuration>
|
||||
|
||||
|
||||
|
||||
<appSettings/>
|
||||
<connectionStrings/>
|
||||
<system.web>
|
||||
<!--
|
||||
Set compilation debug="true" to insert debugging
|
||||
symbols into the compiled page. Because this
|
||||
affects performance, set this value to true only
|
||||
during development.
|
||||
-->
|
||||
<compilation debug="false">
|
||||
|
||||
</compilation>
|
||||
<!--
|
||||
The <authentication> section enables configuration
|
||||
of the security authentication mode used by
|
||||
ASP.NET to identify an incoming user.
|
||||
-->
|
||||
<authentication mode="Windows" />
|
||||
<!--
|
||||
The <customErrors> section enables configuration
|
||||
of what to do if/when an unhandled error occurs
|
||||
during the execution of a request. Specifically,
|
||||
it enables developers to configure html error pages
|
||||
to be displayed in place of a error stack trace.
|
||||
|
||||
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
|
||||
<error statusCode="403" redirect="NoAccess.htm" />
|
||||
<error statusCode="404" redirect="FileNotFound.htm" />
|
||||
</customErrors>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
</system.web>
|
||||
|
||||
</configuration>
|
||||
|
||||
@@ -1,49 +1 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Note: As an alternative to hand editing this file you can use the
|
||||
web admin tool to configure settings for your application. Use
|
||||
the Website->Asp.Net Configuration option in Visual Studio.
|
||||
A full list of settings and comments can be found in
|
||||
machine.config.comments usually located in
|
||||
\Windows\Microsoft.Net\Framework\v2.x\Config
|
||||
-->
|
||||
<configuration>
|
||||
|
||||
|
||||
|
||||
<appSettings/>
|
||||
<connectionStrings/>
|
||||
<system.web>
|
||||
<!--
|
||||
Set compilation debug="true" to insert debugging
|
||||
symbols into the compiled page. Because this
|
||||
affects performance, set this value to true only
|
||||
during development.
|
||||
-->
|
||||
<compilation debug="false">
|
||||
|
||||
</compilation>
|
||||
<!--
|
||||
The <authentication> section enables configuration
|
||||
of the security authentication mode used by
|
||||
ASP.NET to identify an incoming user.
|
||||
-->
|
||||
<authentication mode="Windows" />
|
||||
<!--
|
||||
The <customErrors> section enables configuration
|
||||
of what to do if/when an unhandled error occurs
|
||||
during the execution of a request. Specifically,
|
||||
it enables developers to configure html error pages
|
||||
to be displayed in place of a error stack trace.
|
||||
|
||||
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
|
||||
<error statusCode="403" redirect="NoAccess.htm" />
|
||||
<error statusCode="404" redirect="FileNotFound.htm" />
|
||||
</customErrors>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
</system.web>
|
||||
|
||||
</configuration>
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
/*Svuoto eventuali tabelle già presenti...*/
|
||||
USE [GIM]
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Permessi2Funzione' AND TABLE_SCHEMA = 'dbo')
|
||||
BEGIN
|
||||
DROP TABLE dbo.[Permessi2Funzione]
|
||||
END
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Permessi' AND TABLE_SCHEMA = 'dbo')
|
||||
BEGIN
|
||||
DROP TABLE dbo.[Permessi]
|
||||
END
|
||||
GO
|
||||
|
||||
|
||||
/* creo tabella Permessi */
|
||||
USE [GIM]
|
||||
GO
|
||||
/****** Object: Table [dbo].[Permessi] Script Date: 01/13/2009 14:39:17 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
SET ANSI_PADDING ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[Permessi](
|
||||
[COD_PERMESSO] [varchar](50) NOT NULL,
|
||||
[URL] [varchar](250) NOT NULL,
|
||||
[GRUPPO] [int] NULL,
|
||||
[NUMERO] [int] NULL,
|
||||
[NOME] [varchar](50) NULL,
|
||||
[DESCRIZIONE] [varchar](50) NULL,
|
||||
CONSTRAINT [PK_Permessi] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[COD_PERMESSO] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
GO
|
||||
SET ANSI_PADDING OFF
|
||||
|
||||
/* creo tabella Permessi2Funzione */
|
||||
USE [GIM]
|
||||
GO
|
||||
/****** Object: Table [dbo].[Permessi2Funzione] Script Date: 01/13/2009 14:42:01 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
SET ANSI_PADDING ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[Permessi2Funzione](
|
||||
[COD_PERMESSO] [varchar](50) NOT NULL,
|
||||
[COD_FUNZIONE] [nvarchar](31) NOT NULL,
|
||||
[READWRITE] [char](1) NULL,
|
||||
CONSTRAINT [PK_Permessi2Funzione] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[COD_PERMESSO] ASC,
|
||||
[COD_FUNZIONE] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
GO
|
||||
SET ANSI_PADDING OFF
|
||||
GO
|
||||
ALTER TABLE [dbo].[Permessi2Funzione] WITH CHECK ADD CONSTRAINT [FK_Permessi2Funzione_Permessi] FOREIGN KEY([COD_PERMESSO])
|
||||
REFERENCES [dbo].[Permessi] ([COD_PERMESSO])
|
||||
ON UPDATE CASCADE
|
||||
GO
|
||||
ALTER TABLE [dbo].[Permessi2Funzione] CHECK CONSTRAINT [FK_Permessi2Funzione_Permessi]
|
||||
@@ -0,0 +1,105 @@
|
||||
-- inserisco valori permessi
|
||||
set xact_abort on
|
||||
GO
|
||||
|
||||
begin transaction
|
||||
GO
|
||||
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('ADMIN', 'menu.aspx', 4, 0, 'Admin', 'Admin')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('ADMIN_vocab', 'vocabolario.aspx', 4, 1, 'Vocabolario', 'Vocabolario')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('ANAG', 'menu.aspx', 1, 0, 'AnagraficheBase', 'AnagraficheBase')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('ANAG_descrFasi', 'descrFasi.aspx', 1, 2, 'AnagrDescrFasi', 'AnagrDescrFasi')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('ANAG_makers', 'makers.aspx', 1, 1, 'GestMakers', 'GestMakers')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('FAO', 'menu.aspx', 3, 0, 'AreaFAO', 'AreaFAO')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('FAO_articoli', 'articoli.aspx', 3, 1, 'AnagrArt', 'AnagrArt')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('FAO_cicli', 'cicli.aspx', 999, 2, 'AnagrCicli', 'AnagrCicli')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('FAO_cicli2check', 'cicli2check.aspx', 3, 2, 'Cicli2Check', 'Cicli2Check')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('FAO_fasi', 'fasi.aspx', 999, 3, 'BuildCiclo', 'BuildCiclo')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('FAO_op', 'op.aspx', 999, 4, 'BuildOP', 'BuildOP')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('FAO_op_dettagli', 'dettagliOp.aspx', 999, 4, 'DettagliOP', 'DettagliOP')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('TECN', 'menu.aspx', 2, 0, 'AreaTecnica', 'AreaTecnica')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('TECN_AnagCDL', 'cdl.aspx', 2, 1, 'AnagrCDL', 'AnagrCDL')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('TECN_editTreeMPM', 'editTreeMPM.aspx', 2, 5, 'EditTreeMPM', 'EditTreeMPMLong')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('TECN_Macchine', 'macchine.aspx', 2, 1, 'AnagMacchine', 'AnagMacchine')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('TECN_oggetti', 'oggetti.aspx', 2, 3, 'AnagOggetti', 'AnagOggetti')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('TECN_ricercaObj', 'searchOggetti.aspx', 2, 4, 'AvancedSearchObj', 'AvancedSearchObjLong')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('USER', 'menu.aspx', 5, 0, 'UserFunc', 'UserFuncExpl')
|
||||
INSERT INTO dbo.Permessi
|
||||
VALUES ('USER_chLang', 'chLang.aspx', 5, 1, 'ModLang', 'ModLangExpl')
|
||||
GO
|
||||
|
||||
commit transaction
|
||||
GO
|
||||
|
||||
|
||||
-- inserisco valori permessi2funzioni
|
||||
|
||||
set xact_abort on
|
||||
GO
|
||||
|
||||
begin transaction
|
||||
GO
|
||||
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('ADMIN', N'WebGTD_A', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('ADMIN_vocab', N'WebGTD_A', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('ANAG', N'WebGTD_W', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('ANAG_descrFasi', N'WebGTD_W', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('ANAG_makers', N'WebGTD_W', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('FAO', N'WebGTD_R', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('FAO_articoli', N'WebGTD_R', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('FAO_cicli', N'WebGTD_R', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('FAO_cicli2check', N'WebGTD_R', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('FAO_fasi', N'WebGTD_R', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('FAO_op', N'WebGTD_R', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('FAO_op_dettagli', N'WebGTD_R', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('TECN', N'WebGTD_X', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('TECN_AnagCDL', N'WebGTD_X', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('TECN_editTreeMPM', N'WebGTD_X', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('TECN_Macchine', N'WebGTD_X', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('TECN_oggetti', N'WebGTD_X', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('TECN_ricercaObj', N'WebGTD_X', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('USER', N'WebGTD_R', NULL)
|
||||
INSERT INTO dbo.Permessi2Funzione
|
||||
VALUES ('USER_chLang', N'WebGTD_R', NULL)
|
||||
GO
|
||||
|
||||
commit transaction
|
||||
GO
|
||||
@@ -0,0 +1,5 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Ajax.master" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
|
||||
Pagina di test
|
||||
</asp:Content>
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Configuration;
|
||||
using SteamWare;
|
||||
|
||||
public partial class test : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
dbUpdateManager dum = new SteamWare.dbUpdateManager(memLayer.ML.confReadstring("AppConnectionString"), "sql", "{0}_{1:0000}.sql");
|
||||
dum.updateDbToRev("GIM",0,1, 600);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user