<%@ Page Language="C#" MasterPageFile="~/MasterPages/Main.master" AutoEventWireup="true" CodeFile="AddMerchantECOM.aspx.cs" Inherits="Business_AddMerchant"  %>
<%@ Register src="../UserControls/DatePicker.ascx" tagname="DatePicker" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script language="javascript">
function validate()
{
    var message = "";
    if (document.getElementById("<%=txtAccNo.ClientID%>").value=="")
    {
        message += "Account Number can not be blank\n";  
        document.getElementById("<%=txtAccNo.ClientID%>").style.backgroundColor="#c8d1e4";
    }
    
    if(document.getElementById("<%=txtRetailName.ClientID%>").value=="")
    {
        message += "Merchant Name can not be blank\n";
        document.getElementById("<%=txtRetailName.ClientID%>").style.backgroundColor="#c8d1e4";
    }

    if (document.getElementById("<%=txtRetailNameAr.ClientID%>").value == "") {
        message += "Merchant Name (Arabic) can not be blank\n";
        document.getElementById("<%=txtRetailNameAr.ClientID%>").style.backgroundColor = "#c8d1e4";
    }

    if (document.getElementById("<%=ddlAddressCity.ClientID %>").selectedIndex == 0) {
        message += "City can not be blank\n";
        document.getElementById("<%=ddlAddressCity.ClientID%>").style.backgroundColor = "#c8d1e4";
    }

    if (document.getElementById("<%=ddlRelationshipOfficer.ClientID %>").selectedIndex == 0) {
        message += "Relationship Officer can not be blank\n";
        document.getElementById("<%=ddlRelationshipOfficer.ClientID%>").style.backgroundColor = "#c8d1e4";
    }

    if (document.getElementById("<%=ddlBusinessClass.ClientID %>").selectedIndex == 0) {
        message += "Business Class can not be blank\n";
        document.getElementById("<%=ddlBusinessClass.ClientID%>").style.backgroundColor = "#c8d1e4";
    }
    

    if (document.getElementById("<%=txtRegNo.ClientID%>").value == "") {
        message += "CRN ID can not be blank\n";
        document.getElementById("<%=txtRegNo.ClientID%>").style.backgroundColor = "#c8d1e4";
    }

    if (document.getElementById("<%=txtContactname.ClientID%>").value == "") {
        message += "Contact Name can not be blank\n";
        document.getElementById("<%=txtContactname.ClientID%>").style.backgroundColor = "#c8d1e4";
    }
    
  
    if (document.getElementById("<%=txtPOBox.ClientID%>").value == "") {
        message += "P.O. Box can not be blank\n";
        document.getElementById("<%=txtPOBox.ClientID%>").style.backgroundColor = "#c8d1e4";
    }

    if (document.getElementById("<%=txtEngAdd1.ClientID%>").value == "") {
        message += "Address can not be blank\n";
        document.getElementById("<%=txtEngAdd1.ClientID%>").style.backgroundColor = "#c8d1e4";
    }
    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>
                                        Add E-Commerce Merchant</td>
                                </tr>
                            </table>
                            <br>
                            <!------------------------------------body End1 ----------------------------------------------->
                            <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 />
                                        <asp:Label ID="lblError" runat="server" Text="" class="fieldError"></asp:Label>
                                            <asp:Panel ID="pnlBR" runat="server" Width="100%">
                                                <fieldset id="addItem">
                                                 <legend id="addItem">Merchant Details</legend>
                                                </fieldset>
                                                <table border="0" width="95%" cellpadding="0" cellspacing="0" class="add_ItemTB1">
                                                     <tr>
                                                        <td class="tdNormal">Registration Date</td>
                                                        <td class="tdNormal"><asp:TextBox ID="txtRegDate" ReadOnly="true" runat="server" class="fieldNormal"></asp:TextBox><uc1:datepicker id="dateRegDate" runat="server" width="250" 
                                                                Visible="False" /></td>
                                                        <td class="tdNormal"></td>
                                                        <td class="tdNormal"></td>
                                                        <td class="tdNormal"></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tdNormal"> Account Number <span style="color:Red;">*</span> </td>
                                                        <td class="tdNormal"> 
                                                            <asp:TextBox ID="txtAccNo" MaxLength="16" runat="server" class="fieldNormal"></asp:TextBox>
                                                            <asp:Button ID="btnMW" runat="server" class="Btn_L_Normal1" 
                                                                onclick="btnMW_Click" Text="Verify Account" />
                                                        </td>
                                                        <td class="tdNormal"> </td>
                                                       <td class="tdNormal">
                                                        </td>
                                                        <td class="tdNormal"></td>
                                                        <td class ="tdNormal">
                                                           </td>
                                                        
                                                    </tr>
                                                    <tr runat="server" id="rowParent">
                                                        <%--<td class="tdNormal">Index Number</td>
                                                        <td class="tdNormal">
                                                            <asp:TextBox ID="txtLegalForm" runat="server" class="fieldNormal"></asp:TextBox>
                                                        </td>--%>
                                                        
                                                        <td class="tdNormal">Commercial Registration Number<span style="color:Red;">*</span></td>
                                                        <td class="tdNormal">
                                                            <asp:TextBox ID="txtRegNo" runat="server" class="fieldNormal"  MaxLength="20"></asp:TextBox>
                                                        </td>
                                                        <td class="tdNormal"></td>
                                                        <td class="tdNormal"></td>
                                                        <td class="tdNormal"></td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tdNormal"><asp:Label ID="lblMerchantNameAr" runat="server" 
                                                                Text="Merchant Name (Arabic)"></asp:Label><span style="color:Red;">*</span></td>
                                                        <td class="tdNormal"><asp:TextBox ID="txtRetailNameAr" runat="server" class="fieldNormal"  MaxLength="100"></asp:TextBox></td>
                                                        <td class="tdNormal"></td>
                                                        <td class="tdNormal">
                                                            <asp:Label ID="lblMerchantName" runat="server" Text="Merchant Name (English)"></asp:Label><span style="color:Red;">*</span>
                                                        </td>
                                                        <td class="tdNormal">
                                                            <asp:TextBox ID="txtRetailName" runat="server" class="fieldNormal"  MaxLength="100"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                   
                                                   <%-- <tr style="display:none">
                                                        <td class="tdNormal">Merchant Contact</td>
                                                        <td class="tdNormal">
                                                            <asp:TextBox ID="txtMerchantContact2" runat="server" class="fieldNormal"></asp:TextBox>
                                                        </td>
                                                        <td class="tdNormal"></td>
                                                        <td class="tdNormal" >Branch</td>
                                                        <td class="tdNormal" >
                                                            <asp:DropDownList ID="ddlBranch" runat="server" class="fieldNormal" 
                                                                DataTextField="L_NM" DataValueField="BRANCH_CD">
                                                            </asp:DropDownList>
                                                            <asp:TextBox ID="txtBranch" runat="server" class="fieldNormal" ReadOnly="True"></asp:TextBox>
                                                        </td>
                                                    </tr>--%>
                                                   <tr>
                                                        <td class="tdNormal">Branch<span style="color:Red;">*</span></td>
                                                        <td class="tdNormal"> <asp:DropDownList ID="ddlBranch" runat="server" class="fieldNormal" 
                                                                DataTextField="BRANCH_CD" DataValueField="BRANCH_CD" AutoPostBack ="true" 
                                                                onselectedindexchanged="ddlBranch_SelectedIndexChanged1">
                                                            </asp:DropDownList>
                                                            <asp:TextBox ID="txtBranch" runat="server" class="fieldNormal" ReadOnly="True"></asp:TextBox></td>  
                                                        <td class="tdNormal"></td>
                                                        <td class="tdNormal" ></td>
                                                        <td class="tdNormal" >
                                                           
                                                        </td>
                                                    </tr>
                                                   
                                                    <tr style="display:none">
                                                        <td class="tdNormal">Business Unit</td>
                                                        <td class="tdNormal">
                                                            <asp:DropDownList ID="ddlBusinessUnit" runat="server" AutoPostBack="True" 
                                                                class="fieldNormal" DataTextField="description" DataValueField="bu_code" 
                                                                onselectedindexchanged="ddlBusinessUnit_SelectedIndexChanged">
                                                            </asp:DropDownList>
                                                        </td>
                                                        <td class="tdNormal"></td>
                                                        <td class="tdNormal">Business Unit Account</td>
                                                        <td class="tdNormal">
                                                            <asp:TextBox ID="txtBUAcc" runat="server" class="fieldNormal" ReadOnly="true"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="tdNormal">Business Class<span style="color:Red;">*</span></td>
                                                        <td class="tdNormal">
                                                            <asp:DropDownList ID="ddlBusinessClass" runat="server" class="fieldNormal" 
                                                                DataTextField="BUSINESS_NAME" DataValueField="MCC">
                                                            </asp:DropDownList>
                                                        </td>
                                                        <td class="tdNormal"></td>
                                                        <td class="tdNormal">Relationship officer<span style="color:Red;">*</span></td>
                                                        <td class="tdNormal">
                                                            <asp:DropDownList ID="ddlRelationshipOfficer" runat="server" 
                                                                class="fieldNormal" DataTextField="RSO_NAME" DataValueField="RSO_CODE" Width="250">
                                                            </asp:DropDownList>
                                                        </td>
                                                    </tr>
                                                   
                                                   
                                                    <tr>
                                                        <td colspan="5">
                                                            </td>
                                                    </tr>
                                                </table>

                                                <br />

                                                <fieldset id="addItem">
                                                            <legend id="addItem">Address Details</legend>
                                                        </fieldset>
                                                        <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                                            <tr>
                                                                <td class="tdNormal" style="width: 15%">
                                                                    Contact Name
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtContactname" runat="server" class="fieldNormal" MaxLength="100"></asp:TextBox><br />
                                                                </td>
                                                                <td class="tdNormal" style="width: 10%">
                                                                </td>
                                                                <td class="tdNormal" style="width: 15%">
                                                                    P.O Box
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtPOBox" runat="server" class="fieldNormal"  MaxLength="30"></asp:TextBox><br />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal" style="width: 15%">
                                                                    Address
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtEngAdd1" runat="server" class="fieldNormal"  MaxLength="100"></asp:TextBox><br />
                                                                </td>
                                                                <td class="tdNormal" style="width: 10%">
                                                                </td>
                                                                <td class="tdNormal" style="width: 15%">
                                                                    Email Address
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtEmail" runat="server" class="fieldNormal" MaxLength="30"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal" style="width: 15%">
                                                                    
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtEngAdd2" runat="server" class="fieldNormal"  MaxLength="100"></asp:TextBox><br />
                                                                </td>
                                                                <td class="tdNormal" style="width: 10%">
                                                                </td>
                                                                <td class="tdNormal" style="width: 15%">
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtEmail2" runat="server" class="fieldNormal"  MaxLength="30"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal" style="width: 15%">
                                                                    
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtEngAdd3" runat="server" class="fieldNormal"  MaxLength="100"></asp:TextBox><br />
                                                                </td>
                                                                <td class="tdNormal" style="width: 10%">
                                                                </td>
                                                                <td class="tdNormal" style="width: 15%">
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtEmail3" runat="server" class="fieldNormal"  MaxLength="30"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal" style="width: 15%">
                                                                    Post Code
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtPostCode" runat="server" class="fieldNormal"  MaxLength="30"></asp:TextBox><br />
                                                                </td>
                                                                <td class="tdNormal" style="width: 10%">
                                                                </td>
                                                                <%--<td class="tdNormal" style="width: 15%">
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                </td>--%>
                                                                <td class="tdNormal" style="width: 15%">
                                                                    City
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:DropDownList ID="ddlAddressCity" runat="server" DataTextField="c_desc" DataValueField="c_code"
                                                                        class="fieldNormal">
                                                                    </asp:DropDownList><br />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal" style="width: 15%">Country
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:DropDownList ID="ddlAddressCountry" runat="server" class="fieldNormal">
                                                                        <asp:ListItem Value="682">Saudi Arabia</asp:ListItem>
                                                                    </asp:DropDownList>
                                                                </td>
                                                                <td class="tdNormal" style="width: 10%"></td>
                                                                <td class="tdNormal" style="width: 15%">Posting Method</td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:DropDownList ID="ddlPostingMethod" runat="server" DataTextField="POSTING_METHOD_NAME"
                                                                        DataValueField="PM_CODE" class="fieldNormal">
                                                                    </asp:DropDownList>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal" style="width: 15%">
                                                                    Tel Work
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtTelWork" runat="server" class="fieldNormal"  MaxLength="20"></asp:TextBox><br />
                                                                </td>
                                                                <td class="tdNormal" style="width: 10%">
                                                                </td>
                                                                <td class="tdNormal" style="width: 15%">
                                                                    Tel Other
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtTelOther" runat="server" class="fieldNormal"  MaxLength="20"></asp:TextBox><br />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal" style="width: 15%">
                                                                    fax
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtFax" runat="server" class="fieldNormal"  MaxLength="20"></asp:TextBox><br />
                                                                </td>
                                                                <td class="tdNormal" style="width: 10%">
                                                                </td>
                                                                <td class="tdNormal" style="width: 15%">
                                                                    Mobile 1</td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtMobile" runat="server" class="fieldNormal"  MaxLength="20"></asp:TextBox><br />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="tdNormal" style="width: 15%">
                                                                    Mobile 2
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtMobile2" runat="server" class="fieldNormal"  MaxLength="20"></asp:TextBox><br />
                                                                </td>
                                                                <td class="tdNormal" style="width: 10%">
                                                                </td>
                                                                <td class="tdNormal" style="width: 15%">
                                                                    Mobile 3
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%">
                                                                    <asp:TextBox ID="txtMobile3" runat="server" class="fieldNormal"  MaxLength="20"></asp:TextBox><br />
                                                                </td>
                                                            </tr>
                                                            
                                                        </table>

                                                 <%--<fieldset id="addItem">
                                                            <legend id="addItem">Terminal Details</legend>
                                                        </fieldset>

                                                        <table border="0" cellpadding="0" cellspacing="0" class="add_ItemTB">
                                                            <tr runat="server" id="firstrow">
                                                                <td class="tdNormal" style="width: 15%">
                                                                    Terminal ID
                                                                </td>
                                                                <td class="tdNormal" colspan="2" style="width: 30%">
                                                                    <asp:TextBox ID="txtTerminalID" MaxLength="8" runat="server" class="fieldNormal" Width=100></asp:TextBox>
                                                                </td>
                                                                <td class="tdNormal" style="width: 15%;">Terminal Location
                                                                </td>
                                                                <td class="tdNormal" style="width: 30%;">
                                                                     <asp:TextBox ID="txtTerminalLocation" runat="server" class="fieldNormal"  MaxLength="100"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                        </table>--%>

                                                <table border="0" cellpadding="0" cellspacing="0" class="action_TB_BgaddItem">
                                                    <tr>
                                                        <td>
                                                            <asp:Button ID="btnSave" runat="server" Text="   Save   "
                                                                class="Btn_M_Normal" onclick="btnSave_Click" OnClientClick="return validate()"/>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </asp:Panel>
                                        <!------------------------------------body End2 ----------------------------------------------->
                                        <br>
                                    </td>
                                </tr>
                            </table>
                            <!------------------------------------body End2 ----------------------------------------------->
                        </td>
                    </tr>
                </table>
</asp:Content>
