completata navigazioen up/down x anagrafica magazzini!
This commit is contained in:
@@ -4,22 +4,23 @@
|
||||
<link href="../Style.css" rel="stylesheet" type="text/css" />
|
||||
<% } %>
|
||||
<asp:Panel runat="server" ID="pnlBlocchi" CssClass="clearAll">
|
||||
<%--<div class="clearAll">
|
||||
<asp:ImageButton ID="btnUpMag" runat="server" ImageUrl="../images/ArrowUp.png" OnClick="btnUpMag_Click" Width="16px" Height="16px" />
|
||||
<asp:ImageButton ID="btnDownMag" runat="server" ImageUrl="../images/ArrowDown.png" OnClick="btnDownMag_Click" Width="16px"
|
||||
Height="16px" />
|
||||
</div>--%>
|
||||
<div style="padding: 2px; font-size: 8pt;">
|
||||
<asp:ListView ID="lsViewMag" runat="server" DataSourceID="ods" EnableModelValidation="True" OnSelectedIndexChanged="lsView_SelectedIndexChanged"
|
||||
DataKeyNames="IdxBlocco">
|
||||
<LayoutTemplate>
|
||||
<div>
|
||||
<asp:PlaceHolder ID="itemPlaceholder" runat="server" />
|
||||
</div>
|
||||
</LayoutTemplate>
|
||||
<SelectedItemTemplate>
|
||||
<div style="float: left; text-align: left; margin: auto; padding: 2px;">
|
||||
<div class="btnAzzurroHalf">
|
||||
<div class="clearAll" style="text-align: center; margin: auto; height: 30px; vertical-align: top;">
|
||||
<asp:ImageButton ID="btnUpMag" runat="server" ImageUrl="../images/ArrowUp.png" OnClick="btnUpMag_Click" Width="22px" Height="22px" />
|
||||
<asp:Button ID="btnButtonsHome" runat="server" OnClick="btnButtonsHome_Click" CssClass="btnHome" Text="Ricerca [6]" AccessKey="6"
|
||||
Height="24px" />
|
||||
<asp:ImageButton ID="btnDownMag" runat="server" ImageUrl="../images/ArrowDown.png" OnClick="btnDownMag_Click" Width="22px"
|
||||
Height="22px" />
|
||||
</div>
|
||||
<asp:GridView ID="grViewMag" runat="server" DataSourceID="ods" EnableModelValidation="True" DataKeyNames="IdxBlocco" AutoGenerateColumns="False"
|
||||
PageSize="3" AllowPaging="True" OnSelectedIndexChanged="grViewMag_SelectedIndexChanged" Width="100%">
|
||||
<RowStyle CssClass="btnGrigioHalf" />
|
||||
<SelectedRowStyle CssClass="btnAzzurroHalf" />
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="lbBlocco" CommandArgument='<%# Eval("IdxBlocco") %>' CommandName="Select">
|
||||
<asp:Label runat="server" ID="lblCodBlocco" Font-Bold="true" Text='<%# Eval("CodBlocco") %>' /> -
|
||||
<asp:Label runat="server" ID="lblDescBlocco" Font-Bold="true" Text='<%# Eval("DescBlocco") %>' />
|
||||
@@ -27,52 +28,16 @@
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Eval("NumUDC","{0} UDC") %>' />
|
||||
/
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Eval("QtaTotPz","{0:0} pz") %>' />
|
||||
</asp:LinkButton></div>
|
||||
</div>
|
||||
</SelectedItemTemplate>
|
||||
<ItemTemplate>
|
||||
<div style="float: left; text-align: left; margin: auto; padding: 2px;">
|
||||
<div class="btnGrigioHalf">
|
||||
<asp:LinkButton runat="server" ID="lbBlocco" CommandArgument='<%# Eval("IdxBlocco") %>' CommandName="Select">
|
||||
<asp:Label runat="server" ID="lblCodBlocco" Font-Bold="true" Text='<%# Eval("CodBlocco") %>' /> -
|
||||
<asp:Label runat="server" ID="lblDescBlocco" Font-Bold="true" Text='<%# Eval("DescBlocco") %>' />
|
||||
<br />
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Eval("NumUDC","{0} UDC") %>' />
|
||||
/
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Eval("QtaTotPz","{0:0} pz") %>' />
|
||||
</asp:LinkButton></div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
<EmptyDataTemplate>
|
||||
Nessun Risultato</EmptyDataTemplate>
|
||||
</asp:ListView>
|
||||
</asp:LinkButton></ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GMW_data.DS_magazzinoTableAdapters.stp_MagFifoByParticolareTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="TK" Name="CodCS" SessionField="CodCS" Type="String" />
|
||||
<asp:SessionParameter DefaultValue="*" Name="Particolare" SessionField="Particolare_sel" Type="String" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<div class="clearAll" style="text-align: left; margin: auto; font-size: 10pt;">
|
||||
<asp:DataPager ID="dtPager" runat="server" PagedControlID="lsViewMag" PageSize="3">
|
||||
<Fields>
|
||||
<asp:NextPreviousPagerField PreviousPageText="prec" NextPageText="succ" />
|
||||
<%-- <asp:NextPreviousPagerField ButtonType="Image" ShowPreviousPageButton="True" ShowNextPageButton="False"
|
||||
PreviousPageText="prec." PreviousPageImageUrl="../images/ArrowUp.png" />--%>
|
||||
<asp:TemplatePagerField OnPagerCommand="TemplatePagerField_OnPagerCommand">
|
||||
<PagerTemplate>
|
||||
<asp:Button ID="btnButtonsHome" runat="server" OnClick="btnButtonsHome_Click" CssClass="btnHome" Text="Ricerca [6]" AccessKey="6" />
|
||||
<asp:ImageButton ID="btnUpMag" runat="server" ImageUrl="../images/ArrowUp.png" OnClick="btnUpMag_Click" Width="22px" Height="22px" />
|
||||
<asp:ImageButton ID="btnDownMag" runat="server" ImageUrl="../images/ArrowDown.png" OnClick="btnDownMag_Click" Width="22px"
|
||||
Height="22px" />
|
||||
<%--<asp:ImageButton ID="PreviousButton" runat="server" CommandName="Previous" ImageUrl="../images/ArrowUp.png" Visible='<%# Container.StartRowIndex > 0 %>' />
|
||||
<asp:ImageButton ID="NextButton" runat="server" CommandName="Next" ImageUrl="../images/ArrowDown.png" Visible='<%# (Container.StartRowIndex + Container.PageSize) < Container.TotalRowCount %>' />--%>
|
||||
</PagerTemplate>
|
||||
</asp:TemplatePagerField>
|
||||
<%--<asp:NextPreviousPagerField ButtonType="Image" ShowPreviousPageButton="False" ShowNextPageButton="True"
|
||||
NextPageText="succ." NextPageImageUrl="../images/ArrowDown.png" />--%>
|
||||
</Fields>
|
||||
</asp:DataPager>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
<asp:Panel runat="server" ID="pnlUdc" CssClass="clearAll">
|
||||
|
||||
@@ -30,7 +30,10 @@ namespace GMW_Term.WebUserControls
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
idxBlocco = -1;
|
||||
lsViewMag.SelectedIndex = 0;
|
||||
#if false
|
||||
lsViewMag.SelectedIndex = 0;
|
||||
#endif
|
||||
grViewMag.SelectedIndex = 0;
|
||||
}
|
||||
showData();
|
||||
registraScripts();
|
||||
@@ -55,9 +58,9 @@ namespace GMW_Term.WebUserControls
|
||||
else
|
||||
key = e.keyCode;
|
||||
if(key == 38)
|
||||
document.getElementById('{ctlName}_dtPager_ctl01_btnUpMag').click();
|
||||
document.getElementById('{ctlName}_btnUpMag').click();
|
||||
if(key == 40)
|
||||
document.getElementById('{ctlName}_dtPager_ctl01_btnDownMag').click();
|
||||
document.getElementById('{ctlName}_btnDownMag').click();
|
||||
}
|
||||
document.onkeydown=move;
|
||||
";
|
||||
@@ -139,8 +142,20 @@ namespace GMW_Term.WebUserControls
|
||||
/// <param name="e"></param>
|
||||
protected void lsView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
#if false
|
||||
//lblRes.Text = lsView.SelectedDataKey["IdxBlocco"].ToString(); // ok!
|
||||
idxBlocco = Convert.ToInt32(lsViewMag.SelectedDataKey["IdxBlocco"].ToString());
|
||||
showData();
|
||||
#endif
|
||||
}
|
||||
/// <summary>
|
||||
/// cambio index
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grViewMag_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
idxBlocco = Convert.ToInt32(grViewMag.SelectedDataKey["IdxBlocco"].ToString());
|
||||
showData();
|
||||
}
|
||||
/// <summary>
|
||||
@@ -150,27 +165,20 @@ namespace GMW_Term.WebUserControls
|
||||
/// <param name="e"></param>
|
||||
protected void btnUpMag_Click(object sender, ImageClickEventArgs e)
|
||||
{
|
||||
int i = lsViewMag.SelectedIndex;
|
||||
int i = grViewMag.SelectedIndex;
|
||||
// condizione 1: sono entro la pagina
|
||||
if (i > 0)
|
||||
{
|
||||
lsViewMag.SelectedIndex = lsViewMag.SelectedIndex - 1;
|
||||
grViewMag.SelectedIndex = grViewMag.SelectedIndex - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// condizione 2: ho altre pagine precedenti
|
||||
int newIndex = dtPager.StartRowIndex - dtPager.PageSize;
|
||||
if (newIndex >= 0)
|
||||
if (grViewMag.PageIndex > 0)
|
||||
{
|
||||
// avanzo pagina
|
||||
CommandEventArgs commandEventArgs = new CommandEventArgs("Previous", "");
|
||||
NextPreviousPagerField nextPreviousPagerField = dtPager.Fields[0] as NextPreviousPagerField;
|
||||
if (nextPreviousPagerField != null)
|
||||
{
|
||||
nextPreviousPagerField.HandleEvent(commandEventArgs);
|
||||
}
|
||||
grViewMag.PageIndex = grViewMag.PageIndex - 1;
|
||||
// seleziono prima riga
|
||||
lsViewMag.SelectedIndex = dtPager.PageSize - 1;
|
||||
grViewMag.SelectedIndex = grViewMag.PageSize - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,27 +189,20 @@ namespace GMW_Term.WebUserControls
|
||||
/// <param name="e"></param>
|
||||
protected void btnDownMag_Click(object sender, ImageClickEventArgs e)
|
||||
{
|
||||
int i = lsViewMag.SelectedIndex;
|
||||
int i = grViewMag.SelectedIndex;
|
||||
// condizione 1: sono entro la pagina
|
||||
if (i < lsViewMag.Items.Count - 1)
|
||||
if (i < grViewMag.Rows.Count - 1)
|
||||
{
|
||||
lsViewMag.SelectedIndex = lsViewMag.SelectedIndex + 1;
|
||||
grViewMag.SelectedIndex = grViewMag.SelectedIndex + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// condizione 2: ho altre pagine successive
|
||||
int newIndex = dtPager.StartRowIndex + dtPager.PageSize;
|
||||
if (newIndex <= dtPager.TotalRowCount)
|
||||
if (grViewMag.PageIndex < grViewMag.PageCount)
|
||||
{
|
||||
// avanzo pagina
|
||||
CommandEventArgs commandEventArgs = new CommandEventArgs("Next", "");
|
||||
NextPreviousPagerField nextPreviousPagerField = dtPager.Fields[0] as NextPreviousPagerField;
|
||||
if (nextPreviousPagerField != null)
|
||||
{
|
||||
nextPreviousPagerField.HandleEvent(commandEventArgs);
|
||||
}
|
||||
grViewMag.PageIndex = grViewMag.PageIndex + 1;
|
||||
// seleziono prima riga
|
||||
lsViewMag.SelectedIndex = 0;
|
||||
grViewMag.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+29
-11
@@ -22,13 +22,40 @@ namespace GMW_Term.WebUserControls {
|
||||
protected global::System.Web.UI.WebControls.Panel pnlBlocchi;
|
||||
|
||||
/// <summary>
|
||||
/// lsViewMag control.
|
||||
/// btnUpMag 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.ListView lsViewMag;
|
||||
protected global::System.Web.UI.WebControls.ImageButton btnUpMag;
|
||||
|
||||
/// <summary>
|
||||
/// btnButtonsHome 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.Button btnButtonsHome;
|
||||
|
||||
/// <summary>
|
||||
/// btnDownMag 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.ImageButton btnDownMag;
|
||||
|
||||
/// <summary>
|
||||
/// grViewMag 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 grViewMag;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
@@ -39,15 +66,6 @@ namespace GMW_Term.WebUserControls {
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// dtPager 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.DataPager dtPager;
|
||||
|
||||
/// <summary>
|
||||
/// pnlUdc control.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user