<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Req_Distribution.aspx.cs" Inherits="HRMS.Purcahsing.Req_Distribution" %>

<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">
                        Distribution
                        <div class="pull-right">
                            <asp:Button ID="btn_bck" runat="server" CssClass="btn btn-info" Text="Back" OnClick="btn_bck_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>



                        <ul class="nav nav-tabs" id="myTabs">
                            <li class="active"><a data-toggle="tab" id="acc_click" href="#Line" aria-expanded="true">Accounts</a></li>
                            <li><a data-toggle="tab" href="#project" aria-expanded="true">Project</a></li>
                        </ul>

                        <div class="tab-content">
                            <div id="Line" class="tab-pane fade active in">
                                <br>

                                <div style="width: 102%; height: 250px; overflow: scroll">
                                    <asp:HiddenField ID="hid_req_line" runat="server" />
                                    <asp:GridView ID="Grd_Dist" runat="server" AutoGenerateColumns="False"
                                        CssClass="table table-striped table-bordered table-hover" CellPadding="0" OnRowCommand="Grd_Dist_RowCommand">
                                        <Columns>
                                            <asp:TemplateField HeaderText="Number" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_dist" runat="server" Value='<%#Bind("DISTRIBUTION_ID") %>' />
                                                    <asp:TextBox CssClass="form-control" ID="txt_line_Number" Enabled="false"
                                                        runat="server">
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Quantity" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_qty" runat="server" Enabled="false" Text='<%# HRMS.Global.Decrypt(Request.QueryString["qty"]+"") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Charge Account" ControlStyle-Width="220px" ItemStyle-Width="220px">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_chrg_acc" runat="server" />
                                                    <div class="input-group">
                                                        <asp:TextBox CssClass="form-control" ID="txt_chrg_acc" runat="server"></asp:TextBox>

                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_chrg_acc" type="button" runat="server" class="btn btn-white">
                                                                <i class="fa fa-search"></i>
                                                            </button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>



                                            <asp:TemplateField HeaderText="Recovery Rate" ControlStyle-Width="120px" ItemStyle-Width="120px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" Text='<%# Bind("RECOVERY_RATE") %>' ID="txt_rcvry_rt" runat="server"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="GL Date" ControlStyle-Width="110px" ItemStyle-Width="110px">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_gl_dt" Text='<%#Bind("GL_ENCUMBERED_DATE") %>' runat="server" CssClass="form-control datetime"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Budget Account" ControlStyle-Width="180px" ItemStyle-Width="180px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_bdgt_acc" runat="server"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Accrual Account" ControlStyle-Width="220px" ItemStyle-Width="220px">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        <asp:HiddenField ID="hid_accrual" Value='<%#Bind("ACCRUAL_ACCOUNT_ID") %>' runat="server" />
                                                        <asp:TextBox CssClass="form-control" ID="txt_accrual" Text='<%#Bind("ACCRUAL_ACCOUNT_DESC") %>' runat="server"></asp:TextBox>

                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_accrual" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_accrual_ServerClick">
                                                                <i class="fa fa-search"></i>
                                                            </button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>



                                            <asp:TemplateField HeaderText="Variance Account" ControlStyle-Width="220px" ItemStyle-Width="220px">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        <asp:HiddenField ID="hid_variance" Value='<%#Bind("VARIANCE_ACCOUNT_ID") %>' runat="server" />
                                                        <asp:TextBox CssClass="form-control" ID="txt_variance" Text='<%#Bind("VARIANCE_ACCOUNT_DESC") %>' runat="server"></asp:TextBox>

                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_variance" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_variance_ServerClick">
                                                                <i class="fa fa-search"></i>
                                                            </button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>



                                            <asp:TemplateField HeaderText="Reserved" ControlStyle-Width="50px" ItemStyle-Width="50px">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chk_rsvrd" runat="server" CssClass="checkbox" />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Action" ItemStyle-Width="5%">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="linkedit" runat="server" Visible="false"
                                                        CommandName="gEdit"><i class="fa fa-pencil"
                                                            style="font-size:20px !important;"></i>
                                                    </asp:LinkButton>
                                                    <asp:LinkButton ID="lnk_add"
                                                        runat="server" CommandName="gadd"><i class="fa fa-plus"
                                                            style="font-size:20px !important;"></i>
                                                    </asp:LinkButton>
                                                    <asp:LinkButton ID="linkdlt" CausesValidation="false"
                                                        CommandName="gDelete" runat="server"
                                                        OnClientClick="return confirm('Are you sure to delete?')">
                                                        <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>
                                </div>
                            </div>



                            <div id="project" class="tab-pane fade">
                                <br />
                                <div style="width: 102%; height: 250px; overflow: scroll">
                                    <asp:GridView ID="Grd_Project" runat="server" AutoGenerateColumns="False"
                                        CssClass="table table-striped table-bordered table-hover" CellPadding="0" OnRowCommand="Grd_Project_RowCommand" OnRowDataBound="Grd_Project_RowDataBound">
                                        <Columns>
                                            <asp:TemplateField HeaderText="Number" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_projct" runat="server" Value='<%#Bind("DISTRIBUTION_ID") %>' />
                                                    <asp:TextBox CssClass="form-control" ID="txt_line_Number" Enabled="false"
                                                        runat="server">
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Project" ControlStyle-Width="150px" ItemStyle-Width="150px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_proj" runat="server" Text='<%#Bind("PROJECT_ID") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Task" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_tsk" Text='<%#Bind("TASK_ID") %>' runat="server"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>



                                            <asp:TemplateField HeaderText="Type" ControlStyle-Width="150px" ItemStyle-Width="150px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" Text='<%# Bind("EXPENDITURE_TYPE") %>' ID="txt_type" runat="server"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Organization" ControlStyle-Width="200px" ItemStyle-Width="200px">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_org" runat="server" Value='<%#Bind("EXPENDITURE_ORGANIZATION_ID") %>' />
                                                    <asp:DropDownList ID="ddl_org" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Date" ControlStyle-Width="150px" ItemStyle-Width="150px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control datetime" Text='<%#Bind("EXPENDITURE_ITEM_DATE") %>' ID="txt_date" runat="server"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Quantity" ControlStyle-Width="150px" ItemStyle-Width="150px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_qty" Text='<%#Bind("REQ_LINE_QUANTITY") %>' runat="server"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>



                                            <asp:TemplateField HeaderText="Contract Line Number" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" Enabled="false" ID="txt_contract_line_num" runat="server"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>



                                            <asp:TemplateField HeaderText="Deliverable Number" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" Enabled="false" ID="txt_dlvr_num" runat="server"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Unit Number" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" Enabled="false" ID="txt_unit_num" runat="server"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Action" ItemStyle-Width="5%">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="linkedit" runat="server" Visible="false"
                                                        CommandName="gEdit"><i class="fa fa-pencil"
                                                            style="font-size:20px !important;"></i>
                                                    </asp:LinkButton>
                                                    <asp:LinkButton ID="lnk_add"
                                                        runat="server" CommandName="gadd"><i class="fa fa-plus"
                                                            style="font-size:20px !important;"></i>
                                                    </asp:LinkButton>
                                                    <asp:LinkButton ID="linkdlt" CausesValidation="false"
                                                        CommandName="gDelete" runat="server"
                                                        OnClientClick="return confirm('Are you sure to delete?')">
                                                        <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>
                                </div>
                            </div>
                        </div>

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