Update db e applicazione x gestione commessa (new ed elenco)
git-svn-id: https://keyhammer.ath.cx/svn/XPS/trunk@23 43c8e981-f90d-406c-a89a-24a2c4268d51
This commit is contained in:
+68
-12
@@ -1,7 +1,7 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="mod_elencoComm.ascx.cs"
|
||||
Inherits="mod_elencoComm" %>
|
||||
<link href="Style.css" rel="stylesheet" type="text/css" />
|
||||
<%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc1" %>
|
||||
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
|
||||
<div class="filtro_1">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
@@ -54,7 +54,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataSourceID="ods">
|
||||
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataSourceID="ods" DataKeyNames="Cod" AllowPaging="True" AllowSorting="True" OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound">
|
||||
<RowStyle CssClass="ctrRowStyle" />
|
||||
<AlternatingRowStyle CssClass="ctrAltRowStyle" />
|
||||
<EditRowStyle CssClass="ctrEditRowStyle" />
|
||||
@@ -65,28 +65,84 @@
|
||||
<EmptyDataRowStyle CssClass="ctrRowStyle" />
|
||||
<EmptyDataTemplate>
|
||||
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
|
||||
<%--<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>' />--%>
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Cod" HeaderText="Cod" SortExpression="Cod" />
|
||||
<asp:BoundField DataField="Stato" HeaderText="Stato" SortExpression="Stato" />
|
||||
<asp:BoundField DataField="CodCliente" HeaderText="CodCliente" SortExpression="CodCliente" />
|
||||
<asp:TemplateField ShowHeader="False">
|
||||
<HeaderTemplate>
|
||||
<asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click"
|
||||
Visible="false" />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
|
||||
ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
|
||||
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma , SteamWare.dimImg.small) %>' />
|
||||
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
|
||||
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:ImageButton ID="imgInsert" runat="server" CausesValidation="False" CommandName="Insert"
|
||||
ToolTip='<%# traduci("Insert") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.nuovo , SteamWare.dimImg.small) %>'
|
||||
OnClick="lblIns_click" />
|
||||
<asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
|
||||
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Cliente" HeaderText="Cliente" SortExpression="Cliente" />
|
||||
<asp:TemplateField HeaderText="DDT" SortExpression="DDT">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label3" runat="server" Text='<%# Bind("DDT") %>' ToolTip='<%# Eval("Cod")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="CodCli" HeaderText="CodCli" SortExpression="CodCli" />
|
||||
<asp:BoundField DataField="Stato" HeaderText="Stato" SortExpression="Stato" />
|
||||
<asp:BoundField DataField="descrizione" HeaderText="descrizione" SortExpression="descrizione" />
|
||||
<asp:BoundField DataField="DDT" HeaderText="DDT" SortExpression="DDT" />
|
||||
<asp:BoundField DataField="DataArrivo" HeaderText="DataArrivo" SortExpression="DataArrivo" />
|
||||
<asp:BoundField DataField="Posizione" HeaderText="Posizione" SortExpression="Posizione" />
|
||||
<asp:BoundField DataField="DataArrivo" HeaderText="DataArrivo" SortExpression="DataArrivo" DataFormatString="{0:dd/MM/yy hh:mm}" />
|
||||
<asp:BoundField DataField="Qta" HeaderText="Qta" ReadOnly="True" SortExpression="Qta" />
|
||||
<asp:BoundField DataField="Peso" HeaderText="Peso" ReadOnly="True" SortExpression="Peso" />
|
||||
<asp:BoundField DataField="Righe" HeaderText="Righe" SortExpression="Righe" />
|
||||
<asp:BoundField DataField="Colli" HeaderText="Colli" SortExpression="Colli" />
|
||||
<asp:BoundField DataField="DataPrevista" HeaderText="DataPrevista" SortExpression="DataPrevista" />
|
||||
<asp:BoundField DataField="DataPrevista" HeaderText="DataPrevista" SortExpression="DataPrevista" DataFormatString="{0:dd/MM/yy hh:mm}" />
|
||||
<asp:TemplateField ShowHeader="False">
|
||||
<HeaderTemplate>
|
||||
<asp:Button ID="btnNew" runat="server" OnClick="btnNew_Click" Text='<%# traduci("New") %>' />
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
|
||||
ToolTip='<%# traduci("Delete") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina , SteamWare.dimImg.small) %>' />
|
||||
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
|
||||
TargetControlID="imgDelete">
|
||||
</cc1:ConfirmButtonExtender>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
<asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
|
||||
ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma , SteamWare.dimImg.small) %>' />
|
||||
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
|
||||
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
|
||||
</EditItemTemplate>
|
||||
<FooterTemplate>
|
||||
<asp:ImageButton ID="imgInsert2" runat="server" CausesValidation="False" CommandName="Insert"
|
||||
ToolTip='<%# traduci("Insert") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.nuovo , SteamWare.dimImg.small) %>'
|
||||
OnClick="lblIns_click" />
|
||||
<asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
|
||||
ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
|
||||
</FooterTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}"
|
||||
SelectMethod="GetData" TypeName="DS_applicazioneTableAdapters.v_commesseTableAdapter">
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}"
|
||||
SelectMethod="GetData"
|
||||
TypeName="DS_applicazioneTableAdapters.v_commesseTableAdapter"
|
||||
DeleteMethod="sp_delObj">
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_Cod" Type="String" />
|
||||
</DeleteParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini"></asp:Label><br />
|
||||
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
|
||||
|
||||
<p>
|
||||
Dettaglio del DDT:<br />
|
||||
- pulsanti aggiunta<br />
|
||||
|
||||
+168
-3
@@ -12,6 +12,136 @@ using SteamWare;
|
||||
|
||||
public partial class mod_elencoComm : ApplicationUserControl
|
||||
{
|
||||
#region area da NON modificare
|
||||
|
||||
#region area protected
|
||||
|
||||
protected string _idxGridView;
|
||||
protected bool _showNewBtn = true;
|
||||
|
||||
/// <summary>
|
||||
/// aggiorna controlli datagrid e numero righe in pagina
|
||||
/// </summary>
|
||||
protected override void aggiornaControlliDataGL()
|
||||
{
|
||||
base.aggiornaControlliDataGL();
|
||||
grView.PageSize = _righeDataGridMed;
|
||||
}
|
||||
/// <summary>
|
||||
/// traduce gli header delle colonne
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
if (grView.Rows.Count > 0)
|
||||
{
|
||||
LinkButton lb;
|
||||
// aggiorno gli headers
|
||||
foreach (TableCell cella in grView.HeaderRow.Cells)
|
||||
{
|
||||
try
|
||||
{
|
||||
lb = (LinkButton)cella.Controls[0];
|
||||
lb.Text = traduci(lb.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
|
||||
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
|
||||
}
|
||||
else
|
||||
{
|
||||
lblNumRec.Text = "";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// reset della selezione
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetSelezione();
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione cambio selezione valore
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// salvo in session il valore selezionato...
|
||||
SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue);
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_selValore != null)
|
||||
{
|
||||
eh_selValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||
/// </summary>
|
||||
public void resetSelezione()
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region gestione eventi
|
||||
|
||||
public event EventHandler eh_resetSelezione;
|
||||
public event EventHandler eh_nuovoValore;
|
||||
public event EventHandler eh_selValore;
|
||||
|
||||
#endregion
|
||||
|
||||
#region public
|
||||
|
||||
/// <summary>
|
||||
/// definisce visibilità btnNew
|
||||
/// </summary>
|
||||
public bool showNewBtn
|
||||
{
|
||||
get
|
||||
{
|
||||
return _showNewBtn;
|
||||
}
|
||||
set
|
||||
{
|
||||
_showNewBtn = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua update del modulo
|
||||
/// </summary>
|
||||
public void doUpdate()
|
||||
{
|
||||
resetSelezione();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region area codice variabile
|
||||
|
||||
/// <summary>
|
||||
/// elenco colonne del datagrid
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected DataColumnCollection colonneObj()
|
||||
{
|
||||
DS_applicazione.v_commesseDataTable tabella = new DS_applicazione.v_commesseDataTable();
|
||||
DataColumnCollection colonne = tabella.Columns;
|
||||
return colonne;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// inizializzazione valori di default
|
||||
@@ -20,6 +150,7 @@ public partial class mod_elencoComm : ApplicationUserControl
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
_idxGridView = "Cod";
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
mf_clienti.ods = odsFiltroClienti;
|
||||
@@ -68,13 +199,47 @@ public partial class mod_elencoComm : ApplicationUserControl
|
||||
protected void btnNewComm_Click(object sender, EventArgs e)
|
||||
{
|
||||
// creazione di un nuovo set...
|
||||
DS_applicazioneTableAdapters.SP taSP = new DS_applicazioneTableAdapters.SP();
|
||||
taSP.sp_creaSetObj(DateTime.Now.ToString("yyyyMMdd_hhmmss"), "EQUA", mf_cliNew.valore, txtDDT.Text, txtNome.Text, user_std.UtSn.utente, "...");
|
||||
|
||||
DS_applicazioneTableAdapters.v_commesseTableAdapter taComm = new DS_applicazioneTableAdapters.v_commesseTableAdapter();
|
||||
taComm.sp_creaSetObj(DateTime.Now.ToString("yyyyMMdd_hhmmss"), "EQUA", mf_cliNew.valore, txtDDT.Text, txtNome.Text, user_std.UtSn.utente, "...");
|
||||
// nascondo tutto...
|
||||
txtNome.Text = "";
|
||||
scambiaVisibPnlNew();
|
||||
// aggiorno pannello...
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// inserisce nuovo valore da footer
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lblIns_click(object sender, EventArgs e)
|
||||
{
|
||||
// click su inserimento, chiamo il metodo insert dell'ObjectDataSource
|
||||
ods.Insert();
|
||||
}
|
||||
/// <summary>
|
||||
/// gestione evento richeista nuovo valore (mostra footer, ...)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
// reset selezione...
|
||||
resetSelezione();
|
||||
// mostro il footer oppure la riga dei dettagli x nuovo...
|
||||
if (grView.FooterRow != null)
|
||||
{
|
||||
grView.FooterRow.Visible = true;
|
||||
}
|
||||
#if false
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_nuovoValore != null)
|
||||
{
|
||||
eh_nuovoValore(this, new EventArgs());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user