<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_PostRX_DT.ascx.cs" Inherits="GMW.WebUserControls.mod_PostRX_DT" %>
<%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">
        <div style="float: left; text-align: center;">
            <div class="card bg-default small">
                <div class="card-header">
                    <b><%: traduci("ParticolariCaricati") %></b>
                </div>
                <div class="card-body bg-light text-dark">
                    <asp:GridView ID="grView" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                        OnDataBound="grView_DataBound"
                        DataKeyNames="UDC" DataSourceID="ods" OnSelectedIndexChanged="grView_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">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Select" CssClass="text-success"><i class="fa fa-search-plus btn-lg"></i></asp:LinkButton>
                                </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"><i class="fa fa-trash btn-lg"></i></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="{0}"
                        SelectMethod="getUdcDetailByIdxCella" TypeName="GMW_data.DS_magazzinoTableAdapters.v_UdcDetailTableAdapter"
                        DeleteMethod="deleteQueryWithDtx" OnDeleted="ods_Deleted">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="lblIdxCella" DefaultValue="0" Name="IdxCella" PropertyName="Text" Type="Int32" />
                        </SelectParameters>
                        <DeleteParameters>
                            <asp:Parameter Name="UDC" Type="String" />
                        </DeleteParameters>
                    </asp:ObjectDataSource>
                    <asp:Label runat="server" ID="lblIdxCella" Visible="false" />
                    <asp:Label ID="lblNumRec" runat="server" CssClass="didascalia" />
                </div>
            </div>
            <div class="card bg-default small">
                <div class="card-header">
                    <b><%: traduci("DataFusione") %></b>
                </div>
                <div class="card-body bg-light text-dark">
                    <asp:Label runat="server" ID="lblDTFus" />
                    <br />
                    <b><asp:Label runat="server" ID="lblLinFus" /></b>
                </div>
            </div>
        </div>
    </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>
            <div id="divModoInput" runat="server" style="width: 320px; margin: auto; text-align: center;">
                <asp:RadioButtonList ID="rblInputMode" runat="server" AutoPostBack="true" OnSelectedIndexChanged="rblInputMode_SelectedIndexChanged" class="btn-group" RepeatDirection="Horizontal" RepeatLayout="Flow">
                    <asp:ListItem Value="BARCODE" Text="MATRIX" Selected="True" class="btn btn-default btn-lg"></asp:ListItem>
                    <%-- <asp:ListItem Value="ELENCO" Text="ELENCO" class="btn btn-default btn-lg"></asp:ListItem>--%>
                </asp:RadioButtonList>
            </div>
            <div id="divElenco" runat="server">
                <div>
                    <asp:Label runat="server" ID="lblElencoPart" AssociatedControlID="ddlPart"><%: traduci("lblElencoPart") %></asp:Label>
                </div>
                <span style="font-size: 18pt;">
                    <asp:DropDownList ID="ddlPart" runat="server" DataSourceID="odsParticolari" DataTextField="label" DataValueField="value"></asp:DropDownList>
                </span>
                <asp:ObjectDataSource ID="odsParticolari" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByConditio" TypeName="GMW_data.DS_UtilityTableAdapters.v_selParticolariTableAdapter">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="P" Name="conditio" Type="String" />
                    </SelectParameters>
                </asp:ObjectDataSource>
                <asp:LinkButton runat="server" ID="lbtAddPart" CssClass="btn btn-primary" OnClick="lbtAddPart_Click"><i aria-hidden='true' class='fa fa-plus'></i></asp:LinkButton>
            </div>
            <div id="divBarcode" runat="server">
                <div>
                    <div>
                        <asp:Label runat="server" ID="lblBarcode" AssociatedControlID="txtBarcode"><%: traduci("lblDataMatrix") %></asp:Label>
                    </div>
                    <asp:TextBox runat="server" ID="txtBarcode" Height="1.2em" Width="100%" Font-Size="3em" AutoPostBack="True" Style="text-align: center" TabIndex="1" />
                </div>
            </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" />
                </div>
                <div style="width: 400px; margin: auto;">
                    <asp:LinkButton runat="server" ID="lbtGeneraAl" Width="100%" CssClass="btn btn-warning btn-lg" OnClick="lbtGeneraAl_Click"><i aria-hidden='true' class='fa fa-print fa-2x'></i> <%: traduci("lbtGeneraAl") %></asp:LinkButton>
                    <asp:LinkButton runat="server" ID="lbtGeneraUDC" Width="100%" CssClass="btn btn-warning btn-lg" Visible="false"><i aria-hidden='true' class='fa fa-print fa-2x'></i> <%: traduci("lbtGeneraUDC") %></asp:LinkButton>
                </div>
            </div>
        </div>
    </div>
    <div class="col-sm-4 col-lg-3">
        <div style="float: right; text-align: center;">
            <div class="card bg-default small">
                <div class="card-header">
                    <b><%: traduci("lblQtaPart") %></b>
                </div>
                <div class="card-body bg-light text-dark">
                    <%--disabilitati in maschera dtx--%>
                    <asp:TextBox runat="server" ID="txtQta" Width="100%" Font-Size="28pt" Style="text-align: center" Enabled="false" />
                    <asp:LinkButton runat="server" ID="lbtAddUdc" Font-Size="18pt" CssClass="btn btn-success" Width="100%" OnClick="lbtAddUdc_Click" Visible="false"><i aria-hidden='true' class='fa fa-pencil'></i> <%: traduci("addUDC") %></asp:LinkButton>
                </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="100%" Font-Size="28pt" Style="text-align: center" palceholder="num cesta" AutoPostBack="True" OnTextChanged="txtCesta_TextChanged" />
                </div>
            </div>
        </div>
    </div>
</div>
