Completato delete + insert x dettagli intervento in pianificazione

This commit is contained in:
Samuele E. Locatelli
2015-05-07 19:29:44 +02:00
parent 4a9a9d1818
commit 2c5ca1614c
20 changed files with 103 additions and 44 deletions
BIN
View File
Binary file not shown.
+23 -42
View File
@@ -235,14 +235,14 @@
<asp:ObjectDataSource ID="odsOrario" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="WebSCR_data.DS_UtilityTableAdapters.GiornoTipoTableAdapter"></asp:ObjectDataSource>
</li>
<li class="ui-body">
<%--<asp:TextBox runat="server" ID="txtNewTask" placeholder="Nuovo Intervento" />--%>
<div class="ui-field-contain">
<fieldset data-role="controlgroup" data-type="horizontal" data-mini="true" style="font-size: 0.9em; width: 90%;">
<div data-role="controlgroup" data-type="horizontal" data-mini="true" style="font-size: 0.9em; width: 90%;">
<asp:LinkButton ID="lbAdd" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-plus ui-btn-icon-right ui-btn-inline" runat="server" CausesValidation="False" Text="Task" OnClick="lbAdd_Click"></asp:LinkButton>
<asp:DropDownList runat="server" ID="ddlTipoCons" DataSourceID="odsTipoCons" DataTextField="DescrConsegna" DataValueField="CodConsegna"></asp:DropDownList>
</fieldset>
</div>
</div>
<asp:ObjectDataSource runat="server" ID="odsTipoCons" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="WebSCR_data.DS_ApplicazioneTableAdapters.AnagTipoConsegneTableAdapter" />
<asp:GridView ID="grViewDettInt" runat="server" AutoGenerateColumns="False" DataKeyNames="IdxImpegno,NumCons" DataSourceID="odsDettInt" Width="100%">
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
@@ -259,16 +259,8 @@
Nessun Task
</EmptyDataTemplate>
<Columns>
<%--<asp:BoundField DataField="IdxImpegno" HeaderText="IdxImpegno" ReadOnly="True" SortExpression="IdxImpegno" />
<asp:BoundField DataField="NumCons" HeaderText="NumCons" ReadOnly="True" SortExpression="NumCons" />
<asp:BoundField DataField="CodConsegna" HeaderText="CodConsegna" SortExpression="CodConsegna" />--%>
<%--<asp:BoundField DataField="MinutiStd" HeaderText="MinutiStd" SortExpression="MinutiStd" />--%>
<%-- <asp:CheckBoxField DataField="Elettrod" HeaderText="Elettrod" SortExpression="Elettrod" />
<asp:CheckBoxField DataField="Clima" HeaderText="Clima" SortExpression="Clima" />
<asp:CheckBoxField DataField="Inform" HeaderText="Inform" SortExpression="Inform" />--%>
<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
<%--<asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
<HeaderTemplate>
<%-- <asp:LinkButton ID="btnNew" CssClass="ui-btn ui-shadow ui-corner-all ui-icon-plus ui-btn-icon-notext ui-btn-inline" runat="server" CausesValidation="False" CommandArgument="edit" CommandName="Edit" Text="New" OnClick="btnNew_Click"></asp:LinkButton>--%>
</HeaderTemplate>
<ItemTemplate>
<div class="ui-nodisc-icon ui-alt-icon">
@@ -278,31 +270,30 @@
<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>
</asp:TemplateField>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Attività" SortExpression="DescrConsegna">
<EditItemTemplate>
<%--<EditItemTemplate>
<div style="font-size: 0.9em;">
<asp:DropDownList runat="server" ID="ddlTipoCons" DataSourceID="odsTipoCons" DataTextField="DescrConsegna" DataValueField="CodConsegna" SelectedValue='<%# Bind("CodConsegna") %>'></asp:DropDownList>
<div style="color: #DEDEDE;">
note:
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Note") %>' TextMode="MultiLine" />
<asp:TextBox ID="txtNote" runat="server" Text='<%# Bind("Note") %>' TextMode="MultiLine" />
</div>
</div>
</EditItemTemplate>
</EditItemTemplate>--%>
<ItemTemplate>
<div style="font-size: 0.9em;">
<div class="flLeft">
<asp:Label ID="Label1" runat="server" Text='<%# Bind("DescrConsegna","<b>{0}</b>") %>' />
<asp:Label ID="Label1" runat="server" Text='<%# Eval("DescrConsegna","<b>{0}</b>") %>' />
</div>
<div class="flRight">
num op:
<asp:Label ID="Label2" runat="server" Text='<%# Bind("NumOp") %>' />,&nbsp;
<asp:Label ID="Label3" runat="server" Text='<%# Bind("Minuti","{0} min") %>' />
<asp:Label ID="Label2" runat="server" Text='<%# Eval("NumOp","<b>{0}</b> op") %>' />,&nbsp;
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Minuti","<b>{0}</b> min") %>' />
</div>
<div style="clear: both; font-size: 0.9em; color: #696969;">
<%--<div style="clear: both; font-size: 0.9em; color: #696969;">
note:
<asp:Label ID="Label4" runat="server" Text='<%# Bind("Note") %>' />
</div>
<asp:Label ID="Label4" runat="server" Text='<%# Eval("Note") %>' />
</div>--%>
</div>
</ItemTemplate>
</asp:TemplateField>
@@ -310,17 +301,16 @@
<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>
<%-- <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>
</EditItemTemplate>--%>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsDettInt" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="getByImpegno" TypeName="WebSCR_data.DS_ApplicazioneTableAdapters.DettImpegnoTableAdapter" DeleteMethod="deleteQuery" OnDeleted="odsDettInt_Deleted" OnUpdated="odsDettInt_Updated">
<asp:ObjectDataSource ID="odsDettInt" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="getByImpegno" TypeName="WebSCR_data.DS_ApplicazioneTableAdapters.DettImpegnoTableAdapter" DeleteMethod="deleteQuery" OnDeleted="odsDettInt_Deleted" OnUpdated="odsDettInt_Updated" UpdateMethod="updateQuery" OnUpdating="odsDettInt_Updating">
<DeleteParameters>
<asp:Parameter Name="Original_IdxImpegno" Type="Int32" />
<asp:Parameter Name="Original_NumCons" Type="Int32" />
@@ -328,23 +318,14 @@
<SelectParameters>
<asp:QueryStringParameter DefaultValue="0" Name="IdxImpegno" QueryStringField="IdxImpegno" Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Original_IdxImpegno" Type="Int32" />
<asp:Parameter Name="Original_NumCons" Type="Int32" />
<asp:Parameter Name="CodConsegna" Type="String" />
<asp:Parameter Name="Note" Type="String" />
</UpdateParameters>
</asp:ObjectDataSource>
</li>
</ul>
<br />
<br />
<div class="ui-grid-solo">
textbox x selezionare...
</div>
<div>
GridView:
<br />
Permetto di inserire uno o + task
<br />
selettore testuale x ADD
<br />
elenco task inseriti (gridview) che aggiornano i totali del tempi impegni (togliere da colonna fisica e fare solo calcolata?)
</div>
</div>
@@ -89,5 +89,14 @@ namespace WebSCR.WebUserControls
{
doUpdate();
}
protected void odsDettInt_Updating(object sender, ObjectDataSourceMethodEventArgs e)
{
// recupero valori consegna e note...
e.InputParameters["CodConsegna"] = ((DropDownList)grViewDettInt.Rows[grViewDettInt.EditIndex].FindControl("ddlTipoCons")).SelectedValue;
e.InputParameters["Note"] = ((TextBox)grViewDettInt.Rows[grViewDettInt.EditIndex].FindControl("txtNote")).Text;
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+56 -1
View File
@@ -10762,7 +10762,7 @@ SELECT Data, CodSquadra, OreDisp, NumOp, MinDisp FROM Disponibilita WHERE (CodSq
[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 IdxImpegno, NumCons, CodConsegna, DescrConsegna, MinutiStd, NumOp, Elettro" +
@@ -10795,6 +10795,15 @@ SELECT Data, CodSquadra, OreDisp, NumOp, MinDisp FROM Disponibilita WHERE (CodSq
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("@IdxImpegno", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodConsegna", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 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_DettImp_update";
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_IdxImpegno", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_NumCons", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodConsegna", 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("@Note", global::System.Data.SqlDbType.NVarChar, 250, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@@ -10928,6 +10937,52 @@ SELECT Data, CodSquadra, OreDisp, NumOp, MinDisp FROM Disponibilita WHERE (CodSq
}
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 updateQuery(global::System.Nullable<int> Original_IdxImpegno, global::System.Nullable<int> Original_NumCons, string CodConsegna, string Note) {
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5];
if ((Original_IdxImpegno.HasValue == true)) {
command.Parameters[1].Value = ((int)(Original_IdxImpegno.Value));
}
else {
command.Parameters[1].Value = global::System.DBNull.Value;
}
if ((Original_NumCons.HasValue == true)) {
command.Parameters[2].Value = ((int)(Original_NumCons.Value));
}
else {
command.Parameters[2].Value = global::System.DBNull.Value;
}
if ((CodConsegna == null)) {
command.Parameters[3].Value = global::System.DBNull.Value;
}
else {
command.Parameters[3].Value = ((string)(CodConsegna));
}
if ((Note == null)) {
command.Parameters[4].Value = global::System.DBNull.Value;
}
else {
command.Parameters[4].Value = ((string)(Note));
}
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>
+14
View File
@@ -857,6 +857,20 @@ SELECT Data, CodSquadra, OreDisp, NumOp, MinDisp FROM Disponibilita WHERE (CodSq
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="WebSCRConnectionString (Settings)" DbObjectName="WebSCR.dbo.stp_DettImp_update" DbObjectType="StoredProcedure" GenerateShortCommands="true" GeneratorSourceName="updateQuery" Modifier="Public" Name="updateQuery" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy2" UserSourceName="updateQuery">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
<CommandText>dbo.stp_DettImp_update</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="int" DbType="Int32" Direction="Input" ParameterName="@Original_IdxImpegno" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@Original_NumCons" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@CodConsegna" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@Note" Precision="0" ProviderType="NVarChar" Scale="0" Size="250" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
</Sources>
</TableAdapter>
</Tables>
+1 -1
View File
@@ -15,7 +15,7 @@
<Shape ID="DesignTable:DispImpSquadre" ZOrder="8" X="1026" Y="671" Height="153" Width="241" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:v_ImpegniCal" ZOrder="3" X="450" Y="797" Height="191" Width="222" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="121" />
<Shape ID="DesignTable:Disponibilita" ZOrder="5" X="784" Y="708" Height="191" Width="218" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="121" />
<Shape ID="DesignTable:DettImpegno" ZOrder="1" X="44" Y="721" Height="362" Width="286" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="235" />
<Shape ID="DesignTable:DettImpegno" ZOrder="1" X="44" Y="721" Height="362" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="235" />
</Shapes>
<Connectors>
<Connector ID="DesignRelation:FK_Disponibilita_AnagSquadre" ZOrder="4" LineWidth="11">
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.