<%@ Page Language="C#" AutoEventWireup="true" CodeFile="frmDistribucionporUnidadNegocio.aspx.cs"
    Inherits="frmDistribucionporUnidadNegocio" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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">
<head id="Head1" runat="server">
    <title></title>
    <link href="estilos/Estilos.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #tablaMantenimiento
        {
            width: 500px;
            margin-right: 0px;
        }
        .RadGrid_Default .rgMasterTable
        {
            border-collapse: separate;
        }
        .RadGrid_Default .rgMasterTable
        {
            font: 12px/16px "segoe ui" ,arial,sans-serif;
        }
        .RadGrid_Default .rgPager
        {
            background: #eee;
        }
        .RadGrid_Default .rgPager
        {
            cursor: default;
        }
        .RadGrid_Default .rgArrPart1
        {
            padding-right: 0;
        }
        .RadGrid_Default .rgWrap
        {
            float: left;
            padding: 0 10px;
            line-height: 22px;
            white-space: nowrap;
        }
        .RadGrid_Default .rgNumPart
        {
            padding: 0;
        }
        .RadGrid_Default .rgArrPart2
        {
            padding-left: 0;
        }
        .RadGrid_Default .rgPagerLabel
        {
            margin: 0 4px 0 0;
            vertical-align: middle;
        }
        .RadGrid_Default .rgPager .RadComboBox
        {
            margin: 0 4px 0 0;
            vertical-align: middle;
        }
        .RadComboBox_Default
        {
            vertical-align: middle;
        }
        .RadComboBox_Default
        {
            font: 12px "Segoe UI" , Arial, sans-serif;
            color: #333;
            text-align: left;
        }
        .RadComboBox_Default *
        {
            margin: 0;
            padding: 0;
        }
        .RadGrid_Default .rgInfoPart
        {
            float: right;
            color: #8a8a8a;
        }
        .RadGrid_Default .rgInfoPart strong
        {
            font-weight: normal;
            color: #4c4e54;
        }
        .style1
        {
            height: 48px;
        }
        .RadGrid_Default .rgNumPart a.rgCurrentPage
        {
            background-position: 100% -1450px;
            cursor: default;
        }
        .RadGrid_Default .rgNumPart a.rgCurrentPage
        {
            background: no-repeat url('mvwres://Telerik.Web.UI, Version=2009.2.826.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4/Telerik.Web.UI.Skins.Default.Grid.sprite.gif');
        }
        .RadGrid_Default .rgNumPart a
        {
            float: left;
            line-height: 22px;
            margin: 0;
            padding: 0 5px 0 0;
            color: #000;
            text-decoration: none;
        }
        .RadGrid_Default .rgHeader
        {
            color: #333;
            text-decoration: none;
        }
        .RadGrid_Default .rgHeader
        {
            border: 0;
            border-bottom: 1px solid #828282;
            padding-top: 5px;
            padding-bottom: 4px;
            background: #eaeaea 0 -2300px repeat-x url('mvwres://Telerik.Web.UI, Version=2009.2.826.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4/Telerik.Web.UI.Skins.Default.Grid.sprite.gif');
            text-align: left;
            font-weight: normal;
        }
        .RadGrid_Default .rgHeader
        {
            padding-left: 7px;
            padding-right: 7px;
        }
        .RadGrid_Default .rgHeader
        {
            cursor: default;
        }
        .style2
        {
            text-align: center;
        }
        .style4
        {
            width: 57px;
        }
        .style5
        {
            height: 48px;
            width: 373px;
        }
        .style7
        {
            width: 373px;
        }
        .style8
        {
            width: 57px;
            height: 4px;
        }
        .style9
        {
            height: 4px;
            width: 373px;
        }
    </style>
