<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Jurisdiction.aspx.cs" Inherits="HRMS.EBTax.Jurisdiction" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="main-panel">
        <div class="row">
            <div class="col-md-12">
                <section class="panel">                    

                    <header class="panel-heading">
                    Tax Jurisdiction
                        <div class="pull-right">
                            <asp:button text="Save" CssClass="btn btn-info" ID="btn_save" Width="120px"  ValidationGroup="save"
                                runat="server" onclick="btn_save_Click"/>
                            <asp:button text="Detail" CssClass="btn btn-info" ID="btn_create"
                                runat="server" onclick="btn_create_Click"/>
                            <asp:button text="Back" CssClass="btn btn-info" ID="btn_cancel" 
                                runat="server" onclick="btn_cancel_Click"/>                            
                        </div>
                    </header>

                    <div class="panel-body">
                            <div class="span6">
                                 <div id="divmessage" runat="server" visible="false" class="alert alert-info alert-dismissable">
                                      <asp:label text="" ID="lbl_msg" CssClass="msg" runat="server"></asp:label>
                                  </div>
                            </div>

                            <div class="span6">
                                <div id="diverrmessage" runat="server" visible="false" class="alert alert-info alert-dismissable">
                                    <asp:label text="" id="lbl_err_msg" CssClass="msg" runat="server"></asp:label>
                                </div>
                            </div>                            

                            <div class="row" style="padding-top:10px">                                
                                <asp:HiddenField ID="hid_jurd_Id" runat="server" />

                                <asp:HiddenField ID="hid_geographyname" runat="server" />                                
                                  <label class="control-label col-md-2">Tax Jurisdiction Code</label>
                                <div class="col-md-3">
                                    <asp:TextBox  CssClass="form-control" ID="txt_taxjurdcode" runat="server" ></asp:TextBox>
                                    <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_taxjurdcode" controltovalidate="txt_taxjurdcode" errormessage="Tax Jurisdiction Code is Required!" />                                                               
                                </div>
                                 <label class="col-md-2 control-label">Geography Name</label>
                                <div class="col-md-3">
                                     <div class="input-group">
                                        <asp:TextBox  CssClass="form-control" ID="txt_geographyname" runat="server" ></asp:TextBox>
                                        <%--<asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_geographyname" controltovalidate="txt_geographyname" errormessage="Geography Name is Required!" />--%>
                                        <span class="input-group-btn">
                                        <button id="btn_lov_geographyname" type="button" runat="server" class="btn btn-white" disabled="disabled" onserverclick="btn_lov_geographyname_Click"><i class="fa fa-search"></i></button>
                                        </span>
                                    </div>
                                </div>
                            </div>                                                                                                                                                                                                                                                        

                            <div class="row" style="padding-top:10px">                                
                                  <label class="control-label col-md-2">Tax Jurisdiction Name</label>
                                <div class="col-md-3">
                                    <asp:TextBox  CssClass="form-control" ID="txt_taxjurdname" runat="server" ></asp:TextBox>
                                    <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_taxjurdname" controltovalidate="txt_taxjurdname" errormessage="Tax Jurisdiction Name is Required!" />
                                </div>

                                 <label class="col-md-2 control-label"></label>
                                <div class="col-md-3 text-left" >
                                    <span class="checkbox"><input id="chkbox_innercityjurd" runat="server" type="checkbox" name="chkbox_innercityjurd"/>
                                    <label class="col-md-1 control-label" ></label>Inner City Jurisdiction</span>                                                  
                                </div>
                            </div>  
                        
                            <div class="row" style="padding-top:10px">                                
                                <asp:HiddenField ID="hid_taxregime" runat="server" />  
                                <asp:HiddenField ID="hid_taxregime_code" runat="server" /> 
                                  <label class="control-label col-md-2">Tax Regime Code</label>
                                <div class="col-md-3">
                                    <div class="input-group">
                                        <asp:TextBox  CssClass="form-control" ID="txt_taxregime" runat="server" ></asp:TextBox>
                                        <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_taxregime" controltovalidate="txt_taxregime" errormessage="Tax Regime Code is Required!" />
                                        <span class="input-group-btn">
                                        <button id="btn_lov_taxregime" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_taxregime_Click"><i class="fa fa-search"></i></button>
                                        </span>
                                    </div>                                                                                                   
                                </div>
                                 <label class="col-md-2 control-label">Precedence Level</label>
                                <div class="col-md-3">                                     
                                        <asp:TextBox  CssClass="form-control" ID="txt_precedencelevel" runat="server" onkeypress="return numbersOnly(event);" ></asp:TextBox>
                                        <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_precedencelevel" controltovalidate="txt_precedencelevel" errormessage="Precedence Level is Required!" />                                                                            
                                </div>
                             </div>

                            <div class="row" style="padding-top:10px">                                
                                <asp:HiddenField ID="hid_tax" runat="server" />
                                <asp:HiddenField ID="hid_tax_code" runat="server" />
                                <asp:HiddenField ID="hid_colltaxauth" runat="server" />                                
                                  <label class="control-label col-md-2">Tax</label>
                                <div class="col-md-3">
                                    <div class="input-group">
                                        <asp:TextBox  CssClass="form-control" ID="txt_tax" runat="server" ></asp:TextBox>
                                        <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_tax" controltovalidate="txt_tax" errormessage="Tax is Required!" />
                                        <span class="input-group-btn">
                                        <button id="btn_lov_tax" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_tax_Click"><i class="fa fa-search"></i></button>
                                        </span>
                                    </div>                                                               
                                </div>
                                 <label class="col-md-2 control-label">Collecting Tax Authority</label>
                                <div class="col-md-3">
                                     <div class="input-group">
                                        <asp:TextBox  CssClass="form-control" ID="txt_colltaxauth" runat="server" ></asp:TextBox>
                                        <%--<asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_colltaxauth" controltovalidate="txt_colltaxauth" errormessage="Collection Tax Authority is Required!" />--%>
                                        <span class="input-group-btn">
                                        <button id="btn_lov_colltaxauth" type="button" runat="server" class="btn btn-white" disabled="disabled" onserverclick="btn_lov_colltaxauth_Click"><i class="fa fa-search"></i></button>
                                        </span>
                                    </div>
                                </div>
                             </div>

                            <div class="row" style="padding-top:10px">                                
                                <asp:HiddenField ID="hid_goegraphytype" runat="server" />
                                <asp:HiddenField ID="hid_repttaxauth" runat="server" />                                
                                  <label class="control-label col-md-2">Geography Type</label>
                                <div class="col-md-3">
                                    <div class="input-group">
                                        <asp:TextBox  CssClass="form-control" ID="txt_goegraphytype" runat="server" ></asp:TextBox>
                                        <%--<asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_goegraphytype" controltovalidate="txt_goegraphytype" errormessage="Geography Type is Required!" />--%>
                                        <span class="input-group-btn">
                                        <button id="btn_lov_goegraphytype" type="button" runat="server" class="btn btn-white" disabled="disabled" onserverclick="btn_lov_goegraphytype_Click"><i class="fa fa-search"></i></button>
                                        </span>
                                    </div>                                                               
                                </div>
                                 <label class="col-md-2 control-label">Reporting Tax Authority</label>
                                <div class="col-md-3">
                                     <div class="input-group">
                                        <asp:TextBox  CssClass="form-control" ID="tax_repttaxauth" runat="server" ></asp:TextBox>
                                        <%--<asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_repttaxauth" controltovalidate="tax_repttaxauth" errormessage="Reporting Tax Authority is Required!" />--%>
                                        <span class="input-group-btn">
                                        <button id="btn_lov_repttaxauth" type="button" runat="server" class="btn btn-white" disabled="disabled" onserverclick="btn_lov_repttaxauth_Click"><i class="fa fa-search"></i></button>
                                        </span>
                                    </div>
                                </div>
                             </div>

                            <div class="row" style="padding-top:10px">                                
                                <asp:HiddenField ID="hid_parentgeographytype" runat="server" />                                                                
                                  <label class="control-label col-md-2">Parent Geography Type</label>
                                <div class="col-md-3">
                                    <div class="input-group">
                                        <asp:TextBox  CssClass="form-control" ID="txt_parentgeographytype" runat="server" ></asp:TextBox>
                                        <%--<asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_parentgeographytype" controltovalidate="hid_parentgeographytype" errormessage="Parent Geography Type is Required!" />--%>
                                        <span class="input-group-btn">
                                        <button id="btn_lov_parentgeographytype" type="button" runat="server" disabled="disabled" class="btn btn-white" onserverclick="btn_lov_parentgeographytype_Click"><i class="fa fa-search"></i></button>
                                        </span>
                                    </div>                                                               
                                </div>
                                 <label class="col-md-2 control-label"></label>
                                <div class="col-md-3 text-left" >
                                    <span class="checkbox"><input id="chkbox_setasdefaulttaxjurd" runat="server" type="checkbox" name="chkbox_setasdefaulttaxjurd"/>
                                    <label class="col-md-1 control-label" ></label>Set as default Tax Jurisdiction</span>                                                  
                                </div>
                             </div>

                            <div class="row" style="padding-top:10px">                                                                
                                <asp:HiddenField ID="hid_parentgeographyname" runat="server" />                                                                  
                                 <label class="col-md-2 control-label">Parent Geography Name</label>
                                <div class="col-md-3">
                                     <div class="input-group">
                                        <asp:TextBox  CssClass="form-control" ID="txt_parentgeographyname" runat="server" ></asp:TextBox>
                                        <%--<asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_parentgeographyname" controltovalidate="txt_parentgeographyname" errormessage="Parent Geography Name is Required!" />--%>
                                        <span class="input-group-btn">
                                        <button id="btn_lov_parentgeographyname" type="button" runat="server" disabled="disabled" class="btn btn-white" onserverclick="btn_lov_parentgeographyname_Click"><i class="fa fa-search"></i></button>
                                        </span>
                                    </div>
                                </div>
                                  <label class="control-label col-md-2"></label>
                                <div class="col-md-3">                                                                                                   
                                </div>
                             </div>

                            <div class="row" style="padding-top:10px">                                                                                                                                  
                                 <label class="col-md-2 control-label">Effective From</label>
                                <div class="col-md-3">
                                    <asp:TextBox ID="txt_effectivefrom" runat="server" CssClass="form-control datetime"></asp:TextBox>
                                    <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_effectivefrom" controltovalidate="txt_effectivefrom" errormessage="Effective From is Required!" />
                                </div>
                                  <label class="control-label col-md-2">Effective To</label>
                                 <div class="col-md-3">
                                    <asp:TextBox ID="txt_effectiveto" runat="server" CssClass="form-control datetime"></asp:TextBox>
                                    <%--<asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_effectiveto" controltovalidate="txt_effectiveto" errormessage="Effective To is Required!" />--%>
                                </div>
                             </div>  
                        
                            <hr />

                            <div class="">
                                <asp:GridView ID="GridView1" CssClass="display" CellPadding="0" Border="0" 
                                AutoGenerateColumns="false" runat="server" onrowcommand="GridView1_RowCommand">
                                    <Columns>
                                        <asp:BoundField DataField="TAX_REGIME_NAME" HeaderText="Tax Regime" />
                                        <asp:BoundField DataField="TAX_NAME" HeaderText="Tax Name" />
                                        <asp:BoundField DataField="TAX_STATUS_NAME" HeaderText="Tax Status" />    
                                        <asp:BoundField DataField="TAX_JURISDICTION_NAME" HeaderText="Tax Jurisdiction" /> 
                                        <asp:BoundField DataField="EFFECTIVE_FROM" HeaderText="Effective From" />
                                        <asp:BoundField DataField="EFFECTIVE_TO" HeaderText="Effective" />

                                        <asp:TemplateField HeaderText="Action">
                                            <ItemTemplate>
                                                <asp:HiddenField ID="hid_jurisdiction_Id" runat="server" Value='<%#Bind("TAX_JURISDICTION_ID")%>' />
                                                <asp:HiddenField ID="hid_jurdtaxrate_Id" runat="server" Value='<%#Bind("TAX_RATE_ID")%>' />
                                                <asp:HiddenField ID="hid_taxregime_Id" runat="server" Value='<%#Bind("TAX_REGIME_ID")%>' />
                                                <asp:HiddenField ID="hid_tax_Id" runat="server" Value='<%#Bind("Tax_ID")%>' />
                                                <asp:HiddenField ID="hid_taxstatus_Id" runat="server" Value='<%#Bind("TAX_STATUS_ID")%>' />
                                                <asp:LinkButton ID="lnk_edit" CausesValidation="false" CommandName="gedit" runat="server"><i class="fa fa-pencil" style="font-size:20px !important"></i></asp:LinkButton>
                                                <asp:LinkButton ID="lnk_dlt" CausesValidation="false" CommandName="gdlt" OnClientClick="return confirm('Are you sure to delete?')" runat="server"><i class="fa fa-trash" style="font-size:20px !important"></i></asp:LinkButton>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                        <FooterStyle CssClass="footerStyle" />
                                        <HeaderStyle CssClass="headerStyle" />
                                        <RowStyle CssClass="rowStyle" />
                                </asp:GridView>
                                <script src="/ThemeScrips/Datatables/media/js/jquery.js" type="text/javascript"></script>
                                     <script src="/ThemeScrips/Datatables/media/js/jquery.datatables.min.js" type="text/javascript"></script>
                                     <script src="/ThemeScrips/Datatables/media/js/jquery.Datatables.js" type="text/javascript"></script>
                                     <script src="/ThemeScrips/Datatables/media/js/GridviewFix.js" type="text/javascript"></script>
                                     <script type="text/javascript">
                                         $("#ContentPlaceHolder1_GridView1").GridviewFix().dataTable();
                                </script>
                            </div>

                            <hr />

                            <div class="row">
                                <asp:Label CssClass="control-label col-md-offset-2" ID="lbl_due" runat="server"></asp:Label>
                            </div>

                    </div>
                </section>
            </div>
        </div>
    </div>
</asp:Content>
