<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_FusiSterr.ascx.cs" Inherits="GMW.WebUserControls.mod_FusiSterr" %>

<% if (false)
   { %>
<webopt:BundleReference ID="BundleReference1" runat="server" Path="~/Content/css" />
<webopt:BundleReference ID="BundleReference2" runat="server" Path="~/Content/themes/base/css" />
<% } %>



<div class="row">
    <div class="col-sm-4 col-lg-3">
        <h2>Gestione integrata</h2>
        <h1>FUSI e STERRATI</h1>
    </div>
    <div class="col-sm-4 col-lg-6">
        <div>
            <asp:Label runat="server" ID="lblParticolareAttivo" Font-Size="3em" Text="" />
        </div>
        <div>
            <asp:Label runat="server" ID="lblDescrAttivo" Font-Size="2em" Text="" ToolTip="particolare" />
            <br />
            <asp:Label runat="server" ID="lblDisegno" Font-Size="1.8em" Text="" ForeColor="#FFFFFF" Font-Bold="true" ToolTip="disegno" />
        </div>
        <div>
            <asp:Label runat="server" ID="lblBarcode" Text="Barcode" />
            <br />
            <asp:TextBox runat="server" ID="txtBarcode" Height="1.2em" Width="100%" Font-Size="3em" AutoPostBack="True" Style="text-align: center" TabIndex="1" />
        </div>
        <div id="divNote" runat="server">
            <div>
                <%: traduci("Note") %>
            </div>
            <div>
                <asp:TextBox runat="server" ID="txtNote" Height="4em" Width="100%" Font-Size="2em" TextMode="MultiLine" TabIndex="2" />
                <asp:Button runat="server" ID="btnEmptyNote" Height="3em" Width="100%" OnClick="btnEmptyNote_Click" TabIndex="3" CssClass="btn btn-default" />
            </div>
            <div style="padding: 4px 0px;">
                <asp:LinkButton runat="server" ID="lbtStampaUDC" Width="100%" CssClass="btn btn-warning btn-lg" TabIndex="4" OnClick="btnStampa_Click"><i aria-hidden='true' class='fa fa-print fa-2x'></i> <%: traduci("btnStampaUdc") %></asp:LinkButton>
            </div>
        </div>
    </div>
    <div class="col-sm-4 col-lg-3">
        <div class="card bg-primary text-light small">
            <div class="card-header">
                <b><%: traduci("Destinazione") %></b> (AL)
            </div>
            <div class="card-body bg-light text-dark">
                <div class="bg-primary text-light">
                    <asp:Label runat="server" ID="lblAL" />
                </div>
                <div style="font-size: 0.9em;">
                    <asp:GridView ID="grViewDest" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="UDC" DataSourceID="odsDest" Width="100%" OnSelectedIndexChanged="grViewDest_SelectedIndexChanged">
                        <RowStyle CssClass="ctrRowStyle" />
                        <AlternatingRowStyle CssClass="ctrAltRowStyle" />
                        <EditRowStyle CssClass="ctrEditRowStyle" />
                        <SelectedRowStyle CssClass="ctrSelRowStyle" />
                        <FooterStyle CssClass="ctrFooter" />
                        <PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
                        <HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
                        <EmptyDataRowStyle CssClass="ctrRowStyle" />
                        <EmptyDataTemplate>
                            <asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
                        </EmptyDataTemplate>
                        <Columns>
                            <asp:TemplateField ShowHeader="False">
                                <HeaderTemplate>
                                    <asp:LinkButton ID="btnReset" runat="server" OnClick="btnReset_Click" CssClass="btn btn-default btn-sm"><i class="fa fa-refresh"></i> <%: traduci("Reset") %></asp:LinkButton>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbtnEditQty" runat="server" CausesValidation="False" CommandName="Select" CssClass="text-success"><i class='<%# cssGlyphByQty(Eval("Qta"))%>'></i></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <%--<asp:TemplateField HeaderText="lastMov" SortExpression="lastMov" ItemStyle-Wrap="false">
                                <ItemTemplate>
                                    <asp:Label ID="lbllastMov" runat="server" Text='<%# Eval("lastMov", "{0:dd/MM HH:mm}") %>' />
                                </ItemTemplate>
                                <ItemStyle Wrap="False" />
                            </asp:TemplateField>--%>
                            <asp:TemplateField HeaderText="UDC" SortExpression="UDC">
                                <ItemTemplate>
                                    <asp:Label ID="lblUDC" runat="server" Text='<%# Eval("UDC") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Particolare" SortExpression="Particolare">
                                <ItemTemplate>
                                    <asp:Label ID="lblParticolare" runat="server" Text='<%# Eval("Particolare") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Qta" SortExpression="Qta" ItemStyle-HorizontalAlign="Right">
                                <ItemTemplate>
                                    <span style="padding: 0px 4px;">
                                        <b>
                                            <asp:Label ID="lblQta" runat="server" Text='<%# Eval("Qta","{0:#}") %>' /></b>
                                    </span>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Right"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbtDelete" runat="server" CausesValidation="False" CommandName="Delete" OnClientClick="return confirm('Confermi eliminazione?')" CssClass="text-danger" Visible='<%# canDelete(Eval("Qta")) %>'><i class="fa fa-trash"></i></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <asp:ObjectDataSource ID="odsDest" runat="server" OldValuesParameterFormatString="{0}"
                        SelectMethod="getByAL" TypeName="GMW_data.DS_magazzinoTableAdapters.v_UdcDetailTableAdapter" DeleteMethod="deleteQuery">
                        <DeleteParameters>
                            <asp:Parameter Name="UDC" Type="String" />
                        </DeleteParameters>
                        <SelectParameters>
                            <asp:ControlParameter ControlID="lblAL" DefaultValue="AL0000" Name="AL" PropertyName="Text" Type="String" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                </div>
            </div>

        </div>
        <div class="card bg-default small">
            <div class="card-header">
                <b><%: traduci("lblCesta") %></b>
            </div>
            <div class="card-body bg-light text-dark">
                <asp:TextBox runat="server" ID="txtCesta" Width="200px" Font-Size="28pt" Style="text-align: center" palceholder="num cesta" AutoPostBack="True" OnTextChanged="txtCesta_TextChanged" />
            </div>
        </div>
        <div id="divQta" runat="server" class="card bg-default small">
            <div class="card-header">
                <b><%: traduci("Qta") %></b>
            </div>
            <div class="card-body bg-light text-dark">
                <asp:TextBox runat="server" ID="txtQta" Height="56px" Width="100%" Font-Size="32pt" Style="text-align: center" TabIndex="6" AutoPostBack="true" OnTextChanged="txtQta_TextChanged" />
                <asp:LinkButton runat="server" ID="lbtUpdQty" Font-Size="18pt" CssClass="btn btn-success" Width="100%" OnClick="lbtUpdQty_Click"><i aria-hidden='true' class='fa fa-pencil'></i> <%: traduci("updateQty") %></asp:LinkButton>
            </div>
        </div>
    </div>
</div>
