<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="WeeklyPayment.aspx.cs" Inherits="Maintenance_HR_WeeklyPayment" Title="<%$ Resources: SiteMapLocalizations, Maintenance_WeeklyPayment %>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <center>
        <table id="TABLE1" runat="server" style="" >
            <tr>
                <td>
                    <asp:RadioButton ID="rdoAddNew" runat="Server" Text="<%$ Resources: Universal, Data_AddNew %>" GroupName="Option" OnCheckedChanged="rdoFunction_CheckedChanged" AutoPostBack="True"  />
                    <asp:RadioButton ID="rdoSearch" runat="Server" Text="<%$ Resources: Universal, Data_Search %>" GroupName="Option" OnCheckedChanged="rdoFunction_CheckedChanged" AutoPostBack="True"  /></td>
            </tr>
            <tr id="trAddNewPanel" visible="false">
                <td>
                    <asp:Label ID="Label1" runat="server" Text="<%$ Resources: Universal, Msg_AttachFile %>"></asp:Label>
                    <asp:FileUpload ID="FileUpload1" runat="server" Width="400px" />&nbsp;
                    <asp:Button ID="btnView" runat="server" Text="<%$ Resources: Universal, Data_PreView %>" OnClick="btnPreView_Click" />
                    <asp:Button ID="btnUpload" runat="server" Text="<%$ Resources: Universal, Data_Submit %>" OnClick="btnUpload_Click" />
                    
                    <asp:GridView ID="GridView2" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None">
                        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                </td>
            </tr>
            <tr id="trSearchPanel" visible="false">
                <td>
                    <asp:Label ID="Label4" runat="server" Text="<%$ Resources: Universal, Employee_Name %>"></asp:Label>
                    <asp:TextBox ID="txtUserName" runat="server" Width="100px"></asp:TextBox>
                    &nbsp; &nbsp; &nbsp;
                    <asp:Label ID="Label2" runat="server" Text="<%$ Resources: Universal, Comm_StartDate %>"></asp:Label>
                    <asp:TextBox ID="txtStartDate" runat="server" Width="80px"></asp:TextBox>
                    &nbsp; 
                    <asp:Label ID="Label3" runat="server" Text="<%$ Resources: Universal, Comm_EndDate %>"></asp:Label>
                    <asp:TextBox ID="txtEndDate" runat="server" Width="80px"></asp:TextBox>
                    &nbsp;&nbsp;
                    <asp:Button ID="btnSearch" runat="server" Text="<%$ Resources: Universal, Data_Search %>" OnClick="btnSearch_Click" />
                    
                    
                    <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" DataKeyNames="PettyCashID" 
                        AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true" PageSize="20">
                        <Columns>
<%--                            <asp:BoundField HeaderText="aa" DataField="PettyCashID" ReadOnly="true" />
                            <asp:BoundField HeaderText="bb" DataField="UserName" SortExpression="UserName" />
                            <asp:BoundField HeaderText="cc" DataField="Item" SortExpression="Item" />
                            <asp:BoundField HeaderText="dd" DataField="ReceiptDate" SortExpression="ReceiptDate" />
                            <asp:BoundField HeaderText="ee" DataField="PayDate" SortExpression="PayDate" />
                            <asp:BoundField HeaderText="ff" DataField="Amount" SortExpression="Amount" />
--%>                            
                            <asp:TemplateField HeaderText="<%$ Resources: Universal, Employee_Name %>" SortExpression="UserName">
                                <ItemTemplate>
                                    <asp:Label ID="lblUserName" Text='<%# Eval("UserName") %>' runat="server"></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtUserName" Text='<%# Bind("UserName") %>' runat="server"></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="<%$ Resources: Universal, Comm_Item %>">
                                <ItemTemplate>
                                    <asp:Label ID="lblItem" Text='<%# Eval("Item") %>' runat="server"></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtItem" Text='<%# Bind("Item") %>' runat="server"></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="<%$ Resources: Universal, PettyCash_ReceiptDate %>">
                                <ItemTemplate>
                                    <asp:Label ID="lblReceiptDate" Text='<%# Eval("ReceiptDate") %>' runat="server"></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtReceiptDate" Text='<%# Bind("ReceiptDate") %>' runat="server"></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="<%$ Resources: Universal, PettyCash_PayDate %>" SortExpression="PayDate">
                                <ItemTemplate>
                                    <asp:Label ID="lblPayDate" Text='<%# Eval("PayDate") %>' runat="server"></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtPayDate" Text='<%# Bind("PayDate") %>' runat="server"></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="<%$ Resources: Universal, PettyCash_Amount %>">
                                <ItemTemplate>
                                    <asp:Label ID="lblAmount" Text='<%# Eval("Amount") %>' runat="server"></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtAmount" Text='<%# Bind("Amount") %>' runat="server"></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButtonEdit" runat="server" CausesValidation="False" CommandName="Edit"
                                        Text="<%$ resources:Universal,Data_Edit %>" />
                                    <asp:LinkButton ID="LinkButtonDelete" runat="server" CausesValidation="False" CommandName="Delete"
                                        Text="<%$ resources:Universal,Data_Delete %>" OnClientClick="<%$ Resources: Universal, Msg_DelConfirm %>" />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:LinkButton ID="LinkButtonUpdate" runat="server" ValidationGroup="AddValidationControls" CausesValidation="true"
                                        Text="<%$ resources:Universal,Data_Update %>" CommandName="Update" />
                                    <asp:LinkButton ID="LinkButtonCancel" runat="server" CausesValidation="False" CommandName="Cancel"
                                        Text="<%$ resources:Universal,Data_Cancel %>" />
                                </EditItemTemplate>
                            </asp:TemplateField>


                            <asp:CommandField UpdateText="<%$ resources:Universal,Data_Update %>"
                            CancelText="<%$ resources:Universal,Data_Cancel %>" EditText="<%$ resources:Universal,Data_Edit %>"
                            DeleteText="<%$ resources:Universal,Data_Delete %>" />
                        </Columns>

                   </asp:GridView>
                    
                    
                    
                    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="HR_PettyCashData" SelectMethod="Select" 
                        InsertMethod="Insert" OldValuesParameterFormatString="original_{0}"
                        DeleteMethod="Delete" UpdateMethod="Update">
                        <SelectParameters>
                            <asp:Parameter Name="Condition" Type="String" DefaultValue="1=0" />
                        </SelectParameters>
                        <InsertParameters>
                            <asp:Parameter Name="PettyCashID" Type="String" />
                            <asp:Parameter Name="UserName" Type="String" />
                            <asp:Parameter Name="Item" Type="String" />
                            <asp:Parameter Name="ReceiptDate" Type="String" />
                            <asp:Parameter Name="PayDate" Type="String" />
                            <asp:Parameter Name="Amount" Type="String" />
                        </InsertParameters>
                        <DeleteParameters>
                            <asp:Parameter Name="original_PettyCashID" Type="String" />
                        </DeleteParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="UserName" Type="String" />
                            <asp:Parameter Name="Item" Type="String" />
                            <asp:Parameter Name="ReceiptDate" Type="String" />
                            <asp:Parameter Name="PayDate" Type="String" />
                            <asp:Parameter Name="Amount" Type="String" />
                            <asp:Parameter Name="original_PettyCashID" Type="String" />
                        </UpdateParameters>
                    </asp:ObjectDataSource>
                </td>
            </tr>

        </table>
    </center>
</asp:Content>

