<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Form_SelectProveedor.aspx.vb" Inherits="SGHweb.Form_SelectProveedor" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../Scripts/noty/jquery.noty.js"></script>
<script type="text/javascript" src="../Scripts/noty/themes/default.js"></script>
<script type="text/javascript" src="../Scripts/noty/layouts/center.js"></script>
<link rel="stylesheet" type="text/css" href="../Scripts/noty/buttons.css" />
<head runat="server">
    <title> :: Compras :: </title>
<style type="text/css">
    .divtableResponsable {
	    border:1px solid #8db2e3;
	    font-size:1em;
	    overflow:hidden;
	    text-align:center;
    }
    .styleMe{
        border:1px solid #25729a; 
        -webkit-border-radius: 3px; 
        -moz-border-radius: 3px;
        border-radius: 3px;
        font-size:12px;
        font-family:arial, helvetica, sans-serif; 
        padding: 2px; 
        text-decoration:none; 
        display:inline-block;
        text-shadow: -1px -1px 0 rgba(0,0,0,0.3);
        font-weight:bold; 
        color: #FFFFFF;
        background-color: #3093c7; 
        background-image: linear-gradient(to bottom, #3093c7, #1c5a85);
    }

    .styleMe:hover{
        border:1px solid #1c5675;
        background-color: #26759e; 
        background-image: linear-gradient(to bottom, #26759e, #133d5b);
    }
</style>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script language="javascript" type="text/javascript">
        var cell_valor
        var cell_id
        function RadGrid_RowSelected(sender, eventArgs) {
            var grid = sender;
            var MasterTable = grid.get_masterTableView();
            var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];
            cell_valor = MasterTable.getCellByColumnUniqueName(row, "codigo");
            //cell_id = eventArgs.getDataKeyValue("IngresoDetalleID");
            cell_id = MasterTable.getCellByColumnUniqueName(row, "IngresoDetalleID");
            cell_id = cell_id.innerHTML;
            cell_valor = cell_valor.innerHTML;
            //alert(cell_id);
            //alert(cell_valor);
            returnToParent();
        }
        function returnToParent() {
            //create the argument that will be returned to the parent page
            var oArg = new Object();
            //get the city's name           
            oArg.cell_valor = cell_valor;
            oArg.cell_id = cell_id;
            //get a reference to the current RadWindow
            var oWnd = GetRadWindow();
            //Close the RadWindow and send the argument to the parent page
            if (oArg.cell_valor && oArg.cell_id) {
                oWnd.close(oArg);
            }
        }
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }

        //Generar Mensaje
        function GenerarAlerta(type, texto) {
            var n = noty({
                text: texto,
                type: type,
                dismissQueue: true,
                layout: 'center',
                modal: true,
                theme: 'defaultTheme'
            });
            console.log(type + ' - ' + n.options.id);
            return n;
        }
    </script>
</telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
        <table style="width: 100%; font-size: 9pt; font-family: Arial; " >
            <tr>
                <td>
                    <dt class="divtableResponsable">
                        <table width="100%">
                            <tr>
                                <td style="text-align:right; width:10%; font-family: Arial, Helvetica, sans-serif; ">
                                    Desde&nbsp;
                                </td>
                                <td style="text-align:left; width:23%">
                                    <telerik:RadDatePicker ID="desdeRDP" Runat="server" Width="100px" 
                                        Culture="es-PE" Skin="WebBlue" >
                                        <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" Skin="WebBlue"></Calendar>
                                            <DateInput DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy" 
                                                LabelWidth="40%" >
                                            </DateInput>                                                                        
                                        <DatePopupButton ImageUrl="" HoverImageUrl="">
                                        </DatePopupButton>
                                    </telerik:RadDatePicker>
                                </td>
                                <td style="text-align:right; width:10%; font-family: Arial, Helvetica, sans-serif; ">
                                    Hasta&nbsp;
                                </td>
                                <td style="text-align:left; width:23%">
                                    <telerik:RadDatePicker ID="hastaRDP" Runat="server" Width="100px" 
                                        Culture="es-PE" Skin="WebBlue" >
                                        <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" Skin="WebBlue"></Calendar>
                                            <DateInput DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy" 
                                                LabelWidth="40%" >
                                            </DateInput>                                                                        
                                        <DatePopupButton ImageUrl="" HoverImageUrl="">
                                        </DatePopupButton>
                                    </telerik:RadDatePicker>
                                </td>
                                <td>
                                    <asp:Button ID="buscaB" runat="server" class="styleMe" Text="BUSCAR" Width="100%" Height="30px"/>
                                </td>
                            </tr>
                        </table>
                    </dt>
                </td>
            </tr>
            <tr>
                <td>
                    <telerik:RadGrid ID="RadGrid1" runat="server" Skin="WebBlue" Culture="es-ES" 
                        DataSourceID="SDS_SWACT_IngresosResumenArticulosActivos" 
                        AllowFilteringByColumn="True" AllowSorting="True" CellSpacing="0" 
                        GridLines="None">
                         <ClientSettings>
                            <Selecting CellSelectionMode="None" AllowRowSelect="True" ></Selecting>
                            <ClientEvents  OnRowSelected="RadGrid_RowSelected" />
                        </ClientSettings>
                        <MasterTableView AutoGenerateColumns="False" DataKeyNames="IngresoDetalleID" 
                            DataSourceID="SDS_SWACT_IngresosResumenArticulosActivos">
                        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                        <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn Visible="True" 
                            FilterControlAltText="Filter ExpandColumn column" Created="True">
                        <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridBoundColumn DataField="codigo" 
                                    FilterControlAltText="Filter codigo column" HeaderText="Codigo" 
                                    SortExpression="codigo" UniqueName="codigo"
                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                                    ShowFilterIcon="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="NombreFamiliaArticulo" 
                                    FilterControlAltText="Filter NombreFamiliaArticulo column" 
                                    HeaderText="Familia" SortExpression="NombreFamiliaArticulo" 
                                    UniqueName="NombreFamiliaArticulo"
                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                                    ShowFilterIcon="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="NombreSubFamilia" 
                                    FilterControlAltText="Filter NombreSubFamilia column" 
                                    HeaderText="SubFamilia" SortExpression="NombreSubFamilia" 
                                    UniqueName="NombreSubFamilia"
                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                                    ShowFilterIcon="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="NombreArticulo" 
                                    FilterControlAltText="Filter NombreArticulo column" HeaderText="Articulo" 
                                    SortExpression="NombreArticulo" UniqueName="NombreArticulo"
                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                                    ShowFilterIcon="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="NombreUnidad" 
                                    FilterControlAltText="Filter NombreUnidad column" HeaderText="Unidad" 
                                    SortExpression="NombreUnidad" UniqueName="NombreUnidad"
                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                                    ShowFilterIcon="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Cantidad" DataType="System.Double" 
                                    FilterControlAltText="Filter Cantidad column" HeaderText="Cant." 
                                    ReadOnly="True" SortExpression="Cantidad" UniqueName="Cantidad"
                                    AllowFiltering="False" DataFormatString="{0:N}">
                                    <HeaderStyle Width="50px" />
                                    <ItemStyle HorizontalAlign="Right" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="TotalS" DataType="System.Double" 
                                    FilterControlAltText="Filter TotalS column" HeaderText="Total S/." ReadOnly="True" 
                                    SortExpression="TotalS" UniqueName="TotalS"
                                    AllowFiltering="False" DataFormatString="{0:N}">
                                    <HeaderStyle Width="60px" />
                                    <ItemStyle HorizontalAlign="Right" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="TotalD" DataType="System.Double" 
                                    FilterControlAltText="Filter TotalD column" HeaderText="Total $" ReadOnly="True" 
                                    SortExpression="TotalD" UniqueName="TotalD"
                                    AllowFiltering="False" DataFormatString="{0:N}">
                                    <HeaderStyle Width="55px" />
                                    <ItemStyle HorizontalAlign="Right" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="IngresoDetalleID" DataType="System.Int32" 
                                    FilterControlAltText="Filter IngresoDetalleID column" 
                                    HeaderText="IngresoDetalleID" ReadOnly="True" SortExpression="IngresoDetalleID" 
                                    UniqueName="IngresoDetalleID"
                                    Display="false">
                                </telerik:GridBoundColumn>
                            </Columns>
                        <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                        </EditFormSettings>
                        <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                        </MasterTableView>
                        <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                        <FilterMenu EnableImageSprites="False"></FilterMenu>
                    </telerik:RadGrid>
                </td>
            </tr>
        </table>
        <asp:SqlDataSource ID="SDS_SWACT_IngresosResumenArticulosActivos" 
            runat="server" SelectCommand="SWACT_IngresosResumenArticulosActivos" 
            SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:ControlParameter ControlID="desdeRDP" DefaultValue="01/01/1999" 
                    Name="Desde" PropertyName="SelectedDate" Type="DateTime" />
                <asp:ControlParameter ControlID="hastaRDP" DefaultValue="01/01/1999" 
                    Name="Hasta" PropertyName="SelectedDate" Type="DateTime" />
                <asp:QueryStringParameter Name="EmpresaId" QueryStringField="EmpresaId" DefaultValue="0" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
            <Windows>
                <telerik:RadWindow ID="RadWindow1" runat="server" style="display:none;" VisibleStatusbar="False" 
                        ShowContentDuringLoad="False" Width="700px" Skin="WebBlue" AutoSize="true">
                </telerik:RadWindow>        
            </Windows>            
        </telerik:RadWindowManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" 
            DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="buscaB">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelCssClass="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    </form>
</body>
</html>
