<%@ Page Title="Journal Voucher" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="JournalVoucher.aspx.cs" Inherits="ZFJINV.Accounts.JournalVoucher" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div class="row">
        <div class="col-md-12 mySpace">
            <asp:UpdatePanel runat="server">
                <ContentTemplate>
                    <div class="caption cap">
                        <span class="caption-subject font-blue sbold" style="font-size: 150%;">Journal Voucher </span>
                       <%-- <div class="pull-right">
                            <button type="button" class="btn btn-success" disabled="disabled" style="height: 28px;">saved</button>
                        </div>--%>

                        <div class="btn-group pull-right" style="padding-top:5px;" >


                           <img src="../assets/global/img/gridicons/addgrid.png" />
                        <asp:LinkButton ID="lblAdd" Text="Add" runat="server" class="imgCss" OnClick="Add"></asp:LinkButton>

                        <img src="../assets/global/img/gridicons/gridsearch.png" />
                        <asp:LinkButton ID="lblFind" Text="Find" runat="server" class="imgCss" OnClick="Find" ></asp:LinkButton>

                        <img src="../assets/global/img/gridicons/editgrid.png" />
                        <asp:LinkButton ID="lblEdit" Text="Edit" runat="server" class="imgCss" OnClick="Edit"></asp:LinkButton>

                         <img src="../assets/global/img/gridicons/previous.png"/>
                        <asp:LinkButton ID="lblFirst" Text="First" runat="server" class="imgCss" OnClick="First"></asp:LinkButton>

                        <img src="../assets/global/img/gridicons/first.png" />
                        <asp:LinkButton ID="lblNext" Text="Next" runat="server" class="imgCss" OnClick="Next"></asp:LinkButton>

                        <img src="../assets/global/img/gridicons/last.png" class="imgCss" />
                        <asp:LinkButton ID="lblPrevious" Text="Previous" runat="server" OnClick="Previous"></asp:LinkButton>
                      
                        <img src="../assets/global/img/gridicons/next.png" class="imgCss" />
                        <asp:LinkButton ID="lblLast" Text="Last" runat="server" OnClick="Last"></asp:LinkButton>        
                        </div>
                    </div>
                    <div class="ui segment">
                        <div class="ui stackable form">

                            <div class="col-md-3">
                                <label class="lbStyle">JV ID:</label>
                                <asp:TextBox ID="txtJVID" AutoPostBack="True" OnTextChanged="txtJVID_TextChanged" CssClass="myInput" runat="server" title="Journal Voucher ID"></asp:TextBox>
                            </div>

                            <div class="col-md-3">
                                <label class="lbStyle">JV Date:</label>
                                <asp:TextBox ID="txtJVDate" runat="server" class="date-picker myInput" title="JV Date"></asp:TextBox>
                            </div>


                            <div class="col-md-3">
                                <label class="lbStyle">Narration:</label>
                                <asp:TextBox ID="txtNarrataion" CssClass="myInput" runat="server" title="Journal Voucher ID"></asp:TextBox>
                            </div>

                               <div class="col-md-3">

                                <label class="lbStyle">JV Type:</label>
                                <asp:DropDownList ID="txtJVType" runat="server" class="select2 form-control "></asp:DropDownList>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4"
                                    ControlToValidate="txtJVType"
                                    ValidationGroup="formValidation"
                                    ErrorMessage="Required Field" CssClass="message"
                                    runat="Server">
                                </asp:RequiredFieldValidator>

                            </div>


