ok modalità visualizzazione tra normale ed edit sia x repeater che x dettaglio slot giornaliero...

FUNZIONA EDIT, manca sel a tendina x elenco squadre + delete x ASSD di un dip...
This commit is contained in:
Samuele E. Locatelli
2016-01-29 19:43:13 +01:00
parent 26b981ed94
commit 8c0d968ba0
18 changed files with 202 additions and 15 deletions
Binary file not shown.
+68 -3
View File
@@ -1,18 +1,83 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_dettASSD.ascx.cs" Inherits="WebSCR.WebUserControls.mod_dettASSD" %>
<asp:Repeater ID="repMatr" runat="server" DataSourceID="odsDip">
<asp:Repeater ID="repShow" runat="server" DataSourceID="odsDip">
<ItemTemplate>
<span style="white-space: nowrap;">
<%# Eval("CognomeNome") %>&nbsp;|&nbsp;
</span>
</ItemTemplate>
</asp:Repeater>
<asp:ObjectDataSource ID="odsDip" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getBySlotSq" TypeName="WebSCR_data.DS_ApplicazioneTableAdapters.AssegnSlotSquadreDipTableAdapter">
<asp:GridView ID="grViewEdit" runat="server" AutoGenerateColumns="False" DataKeyNames="Data,Slot,CodSquadra,Matr" DataSourceID="odsDip" AllowPaging="True" AllowSorting="True" PageSize="20">
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" HorizontalAlign="Left" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
<AlternatingRowStyle BackColor="White" />
<EmptyDataTemplate>
Nessun risultato
</EmptyDataTemplate>
<Columns>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<div class="ui-nodisc-icon ui-alt-icon">
<asp:LinkButton ID="lbEdit" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-edit ui-btn-icon-notext ui-btn-inline" runat="server" CausesValidation="False" CommandArgument="edit" CommandName="Edit" Text="Edit"></asp:LinkButton>
</div>
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton ID="lbUpdate" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-check ui-btn-icon-notext ui-btn-inline" runat="server" CausesValidation="False" CommandArgument="update" CommandName="Update" Text="Update"></asp:LinkButton>
</EditItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Squadra" SortExpression="DescrSquadra">
<EditItemTemplate>
<asp:TextBox ID="txtCodSquadra" runat="server" Text='<%# Bind("CodSquadra") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("DescrSquadra") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Risorsa" SortExpression="CognomeNome">
<EditItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("CognomeNome") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("CognomeNome") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:LinkButton ID="lbDelete" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-delete ui-btn-icon-notext ui-btn-inline" runat="server" CausesValidation="False" CommandArgument="delete" CommandName="Delete" Text="Delete" ToolTip="Elimina" OnClientClick="return confirm('Sei sicuro di voler eliminare il record?')"></asp:LinkButton>
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton ID="lbCancel" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-refresh ui-btn-icon-notext ui-btn-inline" runat="server" CausesValidation="False" CommandArgument="cancel" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsDip" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getBySlotSq" TypeName="WebSCR_data.DS_ApplicazioneTableAdapters.AssegnSlotSquadreDipTableAdapter" UpdateMethod="updateSquadra" OnUpdated="odsDip_Updated">
<SelectParameters>
<asp:ControlParameter ControlID="hfCodSquadra" Name="CodSquadra" PropertyName="Value" Type="String" />
<asp:ControlParameter ControlID="hfDataRif" DefaultValue="" Name="Data" PropertyName="Value" Type="DateTime" />
<asp:ControlParameter ControlID="hfSlot" Name="Slot" PropertyName="Value" Type="String" />
<asp:ControlParameter ControlID="hfCodSquadra" Name="CodSquadra" PropertyName="Value" Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Original_CodSquadra" Type="String" />
<asp:Parameter Name="Original_Data" Type="DateTime" />
<asp:Parameter Name="Original_Slot" Type="String" />
<asp:Parameter Name="Original_Matr" Type="String" />
<asp:Parameter Name="CodSquadra" Type="String" />
</UpdateParameters>
</asp:ObjectDataSource>
<asp:HiddenField runat="server" ID="hfDataRif" />
<asp:HiddenField runat="server" ID="hfSlot" />
+33 -4
View File
@@ -9,9 +9,22 @@ namespace WebSCR.WebUserControls
{
public partial class mod_dettASSD : System.Web.UI.UserControl
{
public event EventHandler eh_updReq;
/// <summary>
/// solleva evento selezione data
/// </summary>
protected void reportEvent()
{
// evento!
if (eh_updReq != null)
{
eh_updReq(this, new EventArgs());
}
}
protected void Page_Load(object sender, EventArgs e)
{
repMatr.DataBind();
}
/// <summary>
/// data di riferimento scelta
@@ -32,7 +45,6 @@ namespace WebSCR.WebUserControls
set
{
hfDataRif.Value = value.ToShortDateString();
//repMatr.DataBind();
}
}
/// <summary>
@@ -47,7 +59,6 @@ namespace WebSCR.WebUserControls
set
{
hfSlot.Value = value;
//repMatr.DataBind();
}
}
/// <summary>
@@ -62,8 +73,26 @@ namespace WebSCR.WebUserControls
set
{
hfCodSquadra.Value = value;
//repMatr.DataBind();
}
}
public bool editMode
{
get
{
return repShow.Visible;
}
set
{
repShow.Visible = !value;
grViewEdit.Visible = value;
}
}
protected void odsDip_Updated(object sender, ObjectDataSourceStatusEventArgs e)
{
// sollevo evento!
reportEvent();
}
}
}
+11 -2
View File
@@ -13,13 +13,22 @@ namespace WebSCR.WebUserControls {
public partial class mod_dettASSD {
/// <summary>
/// repMatr control.
/// repShow 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.Repeater repMatr;
protected global::System.Web.UI.WebControls.Repeater repShow;
/// <summary>
/// grViewEdit 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 grViewEdit;
/// <summary>
/// odsDip control.
+2 -2
View File
@@ -12,7 +12,7 @@
<asp:Label runat="server" ID="lblSquadra"><%# Eval("DescrSquadra") %></asp:Label></b>
</div>
<div style="font-size: 0.6em; line-height: 1.1; margin: 1px;">
<uc1:mod_dettASSD runat="server" ID="mod_dettASSD" DataRif='<%# Eval("Data") %>' Slot='<%# Eval("Slot") %>' CodSquadra='<%# Eval("CodSquadra") %>' />
<uc1:mod_dettASSD runat="server" ID="mod_dettASSD" DataRif='<%# Eval("Data") %>' Slot='<%# Eval("Slot") %>' CodSquadra='<%# Eval("CodSquadra") %>' editMode="false" />
</div>
</div>
</ItemTemplate>
@@ -26,7 +26,7 @@
<asp:Label runat="server" ID="lblSquadra"><%# Eval("DescrSquadra") %></asp:Label></b>
</div>
<div style="font-size: 0.6em; line-height: 1.1; margin: 1px;">
<uc1:mod_dettASSD runat="server" ID="mod_dettASSD" DataRif='<%# Eval("Data") %>' Slot='<%# Eval("Slot") %>' CodSquadra='<%# Eval("CodSquadra") %>' />
<uc1:mod_dettASSD runat="server" ID="mod_dettASSD" DataRif='<%# Eval("Data") %>' Slot='<%# Eval("Slot") %>' CodSquadra='<%# Eval("CodSquadra") %>' editMode="true" Oneh_updReq="mod_dettASSD_eh_updReq" />
</div>
</div>
</ItemTemplate>
@@ -59,7 +59,14 @@ namespace WebSCR.WebUserControls
{
repShow.Visible = !value;
repEdit.Visible = value;
repShow.DataBind();
}
}
protected void mod_dettASSD_eh_updReq(object sender, EventArgs e)
{
// aggiorno repView...
repEdit.DataBind();
}
}
}
@@ -37,7 +37,7 @@
</SelectParameters>
</asp:ObjectDataSource>
<div runat="server" id="divEdit">
<div class="ui-grid-a noShadows" style="font-size: 1.2em;">
<div class="ui-grid-a noShadows" style="font-size: 1.3em;">
<div class="ui-block-a ui-corner-all">
<h3><asp:Label runat="server" ID="lblData" /> - <asp:Label runat="server" ID="lblSlot" /></h3>
</div>
@@ -45,7 +45,7 @@
<asp:LinkButton ID="lbCancel" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-refresh ui-btn-icon-right ui-btn-inline" runat="server" Width="20em" OnClick="lbCancel_Click">Torna a schema SETTIMANALE</asp:LinkButton>
</div>
</div>
<div style="font-size: 1.1em;">
<div style="font-size: 1.2em;">
<uc1:mod_giornataASSD runat="server" ID="mod_giornataASSD" editMode="true" />
</div>
</div>
Binary file not shown.
Binary file not shown.
Binary file not shown.
+63 -1
View File
@@ -17316,7 +17316,7 @@ SELECT Matr, Cognome, Nome, CognomeNome FROM Dipendenti WHERE (Matr = @Matr)";
[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[5];
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[6];
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = "SELECT * FROM v_ASSD";
@@ -17348,6 +17348,16 @@ SELECT Matr, Cognome, Nome, CognomeNome FROM Dipendenti WHERE (Matr = @Matr)";
this._commandCollection[4].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[4].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[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Data", global::System.Data.SqlDbType.SmallDateTime, 4, global::System.Data.ParameterDirection.Input, 16, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[5].Connection = this.Connection;
this._commandCollection[5].CommandText = "dbo.stp_ASSD_updateSquadra";
this._commandCollection[5].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[5].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[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_CodSquadra", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Data", global::System.Data.SqlDbType.SmallDateTime, 4, global::System.Data.ParameterDirection.Input, 16, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Slot", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Matr", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodSquadra", 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()]
@@ -17481,6 +17491,58 @@ SELECT Matr, Cognome, Nome, CognomeNome FROM Dipendenti WHERE (Matr = @Matr)";
}
return returnValue;
}
[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")]
public virtual int updateSquadra(string Original_CodSquadra, global::System.Nullable<global::System.DateTime> Original_Data, string Original_Slot, string Original_Matr, string CodSquadra) {
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5];
if ((Original_CodSquadra == null)) {
command.Parameters[1].Value = global::System.DBNull.Value;
}
else {
command.Parameters[1].Value = ((string)(Original_CodSquadra));
}
if ((Original_Data.HasValue == true)) {
command.Parameters[2].Value = ((System.DateTime)(Original_Data.Value));
}
else {
command.Parameters[2].Value = global::System.DBNull.Value;
}
if ((Original_Slot == null)) {
command.Parameters[3].Value = global::System.DBNull.Value;
}
else {
command.Parameters[3].Value = ((string)(Original_Slot));
}
if ((Original_Matr == null)) {
command.Parameters[4].Value = global::System.DBNull.Value;
}
else {
command.Parameters[4].Value = ((string)(Original_Matr));
}
if ((CodSquadra == null)) {
command.Parameters[5].Value = global::System.DBNull.Value;
}
else {
command.Parameters[5].Value = ((string)(CodSquadra));
}
global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
if (((command.Connection.State & global::System.Data.ConnectionState.Open)
!= global::System.Data.ConnectionState.Open)) {
command.Connection.Open();
}
int returnValue;
try {
returnValue = command.ExecuteNonQuery();
}
finally {
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
command.Connection.Close();
}
}
return returnValue;
}
}
/// <summary>
+15
View File
@@ -1407,6 +1407,21 @@ SELECT Matr, Cognome, Nome, CognomeNome FROM Dipendenti WHERE (Matr = @Matr)</Co
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="WebSCRConnectionString (Settings)" DbObjectName="WebSCR.dbo.stp_ASSD_updateSquadra" DbObjectType="StoredProcedure" GenerateShortCommands="true" GeneratorSourceName="updateSquadra" Modifier="Public" Name="updateSquadra" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy2" UserSourceName="updateSquadra">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
<CommandText>dbo.stp_ASSD_updateSquadra</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="@Original_CodSquadra" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="smalldatetime" DbType="DateTime" Direction="Input" ParameterName="@Original_Data" Precision="16" ProviderType="SmallDateTime" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@Original_Slot" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@Original_Matr" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@CodSquadra" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
</Sources>
</TableAdapter>
</Tables>
+1 -1
View File
@@ -21,7 +21,7 @@
<Shape ID="DesignTable:AssegnSquadre" ZOrder="9" X="333" Y="730" Height="191" Width="276" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:Dipendenti" ZOrder="8" X="339" Y="514" Height="153" Width="209" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:v_resImp" ZOrder="5" X="1216" Y="700" Height="134" Width="196" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="64" />
<Shape ID="DesignTable:AssegnSlotSquadreDip" ZOrder="1" X="343" Y="931" Height="286" Width="277" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="159" />
<Shape ID="DesignTable:AssegnSlotSquadreDip" ZOrder="1" X="343" Y="931" Height="286" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="159" />
</Shapes>
<Connectors>
<Connector ID="DesignRelation:FK_Disponibilita_AnagSquadre" ZOrder="15" LineWidth="11">
Binary file not shown.
Binary file not shown.
Binary file not shown.