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

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/ControlUsuario/pl_pie.ascx" TagName="pl_pie" TagPrefix="uc1" %>

<!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">
    <link rel="Shortcut Icon" href="images/ico.ico"> 
    <title id="Titulo" runat="server"></title>
    <link href="estilos/Estilos.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript" src="JavaScript/actb.js"></script>
    <script language="javascript" type="text/javascript" src="JavaScript/common.js"></script>



<script language="javascript">
    function ShowScreen() 
    {
        //alert(screen.width);
        document.getElementById("hidWidth").value = screen.width;
        //document.forms[0].t1.value = screen.width;
//        document.t.t2.value = screen.height;
//        document.t.t3.value = screen.colorDepth;
//        document.t.t4.value = screen.pixelDepth;
//        document.t.t5.value = screen.availWidth;
//        document.t.t6.value = screen.availHeight;
    }
    


</script>

</head>
<body onload="ShowScreen()">
    <form id="form1" runat="server" method="post" defaultfocus="txtUsuario">
    
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
      
      <asp:HiddenField ID="hidWidth" Visible="true" runat="server" />
      
      <table  style="height:555px; width:100%" cellpadding="0" cellspacing="0" border="0">
      <tr>
        <td align="center" valign="middle" >
          <table width="780" cellpadding="0" cellspacing="0" border="0" style="height:435px; background-image:url('images/fondo_login.gif'); border:#126A82 1px solid">
            <tr>
              <td colspan="2" style="height:7px" bgcolor="#FFFFFF"></td>
            </tr>
            <tr>
              <td colspan="2" style="height:20px" bgcolor="#ECF4FF"></td>
            </tr>
            <tr>
              <td align="center" colspan="2" style="height:10px">
                <table width="95%" cellpadding="0" cellspacing="0" border="0">
                  <tr>
                    <td align="left" style="height: 18px">
                      
                      <asp:Image ID="imgLogo"  runat="server" align="left" />
                    </td>
                    <td align="right" valign="middle" >
                     
                      <asp:Image ID="imgLogoEmpresa"  runat="server" />
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
            <tr>
              <td style="width:300px; ">&nbsp;</td>
              <td valign="bottom" align="center" style="width:485px">
                <table  cellpadding="0" cellspacing="0" border="0" width="77%">
                  <tr>
                    <td style="height:30px" class="Titulo">
                        <asp:Label ID="lblTitulo" runat="server" Text="Identificación"></asp:Label>
                        &nbsp;
                    </td>
                  </tr>
                  <tr>
                    <%--<td valign="bottom"><img alt="" src="images/login_up.gif" width="238" height="22" /></td>--%>
                      <td valign="bottom"><img alt="" src="images/login_up.gif" width="500" height="22" />
                  </tr>
                  <tr>
                    <td style="background-image:url('images/login_cuerpo.gif');">
                    <asp:UpdatePanel ID="up_login" runat="server">
                    <Triggers>
                      <asp:PostBackTrigger ControlID="imgIngresar" />
                    </Triggers>
                    <ContentTemplate>

                      <table cellpadding="1" id="tblLoggin" runat="server" cellspacing="0" border="0" style="width:100%">
                        <tr>
                          <td align="right" class="arial10px" style="width:84px">
                            <strong>Usuario :</strong>
                          </td>
                          <td class="llancay" style="width:65%">
                            <asp:TextBox ID="txtUsuario"  autocomplete="on" runat="server" Width="100px" MaxLength="30" 
                                  CssClass="cajaformulario" ValidationGroup="Loggin"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtUsuario"
                              CssClass="arial10px" ErrorMessage="Ingrese su usuario" 
                                  ValidationGroup="Loggin" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                          <td align="right" class="arial10px" style="width:84px">
                            <strong>Contraseña :</strong>
                          </td>
                          <td class="llancay" style="width:65%">
                            <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" Width="104px" 
                                  CssClass="cajaformulario" EnableViewState="False" 
                                  ValidationGroup="Loggin"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtPassword"
                              CssClass="arial10px" ErrorMessage="Ingrese su contraseña" 
                                  ValidationGroup="Loggin" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                          <td align="center" valign="middle" colspan="2">
                            <asp:Label ID="lblMensaje" runat="server" Text="" CssClass="arial10px" ForeColor="red"></asp:Label>
                          </td>
                        </tr>
                        <tr>
                          <td valign="baseline" align="right" colspan="2">
                            <asp:ImageButton ID="imgIngresar" runat="server" 
                                  ImageUrl="~/images/botones/ACCEDER.png" onclick="imgIngresar_Click1" 
                                  ValidationGroup="Loggin" />
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          </td>
                        </tr>
                      </table>
                     
                     </ContentTemplate>
                     </asp:UpdatePanel>

                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                      <table cellpadding="1" id="tblControlPeriodo" runat="server" cellspacing="0" border="0" style="width:100%">
                        <tr>
                          <td align="right" style="width:20%" class="style1"><asp:Label id="Empresa" runat="server" Text="Empresa" /> :</td>
                          <td class="llancay" align="left" style="width:80%" >
                           
                            <telerik:RadComboBox ID="cbxEmpresa" runat="server" Width="90%"
                                            EmptyMessage="Seleccione..." DropDownWidth="350px"
                                            Skin="Outlook" onitemsrequested="cbxEmpresa_ItemsRequested" 
                                  onselectedindexchanged="cbxEmpresa_SelectedIndexChanged" Culture="Spanish (Spain)" 
                                  DataSourceID="SqlDataSource_Listar_Establecimientos" 
                                  DataTextField="NombreMostrarCombo" DataValueField="EstablecimientoID" 
                                  AutoPostBack="True" >                                                    
                          </telerik:RadComboBox>
                              <asp:SqlDataSource ID="SqlDataSource_Listar_Establecimientos" runat="server" 
                                  ConnectionString="<%$ ConnectionStrings:SHIOL_CONTA_BTHConnectionString %>" 
                                  SelectCommand="SCP_Listar_Establecimientos" SelectCommandType="StoredProcedure">
                              </asp:SqlDataSource>
                              <asp:CompareValidator ID="cvEmpresa" runat="server" 
                                  CssClass="arial10px" ErrorMessage="" 
                                  ValueToCompare="Seleccione..." ControlToValidate="cbxEmpresa" Operator="NotEqual" 
                                  ValidationGroup="CtrlPeriodo" SetFocusOnError="True">*</asp:CompareValidator>
                              &nbsp;
                            </td>
                        </tr>
                        <tr>
                          <td align="right" class="style1"><asp:Label id="Hotel" runat="server" Text="Hotel" /> : </td>
                          <td class="llancay" align="left" >
                            <telerik:RadComboBox ID="cbxHotel" runat="server" Width="90%" DropDownWidth="350px"
                                EmptyMessage="Seleccione..." 
                                Skin="Outlook" AllowCustomText="True" AppendDataBoundItems="True" >                                                    
                                
                          </telerik:RadComboBox>
                              <asp:CompareValidator ID="cvHotel" runat="server" 
                                  CssClass="arial10px" ErrorMessage=""
                                  ValueToCompare="Seleccione..." ControlToValidate="cbxHotel" Operator="NotEqual" 
                                  ValidationGroup="CtrlPeriodo" SetFocusOnError="True">*</asp:CompareValidator>
                              &nbsp;
                                                                                 

                            </td>
                        </tr>
                        <tr>
                          <td align="right" class="style1">
                            Periodo :
                          </td>
                          <td class="llancay" align="left" >
                             <asp:TextBox ID="txtPeriodo"  autocomplete="off"  runat="server" 
                                  TextMode="SingleLine" Width="108px"  
                                  CssClass="cajaformulario" EnableViewState="False" 
                                  ValidationGroup="CtrlPeriodo" MaxLength="4"></asp:TextBox>
                         
                         <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server"
                            TargetControlID="txtPeriodo"  FilterType="Numbers" ValidChars="+-=/*().">
                            </cc1:FilteredTextBoxExtender>
                         
                            <script>
                                var CotrolPeriodo = new Array(<% Response.Write(strAutocompletar); %>);
                                var obj = actb(document.getElementById('txtPeriodo'), CotrolPeriodo);
                            </script> 
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtPeriodo"
                              CssClass="arial10px" ErrorMessage="Ingrese Periodo." 
                                  ValidationGroup="CtrlPeriodo" SetFocusOnError="True">*</asp:RequiredFieldValidator>
                                                     

                            </td>
                        </tr>
                        
                        <tr>
                          <td valign="baseline" align="right" colspan="2">
                            <asp:ImageButton ID="imgEntrar" runat="server" 
                                  ImageUrl="~/images/botones/btnEntrar.png" 
                                  onclick="imgEntrar_Click" ValidationGroup="CtrlPeriodo" />
                                  
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                  
                          </td>
                        </tr>
                      </table>
                     </ContentTemplate>
                     <Triggers>
                     <asp:PostBackTrigger ControlID="cbxEmpresa"/>
                     </Triggers>
                     </asp:UpdatePanel>
                      
                      
                      
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>

                      
                      <table cellpadding="1" id="tblCreaPeriodos" runat="server" cellspacing="0" border="0" style="width:225px">
                        <tr>
                          <td align="center"  class="style2" colspan="2">
                            <strong>El periodo al cual esta deseando ingresar no esta creado.<br /><br />
                            Desea crearlo ahora?
                            </strong>
                          </td>
                        </tr>
                                            
                        <tr>
                          <td align="right" class="style2">
                              <asp:Button ID="btnAceptar" runat="server" CssClass="btn_Botones" 
                                  onclick="btnAceptar_Click" Text="Crear" />
                          </td>
                          <td class="llancay">
                              <asp:Button ID="btnCancelar" runat="server" CssClass="btn_Botones" 
                                  onclick="btnCancelar_Click" Text="Cancelar" />
                            </td>
                        </tr>
                        </table>
                      
                      </ContentTemplate>
                      </asp:UpdatePanel>
                    </td>
                  </tr>
                  <tr>
                    <td>
                      <img alt="" src="images/login_bottom.gif" width="500" height="21" />
                    </td>
                  </tr>
                </table>

              
              </td>
            </tr>
            <tr>
              <td colspan="2" style="height:40px">
                  
                  <uc1:pl_pie ID="pl_pie1" runat="server" />
                  
              </td>
            </tr>
          </table>
        </td>
      </tr>
      </table>
      
      <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
        ShowSummary="False" ValidationGroup="Loggin" />
        
      <asp:ValidationSummary ID="ValidationSummary2" runat="server" ShowMessageBox="True"
        ShowSummary="False" ValidationGroup="CtrlPeriodo" />       

        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        </telerik:RadAjaxManager>
    </form>
    
   
 
</body>
</html>