</head>
<body style="background-color: #FFFFFF">
    <form id="form1" runat="server">
    <div>

        <script type="text/javascript">
            function CloseAndRebind(args) {
                GetRadWindow().Close();
                GetRadWindow().BrowserWindow.refreshGrid(args);
            }

            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)

                return oWindow;
            }

            function CancelEdit() {
                GetRadWindow().Close();
            }
        </script>

        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <table id="tablaMantenimiento" runat="server" border="0" align="center" cellpadding="0"
            cellspacing="0" width="10px" style="padding-right: 7px">
            <tr>
                <td class="tablatitulo" style="background-color: #CCCCCC;">
                    <table border="0" cellspacing="0" cellpadding="0" style="width: 503px; height: 256px;">
                        <tr>
                            <td align="right" class="style8">
                            </td>
                            <td align="right" class="style9">
                            </td>
                        </tr>
                        <tr>
                            <td height="28" align="right" rowspan="2" class="style4">
                                &nbsp;
                            </td>
                            <td height="28" align="right" class="style5" rowspan="2">
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                    <ContentTemplate>
                                        <div style="background: #E0E5F5; padding: 5px; width: 350px; text-align: center;">
                                            <div style="font-size: 13px; font-weight: bold; padding-bottom: 3px; text-align: center">
                                                <div class="style2">
                                                    Distribucion
                                                </div>
                                                <telerik:RadGrid ID="GridDistribucionAreas" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                                    BorderStyle="None" CssClass="Grid_LeftAlign" GridLines="None" Height="195px"
                                                    Style="margin-top: 0px" Width="350px" OnNeedDataSource="GridDistribucionAreas_NeedDataSource"
                                                    OnItemCommand="GridDistribucionAreas_ItemCommand">
                                                    <HeaderContextMenu Skin="Inox">
                                                        <CollapseAnimation Duration="200" Type="OutQuint" />
                                                    </HeaderContextMenu>
                                                    <MasterTableView>
                                                        <Columns>
                                                            <telerik:GridBoundColumn DataField="areaId" HeaderText="areaId" UniqueName="areaId"
                                                                ReadOnly="True" AutoPostBackOnFilter="false" AllowFiltering="false" Display="false">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" ReadOnly="True"
                                                                AutoPostBackOnFilter="false" AllowFiltering="false" Display="false">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="UnidadNegocioID" HeaderText="UnidadNegocioID" UniqueName="UnidadNegocioID" ReadOnly="True" AutoPostBackOnFilter="false" AllowFiltering="false"
                                                                Display="false">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn HeaderText="Unidad de Negocio" DataField="BEUnidadesDeNegocio.NombreUnidadNegocio"
                                                                UniqueName="BEUnidadesDeNegocio.NombreUnidadNegocio" SortExpression="BEUnidadesDeNegocio.NombreUnidadNegocio"
                                                                FilterControlWidth="100%" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                                                                ShowFilterIcon="false">
                                                                <HeaderStyle Width="150px"></HeaderStyle>
                                                                <ItemStyle HorizontalAlign="Left" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridTemplateColumn HeaderText="Participacion" DataField="Participacion"
                                                                UniqueName="Participacion" SortExpression="Participacion" FilterControlWidth="100%"
                                                                AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false">
                                                                <ItemTemplate>
                                                                    <telerik:RadNumericTextBox AutoPostBack="false" OnTextChanged="txtParticipacion_Textchanged"
                                                                        MaxLength="5" ID="txtParticipacion" runat="server" Width="80px" Text='<%# DataBinder.Eval(Container, "DataItem.Participacion") %>'>
                                                                        <NegativeStyle BorderColor="Red" />
                                                                        <NumberFormat DecimalDigits="2" DecimalSeparator="." GroupSeparator="," />
                                                                    </telerik:RadNumericTextBox>
                                                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtParticipacion"
                                                                        ErrorMessage="Ingrese números positivos" Text="*" ValidationExpression="^[0-9.]{0,}$"
                                                                        SetFocusOnError="True"></asp:RegularExpressionValidator>
                                                                </ItemTemplate>
                                                                <HeaderStyle Width="100px"></HeaderStyle>
                                                                <ItemStyle HorizontalAlign="Right" />
                                                            </telerik:GridTemplateColumn>
                                                        </Columns>
                                                    </MasterTableView>
                                                    <ClientSettings EnableRowHoverStyle="true">
                                                        <Selecting AllowRowSelect="True" />
                                                        <Scrolling AllowScroll="True" SaveScrollPosition="true" />
                                                    </ClientSettings>
                                                </telerik:RadGrid>
                                            </div>
                                        </div>
                                        <span class="btn_Botones">
                                            <asp:Label ID="Label1" runat="server" ForeColor="Black" Style="text-align: center;
                                                font-size: x-small;"></asp:Label>
                                        </span>
                                        <br />
                                        <br />
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style1" height="20">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style4">
                            </td>
                            <td align="right" class="style7">
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr style="background-color: #ffffff">
                <td style="height: 40px;" valign="middle" align="right">
                    <table cellspacing="0" cellpadding="0" border="0" style="width: 119px">
                        <tr>
                            <td style="padding-right: 10px">
                                <span class="btn_Botones">
                                    <asp:Button ID="btnGuardar" runat="server" CssClass="Button" TabIndex="0" CausesValidation="true"
                                        OnClick="btnGuardar_Click" Text="Guardar" />
                                </span>
                            </td>
                            <td style="width: 40px">
                                <span class="btn_Botones">
                                    <asp:Button ID="btnVolver" runat="server" CssClass="Button" Text="Cancelar" CausesValidation="False"
                                        OnClick="btnVolver_Click" TabIndex="0" />
                                </span>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            
        </table>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
            ShowSummary="False" />
    </div>
    </form>
</body>
</html>
