<%@ Page Language="C#" MasterPageFile="~/masterpage/MasterPage.master" AutoEventWireup="true"
    CodeFile="AccountSummery.aspx.cs" Inherits="AccountSummery" Title="eGen Service" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="request">
        <script src="../javascript/scriptvalidation.js" type="text/javascript"></script>

        <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
            <tr>
                <td colspan="4" class="hdr">
                    <a href="TransactionReport.aspx">Transaction Report </a><span style="padding-right: 100px;">
                        &nbsp;</span> <span>&nbsp;</span><a href="SMSReport.aspx">SMS Report</a>
                    <span style="padding-left: 100px;">&nbsp;</span><a href="AccountSummery.aspx" class="active">Account
                        Summary</a>
                </td>
            </tr>
            <tr>
                <td style="height: 30px" colspan="4">
                    
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="3%">
                            </td>
                            <td width="17%">
                                From Date</td>
                            <td width="1%">
                                <strong>:</strong>
                            </td>
                            <td width="30%">
                                <asp:TextBox ID="txtFrmDate" runat="server" Width="180px" onkeypress="return digitonly(this,event)"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfvFrmDate" runat="server" ErrorMessage="Please Enter Date from"
                                    ControlToValidate="txtFrmDate" Display="None"> </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" TargetControlID="rfvFrmDate"
                                    runat="server">
                                </cc1:ValidatorCalloutExtender>
                                
                                <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtFrmDate" PopupPosition="Right" Format="yyyy-MM-dd">
                                </cc1:CalendarExtender>
                            </td>
                            <td width="18%">
                                To Date</td>
                            <td width="1%">
                                <strong>:</strong>
                            </td>
                            <td width="30%">
                              <asp:TextBox ID="txtToDate" runat="server" Width="180px" onkeypress="return digitonly(this,event)"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfvToDate" runat="server" ErrorMessage="Please Enter To Date"
                                    ControlToValidate="txtToDate" Display="None"> </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" TargetControlID="rfvToDate"
                                    runat="server">
                                </cc1:ValidatorCalloutExtender>
                                
                                <cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtToDate" PopupPosition="Right" Format="yyyy-MM-dd">
                                </cc1:CalendarExtender>  
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7" style="height: 10px">
                            
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                               Select User Type <%--<asp:Label ID="lbluserid" runat="server" Text="Select User Id"></asp:Label>--%>
                            </td>
                            <td>
                                <strong>:</strong>
                            </td>
                            <td>
                              <asp:DropDownList ID="DDL_UserType" runat="server" Width="185px" CausesValidation="True" AutoPostBack="true" 
                                    onselectedindexchanged="DDL_UserType_SelectedIndexChanged">
                                    <asp:ListItem>Select</asp:ListItem>
                                    <asp:ListItem Value="1">Self</asp:ListItem>                                    
                                    <asp:ListItem Value="3">Agent</asp:ListItem>                                    
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="rfvSelService" InitialValue="Select" runat="server"
                                    ControlToValidate="DDL_UserType" Display="None" SetFocusOnError="True" ErrorMessage="Please Select User Type"> </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" TargetControlID="rfvSelService"
                                    runat="server">
                                </cc1:ValidatorCalloutExtender> 
                            </td>
                            <td>
                                <asp:Label ID="lbluserid" runat="server" Text="Select User Id"></asp:Label></td>
                            <td>
                               </td>
                            <td> <asp:DropDownList ID="ddl_partner_id" runat="server" Width="185px" CausesValidation="True">
                                    <asp:ListItem>Select</asp:ListItem>                                                                       
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="rfv_partner_id" InitialValue="Select" runat="server"
                                    ControlToValidate="ddl_partner_id" Display="None" SetFocusOnError="True" ErrorMessage="Please Select User Id"> </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" TargetControlID="rfv_partner_id"
                                    runat="server">
                                </cc1:ValidatorCalloutExtender>
                                
                            </td>                            
                        </tr>
                        <tr>
                            <td colspan="7" style="height: 10px; text-align:center">
                                                            
                            </td>
                        </tr>
                        <tr>
                        <td ></td>
                            <td colspan="3" style="padding:0 0 0 5px; text-align:left;"><asp:Button ID="btndownload" runat="server"  Text="Download Report" 
                                    onclick="btndownload_Click" />
                            </td>
                            
                            <td colspan="4" style="text-align:center"><asp:Label ID="lblBalance" runat="server" Text=" Opening Balance :" Visible="false"></asp:Label>
                            <asp:Label ID="lblopeningbalance" runat="server" Visible="false" ></asp:Label> <asp:Button ID="btnSubmit" runat="server" Text="Submit" class="button" 
                                    onclick="btnSubmit_Click" /></td>
                        </tr>                        
                        <tr>
                            <td colspan="7" style="text-align:center; font-weight:bold" ><asp:Label ID="lblerror" runat="server" ></asp:Label>                                
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="7">
                    
                    <asp:GridView ID="gvAccountReport" runat="server" AutoGenerateColumns="false" 
                        GridLines="None" AllowPaging="true" AllowSorting="true" PageSize="100"
                        Width="100%" HorizontalAlign="Center" ShowFooter="True"                         
                        onpageindexchanging="gvAccountReport_PageIndexChanging">
                        <FooterStyle BackColor="#dddee0" Font-Bold="True" ForeColor="Black" />
                        <PagerStyle BackColor="#dddee0" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#dddee0" Font-Bold="True" ForeColor="Black" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:TemplateField HeaderText="Sl.">
                                <ItemTemplate>
                                    <%#Container.DataItemIndex+1 %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="Txn Date Time" DataField="TRANSACTION_DATETIME" />
                            <asp:BoundField HeaderText="Service" DataField="SERVICE_NAME" />
                            <asp:BoundField HeaderText="Txn Id" DataField="REFERENCE_NUMBER" />
                            <asp:BoundField HeaderText="Mobile No." DataField="MobileDTHNumber"/>
                            <asp:BoundField HeaderText="Amount" DataField="REQUEST_AMOUNT"/>
                            <asp:BoundField HeaderText="Margin" DataField="total_commission"/>
                            <asp:BoundField HeaderText="Charge" DataField="TOTAL_SERVICE_CHARGE"/>
                            <asp:BoundField HeaderText="Net.Amt" DataField="NET_AMOUNT"  />
                            <asp:BoundField HeaderText="Type" DataField="ACTION_ON_AMOUNT"/>
                            <asp:BoundField HeaderText="Balance" DataField="FINAL_BAL_AMOUNT"/>
                            <asp:BoundField HeaderText="Status" DataField="Status" />
                        </Columns>
                        <EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <AlternatingRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:GridView>

                    <asp:GridView ID="gvSelf" runat="server" AutoGenerateColumns="false" 
                        GridLines="None" AllowPaging="true" AllowSorting="true" PageSize="100"
                        Width="100%" HorizontalAlign="Center" ShowFooter="True"                         
                        onpageindexchanging="gvAccountReport_PageIndexChanging" Visible="false">
                        <FooterStyle BackColor="#dddee0" Font-Bold="True" ForeColor="Black" />
                        <PagerStyle BackColor="#dddee0" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#dddee0" Font-Bold="True" ForeColor="Black" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:TemplateField HeaderText="Sl.">
                                <ItemTemplate>
                                    <%#Container.DataItemIndex+1 %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="Txn Date Time" DataField="TRANSACTION_DATETIME" />
                            <asp:BoundField HeaderText="Service" DataField="SERVICE_NAME" />
                            <asp:BoundField HeaderText="User ID" DataField="MobileDTHNumber" />
                           <%-- <asp:BoundField HeaderText="Mobile No." DataField="MobileDTHNumber"/>--%>
                            <asp:BoundField HeaderText="Amount" DataField="REQUEST_AMOUNT"/>
                            <asp:BoundField HeaderText="Margin" DataField="total_commission"/>
                            <asp:BoundField HeaderText="Charge" DataField="TOTAL_SERVICE_CHARGE"/>
                            <asp:BoundField HeaderText="Net.Amt" DataField="NET_AMOUNT"  />
                            <asp:BoundField HeaderText="Type" DataField="ACTION_ON_AMOUNT"/>
                            <asp:BoundField HeaderText="Balance" DataField="FINAL_BAL_AMOUNT"/>
                            <asp:BoundField HeaderText="Status" DataField="Status" />
                        </Columns>
                        <EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <AlternatingRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:GridView>
                </td>
            </tr>
            <!--<tr>
  <td colspan="3"></td>
  <td style="padding:0 0 0 70px;"><input type="button" class="button"  value="Submit" style="margin:15px 0 0 0;" /></td>
   </tr>-->
            <tr>
                <td colspan="4" style="height: 30px"><asp:ScriptManager ID="ScriptManager1" runat="server">
                    </asp:ScriptManager>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
