implementata modificabilità da ruolo utente (user/powerUser, red o non red...)
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
</system.web>
|
||||
<appSettings>
|
||||
<!--config base applicazione-->
|
||||
<add key="CodModulo" value="ETS-WS" />
|
||||
<add key="CodModulo" value="WebScip" />
|
||||
<add key="_titoloPagina" value="ETS, gestione protocollo Web" />
|
||||
<add key="titleApp" value="ETS-WS_titleApp" />
|
||||
<add key="welcomeApp" value="ETS-WS_welcomeApp" />
|
||||
|
||||
@@ -235,6 +235,22 @@ namespace ETS_WS
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// redattore da idx DB
|
||||
/// </summary>
|
||||
/// <param name="idxFile"></param>
|
||||
/// <returns></returns>
|
||||
public static string redattoreFromIdxFile(int idxFile)
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = utils.obj.taDoc.getByIdxFile(idxFile)[0].Redattore;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// fornisce email dato codice fornitore
|
||||
/// </summary>
|
||||
/// <param name="codForn"></param>
|
||||
@@ -456,6 +472,50 @@ namespace ETS_WS
|
||||
{
|
||||
utils.obj.taTMD.deleteQuery(userId, setName);
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se l'utente possa vedere records taggati Red
|
||||
/// </summary>
|
||||
public bool userCanSeeRed
|
||||
{
|
||||
get
|
||||
{
|
||||
return (userIsUserRed || userIsPowerUserRed);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se l'utente sia poweruser
|
||||
/// </summary>
|
||||
public bool userIsPowerUser
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = utils.obj.userHasRight(utils.obj.currUserAD, utils.obj.confReadString("CodModulo"), "PowerUser");
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se l'utente sia poweruser
|
||||
/// </summary>
|
||||
public bool userIsUserRed
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = utils.obj.userHasRight(utils.obj.currUserAD, utils.obj.confReadString("CodModulo"), "UserRed");
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// determina se l'utente sia poweruser Red
|
||||
/// </summary>
|
||||
public bool userIsPowerUserRed
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = utils.obj.userHasRight(utils.obj.currUserAD, utils.obj.confReadString("CodModulo"), "PowerUserRed");
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="">
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit" ImageUrl="~/images/edit_m.png" ToolTip="Edit" />
|
||||
<asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit" ImageUrl="~/images/edit_m.png" ToolTip="Edit" Visible='<%# showEditButton(Eval("idxFile")) %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update" ImageUrl="~/images/apply_m.png" ToolTip="Update" />
|
||||
|
||||
@@ -315,6 +315,47 @@ namespace ETS_WS.WebUserControls
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// calcola la visibilità del button di edit dati
|
||||
/// - utente corrente (e quindi suoi diritti red/non red)
|
||||
/// - ruoli utente (user/poweruser) x cui può editare solo i suoi o tutti
|
||||
/// </summary>
|
||||
/// <param name="idxFile"></param>
|
||||
/// <returns></returns>
|
||||
public bool showEditButton(object _idxFile)
|
||||
{
|
||||
bool answ = false;
|
||||
int idxFile = 0;
|
||||
try
|
||||
{
|
||||
idxFile = Convert.ToInt32(_idxFile);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (idxFile > 0)
|
||||
{
|
||||
// controllo condizioni: in primis è lui che ha creato record
|
||||
if (WebShipUtils.redattoreFromIdxFile(idxFile)==utils.obj.currUserNomeCognome)
|
||||
{
|
||||
answ = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// se non è lui controllo se sia record Red
|
||||
if (WebShipUtils.isRedFromIdxFile(idxFile)) // è record Red
|
||||
{
|
||||
// controllo se sia powerUserRed
|
||||
answ = WebShipUtils.mng.userIsPowerUserRed;
|
||||
}
|
||||
else // non è record Red
|
||||
{
|
||||
// controllo se sia powerUser
|
||||
answ = WebShipUtils.mng.userIsPowerUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -40,23 +40,20 @@
|
||||
<div class="divSx" style="width: 175px;">
|
||||
<uc2:mod_periodoAnalisi ID="mod_periodoAnalisi1" runat="server" realtimeUpdate="true" />
|
||||
</div>
|
||||
<div class="divSx" style="margin-top: -2px; width: 175px;">
|
||||
<div class="divSx" style="margin-top: -2px; width: 160px;">
|
||||
<asp:CheckBox runat="server" ID="chkCommessa" Text="Filtra Commessa" CssClass="labelInput" AutoPostBack="true" OnCheckedChanged="chkCommessa_CheckedChanged" /><br />
|
||||
<uc1:mod_textAutocomplete ID="tacCommesse" runat="server" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoCommesseByDoc" minCharAutocomplete="1" showKey="false" toolTip="Digitare per iniziare ricerca, min 1 char"
|
||||
Visible="false" />
|
||||
<uc1:mod_textAutocomplete ID="tacCommesse" runat="server" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoCommesseByDoc" minCharAutocomplete="1" showKey="false" toolTip="Digitare per iniziare ricerca, min 1 char" Visible="false" />
|
||||
</div>
|
||||
<div class="divSx" style="margin-top: -2px; width: 150px;">
|
||||
<div class="divSx" style="margin-top: -2px; width: 140px;">
|
||||
<asp:CheckBox runat="server" ID="chkFase" Text="Filtra per Fase" CssClass="labelInput" AutoPostBack="true" OnCheckedChanged="chkFase_CheckedChanged" /><br />
|
||||
<uc1:mod_textAutocomplete ID="tacFasi" runat="server" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoFasiByDoc" minCharAutocomplete="1" showKey="false" toolTip="Digitare per iniziare ricerca, min 1 char"
|
||||
Visible="false" />
|
||||
<uc1:mod_textAutocomplete ID="tacFasi" runat="server" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoFasiByDoc" minCharAutocomplete="1" showKey="false" toolTip="Digitare per iniziare ricerca, min 1 char" Visible="false" />
|
||||
</div>
|
||||
<div class="divSx" style="margin-top: -2px; width: 150px;">
|
||||
<div class="divSx" style="margin-top: -2px; width: 140px;">
|
||||
<asp:CheckBox runat="server" ID="chkFonte" Text="Filtra per Fonte" CssClass="labelInput" AutoPostBack="true" OnCheckedChanged="chkFonte_CheckedChanged" />
|
||||
<br />
|
||||
<uc1:mod_textAutocomplete ID="tacFonti" runat="server" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoFontiByDoc" minCharAutocomplete="1" showKey="false" toolTip="Digitare per iniziare ricerca, min 1 char"
|
||||
Visible="false" />
|
||||
<uc1:mod_textAutocomplete ID="tacFonti" runat="server" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoFontiByDoc" minCharAutocomplete="1" showKey="false" toolTip="Digitare per iniziare ricerca, min 1 char" Visible="false" />
|
||||
</div>
|
||||
<div class="divSx" style="margin-top: -2px; width: 150px;">
|
||||
<div class="divSx" style="margin-top: -2px; width: 140px;">
|
||||
<asp:CheckBox runat="server" ID="chkInOut" Text="Filtra In/Out" CssClass="labelInput" AutoPostBack="true" OnCheckedChanged="chkInOut_CheckedChanged" />
|
||||
<br />
|
||||
<asp:RadioButtonList ID="rblInOut" runat="server" AutoPostBack="true" RepeatDirection="Horizontal" RepeatLayout="Flow" OnSelectedIndexChanged="rblInOut_SelectedIndexChanged" Visible="false">
|
||||
@@ -64,15 +61,22 @@
|
||||
<asp:ListItem Value="Out" Text="Out" Selected="True" />
|
||||
</asp:RadioButtonList>
|
||||
</div>
|
||||
<div class="divSx" style="margin-top: -2px; width: 150px;">
|
||||
<div class="divSx" style="margin-top: -2px; width: 140px;">
|
||||
<asp:CheckBox runat="server" ID="chkRedattore" Text="Filtra Redattore" CssClass="labelInput" AutoPostBack="true" OnCheckedChanged="chkRedattore_CheckedChanged" />
|
||||
<br />
|
||||
<uc1:mod_textAutocomplete ID="tacRedattore" runat="server" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoRedattoriByDoc" minCharAutocomplete="1" showKey="false" toolTip="Digitare per iniziare ricerca, min 1 char" Visible="false" />
|
||||
</div>
|
||||
<div class="divSx" style="margin-top: -2px; width: 175px;">
|
||||
<asp:Label runat="server" ID="lblCerca" Text="Ricerca Libera" CssClass="labelInput" /><br />
|
||||
<asp:TextBox runat="server" ID="txtSearchAll" OnTextChanged="txtSearchAll_TextChanged" AutoPostBack="True" Width="12em" />
|
||||
<asp:AutoCompleteExtender ID="txtSearchAllAce" runat="server" TargetControlID="txtSearchAll" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoTagRicerca" CompletionInterval="10" MinimumPrefixLength="1" CompletionListCssClass="autocompleteListCssClass" CompletionListItemCssClass="autocomplete" CompletionListHighlightedItemCssClass="autocompleteHiglight" CompletionListElementID="autocompleteElemID" />
|
||||
<div class="divSx" style="margin-top: -2px; width: 140px;">
|
||||
<asp:CheckBox runat="server" ID="chkRed" Text="Public" ToolTip="Mostra comunicazioni Public / Red" CssClass="labelInput" AutoPostBack="true" OnCheckedChanged="chkRed_CheckedChanged" />
|
||||
</div>
|
||||
<div class="divSx" style="margin-top: 2px; width: 175px;">
|
||||
<div style="margin-top: 1px;">
|
||||
<asp:Label runat="server" ID="lblCerca" Text="Ricerca Libera" CssClass="labelInput" />
|
||||
</div>
|
||||
<div style="margin-top: 2px;">
|
||||
<asp:TextBox runat="server" ID="txtSearchAll" OnTextChanged="txtSearchAll_TextChanged" AutoPostBack="True" Width="12em" />
|
||||
<asp:AutoCompleteExtender ID="txtSearchAllAce" runat="server" TargetControlID="txtSearchAll" ServicePath="~/WS/AutoCompletamento.asmx" ServiceMethod="elencoTagRicerca" CompletionInterval="10" MinimumPrefixLength="1" CompletionListCssClass="autocompleteListCssClass" CompletionListItemCssClass="autocomplete" CompletionListHighlightedItemCssClass="autocompleteHiglight" CompletionListElementID="autocompleteElemID" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="divSx blockSizeSmall">
|
||||
<asp:Button runat="server" ID="btnUpdate" Text="Update" Enabled="false" OnClick="btnUpdate_Click" />
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace ETS_WS.WebUserControls
|
||||
if (chkCommessa.Checked)
|
||||
{
|
||||
tacCommesse.contextKey = string.Format("{0}#{1}", utils.obj.StringSessionObj("_inizio"), utils.obj.StringSessionObj("_fine"));
|
||||
chkCommessa.Text = "Elimina Filtro Commessa";
|
||||
chkCommessa.Text = "Elim. Comm.";
|
||||
tacCommesse.setFocus();
|
||||
}
|
||||
else
|
||||
@@ -196,12 +196,12 @@ namespace ETS_WS.WebUserControls
|
||||
if (chkFase.Checked)
|
||||
{
|
||||
tacFasi.contextKey = string.Format("{0}#{1}", utils.obj.StringSessionObj("_inizio"), utils.obj.StringSessionObj("_fine"));
|
||||
chkFase.Text = "Elimina Filtro Fasi";
|
||||
chkFase.Text = "Elim. Fase";
|
||||
tacFasi.setFocus();
|
||||
}
|
||||
else
|
||||
{
|
||||
chkFase.Text = "Filtra per Fase";
|
||||
chkFase.Text = "Filtra Fase";
|
||||
}
|
||||
tacFasi.Visible = chkFase.Checked;
|
||||
updateVisual();
|
||||
@@ -216,12 +216,12 @@ namespace ETS_WS.WebUserControls
|
||||
if (chkFonte.Checked)
|
||||
{
|
||||
tacFonti.contextKey = string.Format("{0}#{1}", utils.obj.StringSessionObj("_inizio"), utils.obj.StringSessionObj("_fine"));
|
||||
chkFonte.Text = "Elimina Filtro Fonte";
|
||||
chkFonte.Text = "Elim. Fonte";
|
||||
tacFonti.setFocus();
|
||||
}
|
||||
else
|
||||
{
|
||||
chkFonte.Text = "Filtra per Fonte";
|
||||
chkFonte.Text = "Filtra Fonte";
|
||||
}
|
||||
tacFonti.Visible = chkFonte.Checked;
|
||||
updateVisual();
|
||||
@@ -235,7 +235,7 @@ namespace ETS_WS.WebUserControls
|
||||
{
|
||||
if (chkInOut.Checked)
|
||||
{
|
||||
chkInOut.Text = "Elimina Filtro In/Out";
|
||||
chkInOut.Text = "Elim. In/Out";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -265,6 +265,23 @@ namespace ETS_WS.WebUserControls
|
||||
updateVisual();
|
||||
}
|
||||
/// <summary>
|
||||
/// imposto visibilità x dati red/non red
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void chkRed_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (chkRed.Checked)
|
||||
{
|
||||
chkRed.Text = "Public+Red";
|
||||
}
|
||||
else
|
||||
{
|
||||
chkRed.Text = "Public";
|
||||
}
|
||||
updateVisual();
|
||||
}
|
||||
/// <summary>
|
||||
/// selezionata nuova dim pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
@@ -348,6 +365,5 @@ namespace ETS_WS.WebUserControls
|
||||
eh_reqSearch(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -147,6 +147,15 @@ namespace ETS_WS.WebUserControls {
|
||||
/// </remarks>
|
||||
protected global::ETS_WS.WebUserControls.mod_textAutocomplete tacRedattore;
|
||||
|
||||
/// <summary>
|
||||
/// chkRed control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox chkRed;
|
||||
|
||||
/// <summary>
|
||||
/// lblCerca control.
|
||||
/// </summary>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Generated
+39
-2
@@ -1,7 +1,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.17626
|
||||
// Runtime Version:4.0.30319.17929
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -2835,11 +2835,19 @@ SELECT UtenteAD, codModulo, codFunzione, valore FROM Diritti WHERE (UtenteAD = @
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
|
||||
private void InitCommandCollection() {
|
||||
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1];
|
||||
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2];
|
||||
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
|
||||
this._commandCollection[0].Connection = this.Connection;
|
||||
this._commandCollection[0].CommandText = "SELECT UtenteAD, codModulo, codFunzione, valore FROM dbo.Diritti";
|
||||
this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
|
||||
this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
|
||||
this._commandCollection[1].Connection = this.Connection;
|
||||
this._commandCollection[1].CommandText = "dbo.stp_Dir_getByUserModFun";
|
||||
this._commandCollection[1].CommandType = global::System.Data.CommandType.StoredProcedure;
|
||||
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UtenteAD", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@codModulo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@codFunzione", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
@@ -2866,6 +2874,35 @@ SELECT UtenteAD, codModulo, codFunzione, valore FROM Diritti WHERE (UtenteAD = @
|
||||
return dataTable;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
|
||||
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
|
||||
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
|
||||
public virtual DS_Anagrafica.DirittiDataTable getByUserModFun(string UtenteAD, string codModulo, string codFunzione) {
|
||||
this.Adapter.SelectCommand = this.CommandCollection[1];
|
||||
if ((UtenteAD == null)) {
|
||||
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.SelectCommand.Parameters[1].Value = ((string)(UtenteAD));
|
||||
}
|
||||
if ((codModulo == null)) {
|
||||
this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.SelectCommand.Parameters[2].Value = ((string)(codModulo));
|
||||
}
|
||||
if ((codFunzione == null)) {
|
||||
this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
this.Adapter.SelectCommand.Parameters[3].Value = ((string)(codFunzione));
|
||||
}
|
||||
DS_Anagrafica.DirittiDataTable dataTable = new DS_Anagrafica.DirittiDataTable();
|
||||
this.Adapter.Fill(dataTable);
|
||||
return dataTable;
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
|
||||
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
|
||||
|
||||
@@ -155,7 +155,21 @@ SELECT UtenteAD, codModulo, codFunzione, valore FROM Diritti WHERE (UtenteAD = @
|
||||
<Mapping SourceColumn="codFunzione" DataSetColumn="codFunzione" />
|
||||
<Mapping SourceColumn="valore" DataSetColumn="valore" />
|
||||
</Mappings>
|
||||
<Sources />
|
||||
<Sources>
|
||||
<DbSource ConnectionRef="ETS_AnagraficaConnectionString (Settings)" DbObjectName="ETS_Anagrafica.dbo.stp_Dir_getByUserModFun" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="getByUserModFun" GetMethodModifier="Public" GetMethodName="getByUserModFun" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="getByUserModFun" UserSourceName="getByUserModFun">
|
||||
<SelectCommand>
|
||||
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
|
||||
<CommandText>dbo.stp_Dir_getByUserModFun</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@UtenteAD" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@codModulo" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@codFunzione" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</SelectCommand>
|
||||
</DbSource>
|
||||
</Sources>
|
||||
</TableAdapter>
|
||||
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="FunzioniTableAdapter" GeneratorDataComponentClassName="FunzioniTableAdapter" Name="Funzioni" UserDataComponentName="FunzioniTableAdapter">
|
||||
<MainSource>
|
||||
@@ -265,7 +279,7 @@ SELECT COD_MODULO, DESCRIZIONE FROM Moduli WHERE (COD_MODULO = @COD_MODULO)</Com
|
||||
<xs:element name="DS_Anagrafica" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="DS_Anagrafica" msprop:Generator_UserDSName="DS_Anagrafica">
|
||||
<xs:complexType>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="Utenti" msprop:Generator_TableClassName="UtentiDataTable" msprop:Generator_TableVarName="tableUtenti" msprop:Generator_TablePropName="Utenti" msprop:Generator_RowDeletingName="UtentiRowDeleting" msprop:Generator_RowChangingName="UtentiRowChanging" msprop:Generator_RowEvHandlerName="UtentiRowChangeEventHandler" msprop:Generator_RowDeletedName="UtentiRowDeleted" msprop:Generator_UserTableName="Utenti" msprop:Generator_RowChangedName="UtentiRowChanged" msprop:Generator_RowEvArgName="UtentiRowChangeEvent" msprop:Generator_RowClassName="UtentiRow">
|
||||
<xs:element name="Utenti" msprop:Generator_TableClassName="UtentiDataTable" msprop:Generator_TableVarName="tableUtenti" msprop:Generator_RowChangedName="UtentiRowChanged" msprop:Generator_TablePropName="Utenti" msprop:Generator_RowDeletingName="UtentiRowDeleting" msprop:Generator_RowChangingName="UtentiRowChanging" msprop:Generator_RowEvHandlerName="UtentiRowChangeEventHandler" msprop:Generator_RowDeletedName="UtentiRowDeleted" msprop:Generator_RowClassName="UtentiRow" msprop:Generator_UserTableName="Utenti" msprop:Generator_RowEvArgName="UtentiRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="UtenteAD" msprop:Generator_ColumnVarNameInTable="columnUtenteAD" msprop:Generator_ColumnPropNameInRow="UtenteAD" msprop:Generator_ColumnPropNameInTable="UtenteADColumn" msprop:Generator_UserColumnName="UtenteAD">
|
||||
@@ -313,7 +327,7 @@ SELECT COD_MODULO, DESCRIZIONE FROM Moduli WHERE (COD_MODULO = @COD_MODULO)</Com
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Diritti" msprop:Generator_TableClassName="DirittiDataTable" msprop:Generator_TableVarName="tableDiritti" msprop:Generator_TablePropName="Diritti" msprop:Generator_RowDeletingName="DirittiRowDeleting" msprop:Generator_RowChangingName="DirittiRowChanging" msprop:Generator_RowEvHandlerName="DirittiRowChangeEventHandler" msprop:Generator_RowDeletedName="DirittiRowDeleted" msprop:Generator_UserTableName="Diritti" msprop:Generator_RowChangedName="DirittiRowChanged" msprop:Generator_RowEvArgName="DirittiRowChangeEvent" msprop:Generator_RowClassName="DirittiRow">
|
||||
<xs:element name="Diritti" msprop:Generator_TableClassName="DirittiDataTable" msprop:Generator_TableVarName="tableDiritti" msprop:Generator_RowChangedName="DirittiRowChanged" msprop:Generator_TablePropName="Diritti" msprop:Generator_RowDeletingName="DirittiRowDeleting" msprop:Generator_RowChangingName="DirittiRowChanging" msprop:Generator_RowEvHandlerName="DirittiRowChangeEventHandler" msprop:Generator_RowDeletedName="DirittiRowDeleted" msprop:Generator_RowClassName="DirittiRow" msprop:Generator_UserTableName="Diritti" msprop:Generator_RowEvArgName="DirittiRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="UtenteAD" msprop:Generator_ColumnVarNameInTable="columnUtenteAD" msprop:Generator_ColumnPropNameInRow="UtenteAD" msprop:Generator_ColumnPropNameInTable="UtenteADColumn" msprop:Generator_UserColumnName="UtenteAD">
|
||||
@@ -347,7 +361,7 @@ SELECT COD_MODULO, DESCRIZIONE FROM Moduli WHERE (COD_MODULO = @COD_MODULO)</Com
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Funzioni" msprop:Generator_TableClassName="FunzioniDataTable" msprop:Generator_TableVarName="tableFunzioni" msprop:Generator_TablePropName="Funzioni" msprop:Generator_RowDeletingName="FunzioniRowDeleting" msprop:Generator_RowChangingName="FunzioniRowChanging" msprop:Generator_RowEvHandlerName="FunzioniRowChangeEventHandler" msprop:Generator_RowDeletedName="FunzioniRowDeleted" msprop:Generator_UserTableName="Funzioni" msprop:Generator_RowChangedName="FunzioniRowChanged" msprop:Generator_RowEvArgName="FunzioniRowChangeEvent" msprop:Generator_RowClassName="FunzioniRow">
|
||||
<xs:element name="Funzioni" msprop:Generator_TableClassName="FunzioniDataTable" msprop:Generator_TableVarName="tableFunzioni" msprop:Generator_RowChangedName="FunzioniRowChanged" msprop:Generator_TablePropName="Funzioni" msprop:Generator_RowDeletingName="FunzioniRowDeleting" msprop:Generator_RowChangingName="FunzioniRowChanging" msprop:Generator_RowEvHandlerName="FunzioniRowChangeEventHandler" msprop:Generator_RowDeletedName="FunzioniRowDeleted" msprop:Generator_RowClassName="FunzioniRow" msprop:Generator_UserTableName="Funzioni" msprop:Generator_RowEvArgName="FunzioniRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="COD_FUNZIONE" msprop:Generator_ColumnVarNameInTable="columnCOD_FUNZIONE" msprop:Generator_ColumnPropNameInRow="COD_FUNZIONE" msprop:Generator_ColumnPropNameInTable="COD_FUNZIONEColumn" msprop:Generator_UserColumnName="COD_FUNZIONE">
|
||||
@@ -367,7 +381,7 @@ SELECT COD_MODULO, DESCRIZIONE FROM Moduli WHERE (COD_MODULO = @COD_MODULO)</Com
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Moduli" msprop:Generator_TableClassName="ModuliDataTable" msprop:Generator_TableVarName="tableModuli" msprop:Generator_TablePropName="Moduli" msprop:Generator_RowDeletingName="ModuliRowDeleting" msprop:Generator_RowChangingName="ModuliRowChanging" msprop:Generator_RowEvHandlerName="ModuliRowChangeEventHandler" msprop:Generator_RowDeletedName="ModuliRowDeleted" msprop:Generator_UserTableName="Moduli" msprop:Generator_RowChangedName="ModuliRowChanged" msprop:Generator_RowEvArgName="ModuliRowChangeEvent" msprop:Generator_RowClassName="ModuliRow">
|
||||
<xs:element name="Moduli" msprop:Generator_TableClassName="ModuliDataTable" msprop:Generator_TableVarName="tableModuli" msprop:Generator_RowChangedName="ModuliRowChanged" msprop:Generator_TablePropName="Moduli" msprop:Generator_RowDeletingName="ModuliRowDeleting" msprop:Generator_RowChangingName="ModuliRowChanging" msprop:Generator_RowEvHandlerName="ModuliRowChangeEventHandler" msprop:Generator_RowDeletedName="ModuliRowDeleted" msprop:Generator_RowClassName="ModuliRow" msprop:Generator_UserTableName="Moduli" msprop:Generator_RowEvArgName="ModuliRowChangeEvent">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="COD_MODULO" msprop:Generator_ColumnVarNameInTable="columnCOD_MODULO" msprop:Generator_ColumnPropNameInRow="COD_MODULO" msprop:Generator_ColumnPropNameInTable="COD_MODULOColumn" msprop:Generator_UserColumnName="COD_MODULO">
|
||||
@@ -410,9 +424,9 @@ SELECT COD_MODULO, DESCRIZIONE FROM Moduli WHERE (COD_MODULO = @COD_MODULO)</Com
|
||||
</xs:element>
|
||||
<xs:annotation>
|
||||
<xs:appinfo>
|
||||
<msdata:Relationship name="FK_DIRITTI_UTENTE" msdata:parent="Utenti" msdata:child="Diritti" msdata:parentkey="UtenteAD" msdata:childkey="UtenteAD" msprop:Generator_UserChildTable="Diritti" msprop:Generator_ChildPropName="GetDirittiRows" msprop:Generator_UserRelationName="FK_DIRITTI_UTENTE" msprop:Generator_ParentPropName="UtentiRow" msprop:Generator_RelationVarName="relationFK_DIRITTI_UTENTE" msprop:Generator_UserParentTable="Utenti" />
|
||||
<msdata:Relationship name="FK_DIRITTI_FUNZIONE" msdata:parent="Funzioni" msdata:child="Diritti" msdata:parentkey="COD_FUNZIONE" msdata:childkey="codFunzione" msprop:Generator_UserChildTable="Diritti" msprop:Generator_ChildPropName="GetDirittiRows" msprop:Generator_UserRelationName="FK_DIRITTI_FUNZIONE" msprop:Generator_RelationVarName="relationFK_DIRITTI_FUNZIONE" msprop:Generator_UserParentTable="Funzioni" msprop:Generator_ParentPropName="FunzioniRow" />
|
||||
<msdata:Relationship name="FK_DIRITTI_MODULO" msdata:parent="Moduli" msdata:child="Diritti" msdata:parentkey="COD_MODULO" msdata:childkey="codModulo" msprop:Generator_UserChildTable="Diritti" msprop:Generator_ChildPropName="GetDirittiRows" msprop:Generator_UserRelationName="FK_DIRITTI_MODULO" msprop:Generator_RelationVarName="relationFK_DIRITTI_MODULO" msprop:Generator_UserParentTable="Moduli" msprop:Generator_ParentPropName="ModuliRow" />
|
||||
<msdata:Relationship name="FK_DIRITTI_UTENTE" msdata:parent="Utenti" msdata:child="Diritti" msdata:parentkey="UtenteAD" msdata:childkey="UtenteAD" msprop:Generator_UserChildTable="Diritti" msprop:Generator_ChildPropName="GetDirittiRows" msprop:Generator_UserRelationName="FK_DIRITTI_UTENTE" msprop:Generator_RelationVarName="relationFK_DIRITTI_UTENTE" msprop:Generator_UserParentTable="Utenti" msprop:Generator_ParentPropName="UtentiRow" />
|
||||
<msdata:Relationship name="FK_DIRITTI_FUNZIONE" msdata:parent="Funzioni" msdata:child="Diritti" msdata:parentkey="COD_FUNZIONE" msdata:childkey="codFunzione" msprop:Generator_UserChildTable="Diritti" msprop:Generator_ChildPropName="GetDirittiRows" msprop:Generator_UserRelationName="FK_DIRITTI_FUNZIONE" msprop:Generator_ParentPropName="FunzioniRow" msprop:Generator_RelationVarName="relationFK_DIRITTI_FUNZIONE" msprop:Generator_UserParentTable="Funzioni" />
|
||||
<msdata:Relationship name="FK_DIRITTI_MODULO" msdata:parent="Moduli" msdata:child="Diritti" msdata:parentkey="COD_MODULO" msdata:childkey="codModulo" msprop:Generator_UserChildTable="Diritti" msprop:Generator_ChildPropName="GetDirittiRows" msprop:Generator_UserRelationName="FK_DIRITTI_MODULO" msprop:Generator_ParentPropName="ModuliRow" msprop:Generator_RelationVarName="relationFK_DIRITTI_MODULO" msprop:Generator_UserParentTable="Moduli" />
|
||||
</xs:appinfo>
|
||||
</xs:annotation>
|
||||
</xs:schema>
|
||||
+15
-11
@@ -7,12 +7,12 @@
|
||||
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="0" ViewPortY="0" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
|
||||
<Shapes>
|
||||
<Shape ID="DesignTable:Utenti" ZOrder="7" X="236" Y="205" Height="210" Width="181" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="140" />
|
||||
<Shape ID="DesignTable:Diritti" ZOrder="6" X="633" Y="193" Height="153" Width="178" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
|
||||
<Shape ID="DesignTable:Funzioni" ZOrder="4" X="644" Y="439" Height="115" Width="194" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="64" />
|
||||
<Shape ID="DesignTable:Moduli" ZOrder="2" X="930" Y="209" Height="115" Width="186" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="64" />
|
||||
<Shape ID="DesignTable:Diritti" ZOrder="1" X="633" Y="193" Height="172" Width="209" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
|
||||
<Shape ID="DesignTable:Funzioni" ZOrder="5" X="644" Y="439" Height="115" Width="194" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="64" />
|
||||
<Shape ID="DesignTable:Moduli" ZOrder="3" X="930" Y="209" Height="115" Width="186" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="64" />
|
||||
</Shapes>
|
||||
<Connectors>
|
||||
<Connector ID="DesignRelation:FK_DIRITTI_UTENTE" ZOrder="5" LineWidth="11">
|
||||
<Connector ID="DesignRelation:FK_DIRITTI_UTENTE" ZOrder="6" LineWidth="11">
|
||||
<RoutePoints>
|
||||
<Point>
|
||||
<X>417</X>
|
||||
@@ -24,7 +24,7 @@
|
||||
</Point>
|
||||
</RoutePoints>
|
||||
</Connector>
|
||||
<Connector ID="DesignRelation:FK_DIRITTI_FUNZIONE" ZOrder="3" LineWidth="11">
|
||||
<Connector ID="DesignRelation:FK_DIRITTI_FUNZIONE" ZOrder="4" LineWidth="11">
|
||||
<RoutePoints>
|
||||
<Point>
|
||||
<X>708</X>
|
||||
@@ -32,19 +32,23 @@
|
||||
</Point>
|
||||
<Point>
|
||||
<X>708</X>
|
||||
<Y>346</Y>
|
||||
<Y>365</Y>
|
||||
</Point>
|
||||
</RoutePoints>
|
||||
</Connector>
|
||||
<Connector ID="DesignRelation:FK_DIRITTI_MODULO" ZOrder="1" LineWidth="11">
|
||||
<Connector ID="DesignRelation:FK_DIRITTI_MODULO" ZOrder="2" LineWidth="11">
|
||||
<RoutePoints>
|
||||
<Point>
|
||||
<X>930</X>
|
||||
<Y>254</Y>
|
||||
<X>950</X>
|
||||
<Y>324</Y>
|
||||
</Point>
|
||||
<Point>
|
||||
<X>811</X>
|
||||
<Y>254</Y>
|
||||
<X>950</X>
|
||||
<Y>341</Y>
|
||||
</Point>
|
||||
<Point>
|
||||
<X>842</X>
|
||||
<Y>341</Y>
|
||||
</Point>
|
||||
</RoutePoints>
|
||||
</Connector>
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace ETS_Data
|
||||
#region area table adapters
|
||||
|
||||
public DS_AnagraficaTableAdapters.UtentiTableAdapter taUtenti;
|
||||
public DS_AnagraficaTableAdapters.DirittiTableAdapter taDiritti;
|
||||
|
||||
public DS_utilsTableAdapters.v_selFontiTableAdapter taSelFonti;
|
||||
public DS_utilsTableAdapters.v_selCommesseTableAdapter taSelCommesse;
|
||||
@@ -37,6 +38,7 @@ namespace ETS_Data
|
||||
protected void initTA()
|
||||
{
|
||||
taUtenti = new DS_AnagraficaTableAdapters.UtentiTableAdapter();
|
||||
taDiritti = new DS_AnagraficaTableAdapters.DirittiTableAdapter();
|
||||
taSelFonti = new DS_utilsTableAdapters.v_selFontiTableAdapter();
|
||||
taSelCommesse = new DS_utilsTableAdapters.v_selCommesseTableAdapter();
|
||||
taSelFasi = new DS_utilsTableAdapters.v_selFasiTableAdapter();
|
||||
@@ -62,6 +64,7 @@ namespace ETS_Data
|
||||
string connStringETS_WAnagrafica = (string)configAppSetReader.GetValue("ETS_AnagraficaConnectionString", typeof(string));
|
||||
// connections del db
|
||||
taUtenti.Connection.ConnectionString = connStringETS_WAnagrafica;
|
||||
taDiritti.Connection.ConnectionString = connStringETS_WAnagrafica;
|
||||
|
||||
taSelFonti.Connection.ConnectionString = connStringETS_WS;
|
||||
taSelCommesse.Connection.ConnectionString = connStringETS_WS;
|
||||
@@ -231,6 +234,24 @@ namespace ETS_Data
|
||||
return currUserAD;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// calcola se l'utente abbia il diritto x la funzione indicata
|
||||
/// </summary>
|
||||
/// <param name="utenteAD">username formato AD</param>
|
||||
/// <param name="codModulo">codice modulo</param>
|
||||
/// <param name="codFunzione">codice funzione</param>
|
||||
/// <returns></returns>
|
||||
public bool userHasRight(string utenteAD, string codModulo, string codFunzione)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
answ = taDiritti.getByUserModFun(utenteAD, codModulo, codFunzione).Rows.Count > 0;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user