<%--                            <div class="col-md-3">
                                <label class="lbStyle">JV Type:</label>
                                <asp:DropDownList ID="txtJVType" runat="server" class="select2 form-control " required="required"></asp:DropDownList>
                            </div>--%>

                            <div class="row">
                            </div>
                        </div>
                    </div>

                    <%--<asp:ScriptManager runat="server">
            </asp:ScriptManager>--%>

                    <div class="rounded-corners">
                        <div style="width: 100%; overflow: auto;">



                            <asp:GridView ID="grdJV" ShowHeaderWhenEmpty="True" DataKeyNames="VoucherID"
                                GridLines="Horizontal" BorderColor="WhiteSmoke" RowStyle-Wrap="false"
                                HeaderStyle-Wrap="false" RowStyle-BorderColor="#e8e8ec"
                                CssClass="uimy ui table" runat="server" AutoGenerateColumns="False"
                                ShowFooter="True"
                                OnRowCommand="grdJV_RowCommand" AllowPaging="true"
                                OnPageIndexChanging="grdJV_PageIndexChanging"
                                OnRowEditing="grdJV_RowEditing"
                                OnRowUpdating="grdJV_RowUpdating"
                                OnRowCancelingEdit="grdJV_RowCancelingEdit"
                                OnRowDataBound="grdJV_RowDataBound"
                                OnRowDeleted ="grdJV_RowDeleted"
                                
                                PageSize="10"
                                PagerStyle="pagination-ys">

                                <Columns>

                                    <asp:TemplateField HeaderText="Voucher ID" InsertVisible="False" Visible="False" SortExpression="Voucher ID">
                                        <EditItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("VoucherID") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("VoucherID") %>'></asp:Label>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:TextBox ID="txtVoucherID" CssClass="myInput1" runat="server"></asp:TextBox>
                                        </FooterTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Code" InsertVisible="False" SortExpression="Code" HeaderStyle-CssClass="gridView2" ItemStyle-CssClass="gridviewBody1" FooterStyle-CssClass="FooterStyle2">
                                        <EditItemTemplate>
                                            <asp:Label ID="Code" Text='<%# Eval("Code") %>' required="required" runat="server"></asp:Label>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label16" Text='<%# Eval("Code") %>' runat="server"></asp:Label>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:TextBox ID="txtCode" Enabled="false" CssClass="itemCode" required="required" AppendDataBoundItems="true" runat="server"></asp:TextBox>
                                        </FooterTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Account Name" InsertVisible="False" SortExpression="Name" HeaderStyle-CssClass="gridView2" ItemStyle-CssClass="gridviewBody1" FooterStyle-CssClass="FooterStyle2">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="txtName" Text='<%# Eval("AccountName") %>' OnSelectedIndexChanged="txtName_SelectedIndexChanged1" CssClass="select2 form-control gvModel" AutoPostBack="True" required="required" AppendDataBoundItems="true" runat="server"></asp:DropDownList>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label6" Text='<%# Eval("AccountName") %>' runat="server"></asp:Label>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:DropDownList ID="txtName" OnSelectedIndexChanged="txtName_SelectedIndexChanged" CssClass="select2 form-control gvModel" AutoPostBack="True" required="required" AppendDataBoundItems="true" runat="server"></asp:DropDownList>
                                        </FooterTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Debit" InsertVisible="False" SortExpression="Debit" HeaderStyle-CssClass="gridViewModel" ItemStyle-CssClass="gridviewBody1" FooterStyle-CssClass="FooterStyle">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtDebit" Text='<%# Bind("DebitAmount") %>' CssClass="Quatntity" runat="server" required="required"></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label12" runat="server" Text='<%# Bind("DebitAmount") %>'></asp:Label>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:TextBox ID="txtDebit" CssClass="Quatntity" runat="server" required="required"></asp:TextBox>
                                        </FooterTemplate>

                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Credit" InsertVisible="False" SortExpression="Credit" HeaderStyle-CssClass="gridViewModel" ItemStyle-CssClass="gridviewBody1" FooterStyle-CssClass="FooterStyle">
                                        <EditItemTemplate>
                                            <asp:Label ID="Label13" runat="server" Text='<%# Eval("CreditAmount") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label14" runat="server" Text='<%# Bind("CreditAmount") %>'></asp:Label>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:TextBox ID="txtCredit" Enabled="true" CssClass="Amount" runat="server" required="required"></asp:TextBox>
                                        </FooterTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Action" InsertVisible="False" SortExpression="Action" HeaderStyle-CssClass="gridView2" ItemStyle-CssClass="gridviewBody1" FooterStyle-CssClass="FooterStyle">
                                        <ItemTemplate>
                                            <%--<asp:ImageButton ID="lblEdit" ToolTip="Edit" OnClick="lblEdit_OnClick" CommandArgument='<%# Eval("POID") %>' formnovalidate="formnovalidate" ImageUrl="~/assets/global/img/edit.png" runat="server" CommandName="EditRow" />--%>
                                            <asp:Button CssClass="small ui button red" Text="Delete" ID="lblDelete" ToolTip="Delete" CommandArgument='<%# Eval("VoucherID") %>' formnovalidate="formnovalidate" ImageUrl="~/assets/global/img/deletee.pngg" runat="server" CommandName="DeleteRow" />

                                            <%--<asp:LinkButton ID="lblEdit" CommandArgument='<%# Eval("POID") %>' CommandName="EditRow" runat="server">Edit</asp:LinkButton>--%>
                                            <%--<asp:LinkButton ID="lblDelete" CommandArgument='<%# Eval("POID") %>' CommandName="DeleteRow" runat="server">Delete</asp:LinkButton>--%>
                                        </ItemTemplate>

                                        <EditItemTemplate>
                                            <%--<asp:ImageButton ID="lblUpdate" CommandArgument='<%# Eval("POID") %>' ImageUrl="~/assets/global/img/update.png" runat="server" CommandName="UpdateRow"/>--%>
                                            <%--<asp:ImageButton ID="lblCancel" CommandArgument='<%# Eval("POID") %>' ImageUrl="~/assets/global/img/cancle.png" runat="server" CommandName="CancelRow"/>--%>
                                            <%--<asp:LinkButton ID="lblUpdate" ToolTip="Update" CommandArgument='<%# Eval("POID") %>' CommandName="UpdateRow" runat="server">Update</asp:LinkButton>--%>
                                            <%--<asp:LinkButton ID="lblCancel" ToolTip="Cancel" CommandArgument='<%# Eval("POID") %>' CommandName="CancelRow" OnClick="lblCancel_OnClick" runat="server">Cancel</asp:LinkButton>--%>
                                        </EditItemTemplate>
                                        <FooterTemplate>
                                            <asp:Button ID="lblSave" CommandName="InsertRow" formnovalidate="formnovalidate" CssClass="small ui button blue" Text="Add" runat="server"></asp:Button>
                                        </FooterTemplate>

                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </div>

                    </div>
                    <div class="ui segment col-md-5" style="border-color: #AAB7B8;">
                           <div class="col-md-12">
                            <div class="messagealert" id="alert_container">
                            </div>
                        </div>
                        <label style="font-size: 12px; color: #2E4053; font-weight: 700; padding-bottom: 3px;">Total Debit:</label>
                        <asp:TextBox ID="txtTotalDebit" type="text" disabled="disabled" runat="server" class=" form-control" />

                        <label style="font-size: 12px; color: #2E4053; font-weight: 700; padding-bottom: 3px; padding-top: 7px;">Total Credit:</label>
                        <asp:TextBox ID="txtTotalCredit" type="text" disabled="disabled" class=" form-control" runat="server" /><br />

                        <asp:Button ID="btnAdd" runat="server" class="ui button green" formnovalidate="formnovalidate" OnClick="btnAdd_Click" Text="Save" /><br />

                    </div>
                    </div>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="grdJV" />
                </Triggers>
            </asp:UpdatePanel>

        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="footerContent" runat="server">
</asp:Content>
