<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Main.master" AutoEventWireup="true" CodeFile="ManagePOSVendors.aspx.cs" Inherits="Business_ManagePOSVendors" %>
<%@ Register Src="../UserControls/DatePicker.ascx" TagName="DatePicker" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script language ="javascript" type ="text/javascript" >
    function KeyPressFuncIsWholeNumber() {

        if (event.keyCode < 48 || event.keyCode > 57)
        { event.returnValue = false; }
    }
    function validate() {
        var message = "";

        if (document.getElementById("<%=txtVendorName.ClientID%>").value == "") {
            message += "You have to enter the Vendor Name...\n";
        }

        if (document.getElementById("<%=txtVendorEmail.ClientID%>").value == "") {
            message += "You have to enter the Vendor Email...\n";
        }


        if (message.length > 0) {
            message = "please notice the following requirments:\n\n" + message;
            alert(message);
            return false;
        }
        return true;
    }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table class="body_MainTB" border="0" cellpadding="0" cellspacing="0">
                    <tr align="center">
                        <td valign="top">
                            <!------------------------------------body St  ---------------------------------------------->
                            <table border="0" cellpadding="0" cellspacing="0" class="body_formTitle">
                                <tr>
                                    <td>
                                        Manage POS Vendors
                                    </td>
                                </tr>
                            </table>
                            <br/>
                            <!------------------------------------body End1 ----------------------------------------------->
                            <asp:Label ID="Label1" runat="server" Text="" class="fieldError"></asp:Label>
                            <table border="0" cellpadding="0" cellspacing="0" class="contTB">
                                <tr>
                                    <td align="center">
                                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="Frow">
                                            <tr>
                                                <td>
                                                </td>
                                            </tr>
                                        </table>
                            
                                        <br />
                                        <table border="0" cellpadding="0" cellspacing="0" class="grid_TitleBG_B">
                                            <tr>
                                                <td>
                                                    Vendors
                                                    </td>
                                            </tr>
                                        </table>
                                        <asp:Panel ID="pnlGrid" runat="server" Width="100%">
                                            <asp:Label ID="lblError" runat="server" Text="" class="fieldError"></asp:Label>
                                            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="v_code"
                                                CssClass="gridMaster" OnRowCommand="GridView1_RowCommand" AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None"
                                                OnRowCreated="GridView1_RowCreated" EmptyDataText="There are no Vendors">
                                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                                <Columns>
                                                    <asp:BoundField DataField="v_code" HeaderText="Vendor Code" />
                                                    <asp:BoundField DataField="v_name" HeaderText="Vendor Name" />
                                                    <asp:BoundField DataField="v_email" HeaderText="Vendor Enail"/>
                                                    <asp:ButtonField ButtonType="Image" CommandName="u" Text="Update" ItemStyle-Width="30px"
                                                        ImageUrl="~/Images/edit.jpg" >
                                                        <ItemStyle Width="30px" />
                                                    </asp:ButtonField>
                                                   <%--<asp:ButtonField ButtonType="Image" CommandName="d" Text="Delete" ItemStyle-Width="30px"
                                                        ImageUrl="~/Images/delete.jpg" >
                                                        <ItemStyle Width="30px" />
                                                    </asp:ButtonField>--%>
                                                </Columns>
                                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                                <EditRowStyle BackColor="#999999" />
                                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                            </asp:GridView>
                                        </asp:Panel>

                                     
                                      
                                        <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgForm">
                                        <tr>
                                            <td  style="width: 20%">
                                       
                                        <asp:DropDownList ID="ddlPages" runat="server" class="fieldNormal" AutoPostBack="True"
                                            Width="50px" OnSelectedIndexChanged="ddlPages_SelectedIndexChanged">

                                        </asp:DropDownList>
                                         Go To Page
                                    </td>
                                                </tr>                                        
                                            <tr>
                                            
                                                <td>
                                                    <asp:Button ID="btnAdd" runat="server" Text="     Add     " class="Btn_M_Normal"
                                                        OnClick="btnAdd_Click" />
                                                        </td> 
                                            </tr>
                                            
                                        </table>
                                        <br>
                                        <!------------------------------------body End1 ----------------------------------------------->
                                        <asp:Panel ID="pnlControls" runat="server" Width="100%">
                                            <fieldset id="addItem">
                                                <legend id="addItem">Product Type</legend>
                                            </fieldset>
                                            <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                                <tr>
                                                    <td class="tdNormal" style="width:15%">
                                                        Vendor Name
                                                    </td>
                                                    <td class="tdNormal" style="width:30%">
                                                        <asp:TextBox ID="txtVendorName" runat="server" Width="100%" class="fieldNormal"  MaxLength="1000"
                                                             ></asp:TextBox>
                                                    </td>
                                                      <td></td>
                                                  
                                                </tr>
                                                <tr>
                                                    <td class ="tdNormal">Vendor Email</td>
                                                    <td class ="tdNormal">
                                                        <asp:TextBox ID="txtVendorEmail" runat="server" class="fieldMultiLine" Rows="4"  MaxLength="100"
                                                            Width="100%" CssClass="fieldNormal" 
                                                            ></asp:TextBox>
                                                    </td>
                                                      <td></td>
                                                </tr>
                                            </table>
                                            <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgaddItem">
                                                <tr>
                                                    <td>
                                                        <asp:Button ID="Button2" runat="server" Text="   Cancel   " 
                                                            OnClick="btnCancel_Click" class="Btn_M_Normal" CausesValidation="False" />
                                                        <asp:Button ID="Button1" runat="server" Text="   Save   " OnClick="btnSave_Click" OnClientClick ="return validate()" class="Btn_M_Normal" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                        <!------------------------------------body End2 ----------------------------------------------->
                                        <br>
                                    </td>
                                </tr>
                            </table>
                            <!------------------------------------body End2 ----------------------------------------------->
                        </td>
                    </tr>
                </table>
</asp:Content>

