bozza display dip
This commit is contained in:
@@ -1,3 +1,39 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_dip2gruppi.ascx.cs" Inherits="GPW_Admin.WebUserControls.cmp_dip2gruppi" %>
|
||||
|
||||
elenco utenti gruppo
|
||||
<asp:GridView runat="server" ID="grView" DataSourceID="ods" AutoGenerateColumns="False" DataKeyNames="idxDipendente" CssClass="table table-striped table-sm">
|
||||
<EmptyDataTemplate>No record</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<%--<asp:BoundField DataField="idxDipendente" HeaderText="idxDipendente" InsertVisible="False" ReadOnly="True" SortExpression="idxDipendente" />
|
||||
<asp:BoundField DataField="matricola" HeaderText="matricola" SortExpression="matricola" />
|
||||
<asp:BoundField DataField="CF" HeaderText="CF" SortExpression="CF" />--%>
|
||||
<asp:BoundField DataField="Cognome" HeaderText="Cognome" SortExpression="Cognome" />
|
||||
<asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
|
||||
<%--<asp:BoundField DataField="dataNascita" HeaderText="dataNascita" SortExpression="dataNascita" />
|
||||
<asp:BoundField DataField="luogoNascita" HeaderText="luogoNascita" SortExpression="luogoNascita" />
|
||||
<asp:BoundField DataField="provNascita" HeaderText="provNascita" SortExpression="provNascita" />
|
||||
<asp:BoundField DataField="nazNascita" HeaderText="nazNascita" SortExpression="nazNascita" />
|
||||
<asp:BoundField DataField="codHw" HeaderText="codHw" SortExpression="codHw" />
|
||||
<asp:BoundField DataField="codOrario" HeaderText="codOrario" SortExpression="codOrario" />
|
||||
<asp:CheckBoxField DataField="mailLastOp" HeaderText="mailLastOp" SortExpression="mailLastOp" />
|
||||
<asp:CheckBoxField DataField="mailDay" HeaderText="mailDay" SortExpression="mailDay" />
|
||||
<asp:CheckBoxField DataField="mailWeek" HeaderText="mailWeek" SortExpression="mailWeek" />
|
||||
<asp:CheckBoxField DataField="mailMonth" HeaderText="mailMonth" SortExpression="mailMonth" />--%>
|
||||
<asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />
|
||||
<%--<asp:BoundField DataField="authKey" HeaderText="authKey" SortExpression="authKey" />
|
||||
<asp:BoundField DataField="numAuth" HeaderText="numAuth" SortExpression="numAuth" />
|
||||
<asp:BoundField DataField="WOL_MAC" HeaderText="WOL_MAC" SortExpression="WOL_MAC" />
|
||||
<asp:BoundField DataField="dominio" HeaderText="dominio" SortExpression="dominio" />
|
||||
<asp:BoundField DataField="utente" HeaderText="utente" SortExpression="utente" />
|
||||
<asp:BoundField DataField="codDipendenteExt" HeaderText="codDipendenteExt" SortExpression="codDipendenteExt" />
|
||||
<asp:BoundField DataField="gruppo" HeaderText="gruppo" SortExpression="gruppo" />
|
||||
<asp:BoundField DataField="dataAssunzione" HeaderText="dataAssunzione" SortExpression="dataAssunzione" />
|
||||
<asp:BoundField DataField="dataCessazione" HeaderText="dataCessazione" SortExpression="dataCessazione" />--%>
|
||||
<asp:CheckBoxField DataField="attivo" HeaderText="attivo" SortExpression="attivo" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByGruppo" TypeName="GPW_data.DS_ApplicazioneTableAdapters.DipendentiTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="hfGruppo" DefaultValue="###" Name="gruppo" PropertyName="Value" Type="String" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:HiddenField runat="server" ID="hfGruppo" />
|
||||
@@ -7,11 +7,22 @@ using System.Web.UI.WebControls;
|
||||
|
||||
namespace GPW_Admin.WebUserControls
|
||||
{
|
||||
public partial class cmp_dip2gruppi : System.Web.UI.UserControl
|
||||
public partial class cmp_dip2gruppi : BaseUserControl
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public string gruppoSel
|
||||
{
|
||||
get => hfGruppo.Value;
|
||||
set
|
||||
{
|
||||
hfGruppo.Value = value;
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+28
-1
@@ -3,7 +3,7 @@
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -13,5 +13,32 @@ namespace GPW_Admin.WebUserControls
|
||||
|
||||
public partial class cmp_dip2gruppi
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// grView 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.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// ods 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.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// hfGruppo 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.HiddenField hfGruppo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
|
||||
|
||||
<div class="row small">
|
||||
<div class="col-12 text-right mb-1">
|
||||
<b>Gestione Gruppi</b>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<asp:GridView runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="gruppo" DataSourceID="ods" CssClass="table table-striped table-sm" ID="grView" OnDataBound="grView_DataBound">
|
||||
<EditRowStyle CssClass="table-primary" />
|
||||
@@ -15,6 +12,7 @@
|
||||
<asp:LinkButton ID="lbtReset" runat="server" CssClass="btn btn-sm btn-info" ToolTip='<%# traduci("Reset") %>' CausesValidation="False" OnClick="btnReset_Click" Visible="true"><i class="fa fa-refresh" aria-hidden="true"></i></asp:LinkButton>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="lbtSelect" OnClick="lbtSelect_Click" CssClass="btn btn-sm btn-info" CausesValidation="False" CommandName="Select" ToolTip='<%# traduci("Select") %>'><i class="fa fa-search" aria-hidden="true"></i></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="lbtEdit" CssClass="btn btn-sm btn-primary" CausesValidation="False" CommandName="Edit" ToolTip='<%# traduci("Edit") %>' Visible='<%# chkLicOk %>'><i class="fa fa-edit" aria-hidden="true"></i></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
@@ -50,7 +48,7 @@
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_ApplicazioneTableAdapters.AnagGruppiTableAdapter" OnUpdating="ods_Updating" DeleteMethod="deleteQuery" InsertMethod="insertQuery" UpdateMethod="updateQuery" OnInserting="recuperaFooter">
|
||||
<asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_ApplicazioneTableAdapters.AnagGruppiTableAdapter" OnUpdating="ods_Updating" DeleteMethod="deleteQuery" InsertMethod="insertQuery" UpdateMethod="updateQuery">
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_gruppo" Type="String" />
|
||||
</DeleteParameters>
|
||||
|
||||
@@ -10,6 +10,19 @@ namespace GPW_Admin.WebUserControls
|
||||
{
|
||||
#region Protected Methods
|
||||
|
||||
public string gruppoSel
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (grView.SelectedIndex >= 0)
|
||||
{
|
||||
answ = $"{grView.SelectedValue}";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// gestione evento richiesta nuovo valore (mostra footer, ...)
|
||||
/// </summary>
|
||||
@@ -17,17 +30,6 @@ namespace GPW_Admin.WebUserControls
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
#if false
|
||||
// reset selezione...
|
||||
resetSelezione();
|
||||
// mostro il footer oppure la riga dei dettagli x nuovo...
|
||||
if (grView.FooterRow != null)
|
||||
{
|
||||
grView.FooterRow.Visible = true;
|
||||
}
|
||||
// sollevo evento nuovo valore...
|
||||
raiseAddNew();
|
||||
#endif
|
||||
DataProxy.DP.taGruppi.insertQuery("_New GROUP", "Descrizione", "", true);
|
||||
resetSelezione();
|
||||
}
|
||||
@@ -42,6 +44,30 @@ namespace GPW_Admin.WebUserControls
|
||||
resetSelezione();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// elenco colonne del datagrid
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected DataColumnCollection colonneObj()
|
||||
{
|
||||
DataColumnCollection colonne = null;
|
||||
using (
|
||||
DS_Applicazione.AnagClientiDataTable tabella = new DS_Applicazione.AnagClientiDataTable())
|
||||
{
|
||||
colonne = tabella.Columns;
|
||||
}
|
||||
return colonne;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Richiesta selezione utente
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lbtSelect_Click(object sender, EventArgs e)
|
||||
{
|
||||
raiseEvent();
|
||||
}
|
||||
/// <summary>
|
||||
/// traduce gli header delle colonne
|
||||
/// </summary>
|
||||
@@ -118,6 +144,10 @@ namespace GPW_Admin.WebUserControls
|
||||
grView.PageSize = utils.pageSize;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// determina se sia eliminabile il record (=non usato)
|
||||
/// </summary>
|
||||
@@ -133,6 +163,13 @@ namespace GPW_Admin.WebUserControls
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public void doUpdate()
|
||||
{
|
||||
grView.PageSize = utils.pageSize;
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determina se abbia child obj --> NON eliminabile
|
||||
/// </summary>
|
||||
@@ -157,93 +194,6 @@ namespace GPW_Admin.WebUserControls
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// elenco colonne del datagrid
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected DataColumnCollection colonneObj()
|
||||
{
|
||||
DataColumnCollection colonne = null;
|
||||
using (
|
||||
DS_Applicazione.AnagClientiDataTable tabella = new DS_Applicazione.AnagClientiDataTable())
|
||||
{
|
||||
colonne = tabella.Columns;
|
||||
}
|
||||
return colonne;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
|
||||
/// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
|
||||
{
|
||||
if (e != null)
|
||||
{
|
||||
if (chkLicOk)
|
||||
{
|
||||
//recupero la riga footer...
|
||||
DataColumnCollection colonne = colonneObj();
|
||||
string nomeCol;
|
||||
string tipoColonna = "";
|
||||
foreach (DataColumn colonna in colonne)
|
||||
{
|
||||
nomeCol = colonna.ColumnName;
|
||||
// cerco un textbox o quello che sia...
|
||||
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "textBox";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "dropDownList";
|
||||
}
|
||||
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
|
||||
{
|
||||
tipoColonna = "checkBox";
|
||||
}
|
||||
// in base al tipo salvo negli inputparameters dell'ODS
|
||||
switch (tipoColonna)
|
||||
{
|
||||
case "textBox":
|
||||
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
|
||||
break;
|
||||
|
||||
case "dropDownList":
|
||||
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
|
||||
break;
|
||||
|
||||
case "checkBox":
|
||||
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
tipoColonna = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// annullo insert se licenze sforate...
|
||||
e.Cancel = true;
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void doUpdate()
|
||||
{
|
||||
grView.PageSize = utils.pageSize;
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||
/// </summary>
|
||||
|
||||
@@ -11,9 +11,28 @@ namespace GPW_Admin
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
cmp_dip2gruppi.Visible = false;
|
||||
}
|
||||
mod_pageSize.eh_nuovaSize += Mod_pageSize_eh_nuovaSize;
|
||||
cmp_elencoGruppi.eh_doRefresh += Cmp_elencoGruppi_eh_doRefresh;
|
||||
checkVisib();
|
||||
}
|
||||
|
||||
private void Cmp_elencoGruppi_eh_doRefresh(object sender, EventArgs e)
|
||||
{
|
||||
checkVisib();
|
||||
}
|
||||
|
||||
private void checkVisib()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(cmp_elencoGruppi.gruppoSel))
|
||||
{
|
||||
cmp_dip2gruppi.gruppoSel = cmp_elencoGruppi.gruppoSel.Trim();
|
||||
cmp_dip2gruppi.Visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void Mod_pageSize_eh_nuovaSize(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user