<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="OrderEntry_RMWLayout.aspx.vb" Inherits="FinIQWebApp.OrderEntry_RMWLayout" %>

<%@ Register Src="../FinIQ_User_Controls/Smart_Search_Customer_Control/FinIQ_Customer_SmartSearch.ascx"
    TagName="FinIQ_Customer_SmartSearch" TagPrefix="ucsmart" %>

<%@ Register Src="../FinIQ_User_Controls/Smart_Search_Funds_Control/FinIQ_FundsCode.ascx" TagPrefix="ucFundsearch" TagName="FinIQ_FundsCode" %>

<%@ Register Src="../FinIQ_User_Controls/DateControl.ascx" TagName="DateControl" TagPrefix="uc1" %>
<%@ Register Src="~/FinIQ_User_Controls/Smart_Search_RM_Control/Smart_Serach_RM_Control.ascx" TagPrefix="dtuc_RM" TagName="Smart_Search_RM_Control" %>  <%--'Aditya B || 24-Mar-2020 || For RM smart search as told by Harsh M--%> 

<link rel="stylesheet" type="text/css" href='<%=ResolveClientUrl("~/FinIQJS/jquery-ui.min.css")%>' />
<script src='<%=ResolveClientUrl("~/FinIQJS/external/jquery/jquery.min.js")%>'></script>
<script src='<%=ResolveClientUrl("~/FinIQJS/jquery-ui.min.js")%>'></script>
<link href='<%=ResolveClientUrl("~/App_Themes/Style1.css")%>' rel="stylesheet">
<link rel="stylesheet" type="text/css" href='<%=ResolveClientUrl("~/App_Themes/ConfirmationBox.css")%>' />
<script src='<%=ResolveClientUrl("~/FinIQJS/conformationBox.js")%>'></script>
<script src='<%=ResolveClientUrl("~/FinIQJS/jscolor.js")%>'></script>
<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet'>
<script src='<%=ResolveClientUrl("~/FinIQJS/CalendarPopup.js")%>'></script>
<script src='<%=ResolveClientUrl("~/FinIQJS/FinIQCommon.js")%>'></script> <%--Aditya B || 10-Apr-2020 || For switching fund smart search not working issue--%>

<!DOCTYPE html>

<h1 id="PageTitle" runat="server" visible="false" class="lblHeaderStyling" style="font: bold;margin-left:28px !important;margin-top:30px !important">Funds Order Entry</h1>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Funds Order Entry</title>
    <link href="../App_Themes/Style1.css" rel="stylesheet" type="text/css" />
    <link href="../FinIQJS/jquery-ui.min.css" rel="stylesheet" />
    <script src="../FinIQJS/external/jquery/jquery.min.js"></script>
    <script src="../FinIQJS/jquery-ui.min.js"></script>
    <script type="text/javascript">
        //var inputParams = "{RecordType:D,ApplicationID:PIB206604000444,ApplicationType:SW,SourceofOrigin:PIB,SalespersonOfficerCodeTeam:AB82"
        //inputParams=inputParams + ",UTSalespersonCode:1234,DomicileBranchCode:AB33,DomicileBankCode:30,EffectingBranchCode:101,EffectingBankCode:30"
        //inputParams = inputParams + ",Bank:UOB,ReferrorEmployeeName:ABCD Name1,ReferrorEmployeeID:AB7887997,ExternalReferrorName:NAME768954312"
        //inputParams = inputParams + ",ExternalReferrorID:76879678,ExternalReferrorIDType:PP,ExternalReferrorIDCountry:SG,ReferrorFlag:Y,SubmittedDateTime:03-07-2015 05:14:06"
        //",RcRpIndicator:E,SalespersonEmployeeID:AB7672672,SalespersonName1LastName:NAME 1345,SalespersonName2MidName:NAME 2322425,CIFNumber:800000002,Salutation:MR"
        //",ApplicantName1:NAME 33,ApplicantName2:NAME 31,IDInformation:ID12,IDTypeCode:PP,IDCountryCode:SG,PhoneWork:6532123232,PhoneHome:6532123232,PhoneMobile:9865321245"
        //",Email:test@email.com,DateofBirth:03-07-2015,Age:27,Gender:male,Race:abc,MaritalStatus:M,CountryofCitizenshipCode:SG,CountryofResidenshipCode:SG,PermanentResidentFlg:SG,CDPNo:1234,"
        //",CPFNo:3216,TaxStatus:P,OtherIdentification:ID13,EmployerName:NAME E3,TypeofBusiness:B1,JobDesignation:SSC,Position:ABC,EmployeeFlag:Y,ApplicantType:ABC,CareOfName:NAME78789,"
        //",AddressSeqNum:1313131,AddressType:ABCD,AddressFormat:ABCD1,Block:4,Street:6,Storey:8,Unit:10,BuildingName:B3,POBox:3648,PostalCode:36486,City:SG,Country:SG,AddressLine1:LINE1,"
        //",   "AddressLine2":"LINE2",
        //"AddressLine3":"LINE3",
        //"AddressLine4":"LINE4",
        //"Segment":"PB",
        //"CustomerRiskScoreRc":"3",
        //"RiskReviewDate":"12-05-2018",
        //"RiskSource":"ABCD",
        //"RcId":"ABCD",
        //"RcIdType":"XY",
        //"RcIdCountry":"SG",
        //"IDExpiryDate":"30-07-2019",
        //"CountryofBirthCode":"SG",
        //"TIN1":"4646",
        //"Country1Code":"SG",
        //"TIN2":"46466",
        //"Country2Code":"SG",
        //"Reason1":"4647",
        //"Reason2":"4646",
        //"TIN3":"4646",
        //"Country3Code":"SG",
        //"Reason3":"77546",
        //"TIN4":"4646",
        //"Country4":"SG",
        //"Reason4":"5353",
        //"FundCode":"PJHFU",
        //"ProductRiskScoreRp":"01",
        //"CurrencyDenominated":"SGD",
        //"TradeDate":"01-01-2018",
        //"TransactionType":"SW",
        //"FINorWPNo":"13411111",
        //"Discount":"12",
        //"ExistingSubscriberofFund":"01",
        //"ExistingSubscriberACNo":"00200",
        //"SigningCondition":"C1",
        //"ModeofPayment":"SA",
        //"PurchaseAmount":"0",
        //"DividendInstruction":"AB",
        //"RegularSavingsMode":"CA",
        //"NumberofMthsorQtrs ":"1",
        //"RegularInvestment":"10",
        //"DepositAmount":"10000",
        //"SwitchFrom":"GHYPAS",
        //"SwitchTo":"PJHFU",
        //"SwitchUnits":"100",
        //"ModeofSettlement":"CPFISSA",
        //"RealizedAmountUnits":"9999999",
        //"AccountPaymentType":"Cash",
        //"UOBCreditCardNumber":"54654789",
        //"UOBCreditCardExpiry":"30-08-2026",
        //"ApprovalCode":"ghjhg",
        //"ChequeNumber":"100000111",
        //"UOBDebitingACNo":"1110001",
        //"TelegraphicTransfertoFundManagerACNo":"546545",
        //"CPFApprovedBank":"uo",
        //"CPFACNo":"10000003",
        //"CPFInvestmentACNo":"30000001",
        //"CompletedStandingInstructionFormPreviously":"33",
        //"SRSOperator":"BA",
        //"SRSACNo":"30101111131",
        //"CreditingACNo":"80000002",
        //"CreditingACNoForDividend":"80003002",
        //"CreditingACName1ForDividend":"NAME1",
        //"CreditingACName2ForDividend":"NAME2",
        //"CreditingACCurrencyForDividend":"SGD",
        //"CampaignCode":"13",
        //"SystemCampaignCode":"cd",
        //"EarlyMaturityProceedsInstruction":"jhghjg",
        //"CreditingACNoMaturity":"21345",
        //"CreditingACCurrencyMaturity":"SGD""
        //$("#btnBookOrder").click(function () {
        function BookOrder() {
            //
            var inputParams = {
                "FinIQRequestHeader": {
                    "FinIQProductParameters": {
                        "SystemTemplate": "Funds_Trade_Setup",
                        "SystemLogin": "finiqservice",
                        "SystemEvent": "L1",
                        "ImportMode": "INSERT",
                        "ValidateMode": "PROCESS",
                        "RefreshMode": "FULLREFRESH",
                        "SystemProduct": "Mutual Funds"
                    },
                    "FinIQRequesterContext": {
                        "MachinePort": "ASD",
                        "RequestAt": "26-02-2018 09:42:35",
                        //"LoginID": "Dealer1",
                        "LoginID": document.getElementById('<%=hdnUserID.ClientID%>').value,//Added By Mohini|7-Nov-2020|to remove hardcode Value
                        "LoginGroup": "Dealers",
                        "MachineIP": "127.0.0.1",
                        "RequestID": "12345-67890-12345-67890",
                        "EntityCode": "PB",
                        //"EntityID": "4",
                        "EntityID": document.getElementById('<%=hdnEntityID.ClientID%>').value, //Added By Mohini|7-Nov-2020|to remove hardcode Value
                        "SourceSystem": "PIB"
                    }
                },
                "FinIQRequestBody": {
                    "RecordType": "D",
                    "ApplicationID": "PIB" + document.getElementById('hdnApplicationID').value, //"PIB206604000444",
                    "ApplicationType": document.getElementById("ddlFundMode").options[document.getElementById("ddlFundMode").selectedIndex].value,
                    "SourceofOrigin": "PIB",
                    "SalespersonOfficerCodeTeam": "AB82",
                    "UTSalespersonCode": "1234",
                    "DomicileBranchCode": "AB33",
                    "DomicileBankCode": "30",
                    "EffectingBranchCode": document.getElementById("ddlbranch").options[document.getElementById("ddlbranch").selectedIndex].label, //Aditya B || 24-Mar-2020 || To save branch id. Made this change for demo as told by Harsh M
                    "EffectingBankCode": "30",
                    "Bank": "UOB",
                    "ReferrorEmployeeName": "ABCD Name1",
                    "ReferrorEmployeeID": "AB7887997",
                    "ExternalReferrorName": document.getElementById("ddl_Portfolio").options[document.getElementById("ddl_Portfolio").selectedIndex].value,
                    "ExternalReferrorID": "76879678",
                    "ExternalReferrorIDType": "PP",
                    "ExternalReferrorIDCountry": "SG",
                    "ReferrorFlag": "Y",
                    "SubmittedDateTime": "03-07-2015 05:14:06",
                    "RcRpIndicator": "E",
                    "SalespersonEmployeeID": document.getElementById('Hdn_DealerId').value, //Aditya B || 24-Mar-2020 || To save rm id. Made this change for demo as told by Harsh M
                    "SalespersonName1LastName": "NAME 1345",
                    "SalespersonName2MidName": "NAME 2322425",
                    "CIFNumber": document.getElementById("hdnCIFNumber").value,
                    "Salutation": "MR",
                    "ApplicantName1": document.getElementById("hdnCustomerName").value,
                    "ApplicantName2": "NAME 31",
                    "IDInformation": "ID12",
                    "IDTypeCode": "PP",
                    "IDCountryCode": "SG",
                    "PhoneWork": "6532123232",
                    "PhoneHome": "6532123232",
                    "PhoneMobile": "9865321245",
                    "Email": "test@email.com",
                    "DateofBirth": "03-07-2015",
                    "Age": "27",
                    "Gender": "male",
                    "Race": "abc",
                    "MaritalStatus": "M",
                    "CountryofCitizenshipCode": "SG",
                    "CountryofResidenshipCode": "SG",
                    "PermanentResidentFlg": "SG",
                    "CDPNo": "1234",
                    "CPFNo": "3216",
                    "TaxStatus": "P",
                    "OtherIdentification": "ID13",
                    "EmployerName": "NAME E3",
                    "TypeofBusiness": "B1",
                    "JobDesignation": "SSC",
                    "Position": "ABC",
                    "EmployeeFlag": "Y",
                    "ApplicantType": "ABC",
                    "CareOfName": "NAME78789",
                    "AddressSeqNum": "1313131",
                    "AddressType": "ABCD",
                    "AddressFormat": "ABCD1",
                    "Block": "4",
                    "Street": "6",
                    "Storey": "8",
                    "Unit": "10",
                    "BuildingName": "B3",
                    "POBox": "3648",
                    "PostalCode": "36486",
                    "City": "SG",
                    "Country": "SG",
                    "AddressLine1": "LINE1",
                    "AddressLine2": "LINE2",
                    "AddressLine3": "LINE3",
                    "AddressLine4": "LINE4",
                    "Segment": "PB",
                    "CustomerRiskScoreRc": "3",
                    "RiskReviewDate": "12-05-2018",
                    "RiskSource": "ABCD",
                    "RcId": "ABCD",
                    "RcIdType": "XY",
                    "RcIdCountry": "SG",
                    "IDExpiryDate": "30-07-2019",
                    "CountryofBirthCode": "SG",
                    "TIN1": "4646",
                    "Country1Code": "SG",
                    "TIN2": "46466",
                    "Country2Code": "SG",
                    "Reason1": "4647",
                    "Reason2": "4646",
                    "TIN3": "4646",
                    "Country3Code": "SG",
                    "Reason3": "77546",
                    "TIN4": "4646",
                    "Country4": "SG",
                    "Reason4": "5353",
                    "FundCode": document.getElementById("lblFundCode").innerHTML,
                    "ProductRiskScoreRp": "01",
                    "CurrencyDenominated": document.getElementById('hdnFundCCY').value,//"CurrencyDenominated": "SGD",
                    "TradeDate": $("#txtTradeDate_txtDate").val(), //document.getElementById('hdnDate').value,
                    "TransactionType": document.getElementById("ddlFundMode").options[document.getElementById("ddlFundMode").selectedIndex].value,
                    "FINorWPNo": "13411111",
                    "Discount": "12",
                    "ExistingSubscriberofFund": "01",
                    "ExistingSubscriberACNo": document.getElementById("ddlAccountNo").options[document.getElementById("ddlAccountNo").selectedIndex].value,
                    "SigningCondition": "C1",
                    "ModeofPayment": "SA",
                    "PurchaseAmount": document.getElementById("txtNominalAmount").value.replace(/,/g, ""), //Changed by Aditya B || 16-Aug-2019 || Replaced 'txtNominalAmount' with 'hdnPurchaseAmount'
                    "DividendInstruction": "AB",
                    "RegularSavingsMode": "CA",
                    "NumberofMthsorQtrs": "1",
                    "RegularInvestment": "10",
                    "DepositAmount": "10000",
                    "SwitchFrom": document.getElementById("hdnSwitchFromFundCode").value,
                    "SwitchTo": document.getElementById('hdnSwitchingFundCode').value,
                    "SwitchUnits": document.getElementById("hdnSwitchUnits").value.replace(/,/g, ""),
                    "ModeofSettlement": "CPFISSA",
                    "RealizedAmountUnits": document.getElementById("txtUnits").value.replace(/,/g, ""),
                    "AccountPaymentType": "Cash",
                    "UOBCreditCardNumber": "54654789",
                    "UOBCreditCardExpiry": "30-08-2026",
                    "ApprovalCode": "ghjhg",
                    "ChequeNumber": "100000111",
                    "UOBDebitingACNo": "1110001",
                    "TelegraphicTransfertoFundManagerACNo": "546545",
                    "CPFApprovedBank": "uo",
                    "CPFACNo": "10000003",
                    "CPFInvestmentACNo": "30000001",
                    "CompletedStandingInstructionFormPreviously": "33",
                    "SRSOperator": "BA",
                    "SRSACNo": "30101111131",
                    "CreditingACNo": "80000002",
                    "CreditingACNoForDividend": "80003002",
                    "CreditingACName1ForDividend": "NAME1",
                    "CreditingACName2ForDividend": "NAME2",
                    "CreditingACCurrencyForDividend": "SGD",
                    "CampaignCode": "13",
                    "SystemCampaignCode": "cd",
                    "EarlyMaturityProceedsInstruction": "Instruction 1",
                    "CreditingACNoMaturity": "21345",
                    "AccountType": document.getElementById("ddl_AccountType").options[document.getElementById("ddl_AccountType").selectedIndex].value,
                    "tofundccy": document.getElementById("hdnToFundCcy").value,
                    "ToFundNav": document.getElementById("txtSwitchingFundNAV").value.replace(/,/g, "")
                }
            }
            inputParams = JSON.stringify(inputParams);
            //$.support.cors = true;
            $.ajax({
                type: "POST",
                url: "http://" + location.hostname + "/finiqservice/PIB_Services.svc/ImportUTAPI",
                headers: {
                    'Content-Type': 'application/json'
                },
                data: inputParams,
                // contentType: "application/json; charset=utf-8",
                dataType: "json",
                cache: false,
                success: function (data) {
                    // 
                    if (data.FinIQResponseBody.Status === "SUCCESS") {

                        document.getElementById('lblMessage').innerHTML = "Order saved successfully with Reference number " + data.FinIQResponseBody.NoteMasterID;
                        document.getElementById('hdnNMID').value = data.FinIQResponseBody.NoteMasterID;
                        //__doPostBack('UPDATENAV');
                    }
                    else
                        // document.getElementById('lblMessage').innerHTML = data.FinIQResponseBody.WarningMessage;
                        document.getElementById('lblMessage').innerHTML = data.FinIQResponseBody.ErrorDetails.ErrorDescription;
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert(errorThrown);
                    ////alert("length : " + objData.length);
                    //alert(obj); 
                    //alert(obj["FinIQResponseBody"]);
                    //var NoteMasterId;
                    //if (obj === null || obj.length === 0) {
                    //    return;
                    //}
                    //else {
                    //    for (var i = 0; i < obj.length; i++) {
                    //        //alert(obj[i].NoteMasterID);
                    //        NoteMasterId = obj[i].NoteMasterID;
                    //    }
                    //    alert('Order has been booked successfully. Reference No: ' + NoteMasterId);
                    //}

                }
            });
        }
        $(document).ready(function () {
            //randomNum();
            getdate();
            //
            if (document.getElementById('ddlFundMode').value == 'RD')
                document.getElementById('hdnNominalAmt').value = "0.00";
            else
                document.getElementById('hdnNominalAmt').value = document.getElementById("txtNominalAmount").value.replace(/,/g, "");

        });
        function randomNum() {
            document.getElementById('hdnApplicationID').value = Math.floor(Math.random() * 90000000) + 10000000; //Math.floor(Math.random() * 20);
        }

        function getdate() {
            var today = new Date();
            var dd = today.getDate();
            var mm = today.getMonth() + 1; //January is 0!
            var yyyy = today.getFullYear();
            if (dd < 10) {
                dd = '0' + dd
            }
            if (mm < 10) {
                mm = '0' + mm
            }
            today = dd + '-' + mm + '-' + yyyy;
            document.getElementById('hdnDate').value = today;
        }

        function BookOrderLoading() {
            $('#DivBookOrderLoading').html('<img src="../App_Resources/Ajax_loader_White/loading_1.gif"/>');
        }

        function ShowOnlyBottomLine(ctrl) {
            document.getElementById("txtNominalAmount").style.border = "solid 0px #ddd !important";
            document.getElementById("txtNominalAmount").style.borderBottom = "solid 1px #ddd !important";
            //$("#" + ctrl.id).css("border", "solid 0px #ddd !important");
            //$("#" + ctrl.id).css("border-bottom", "solid 1px #ddd !important");
        }

        function ShowAllLines(ctrl) {
            //$("#" + ctrl).css("border", "solid 0px #ddd !important");
            //$("#" + ctrl).css("border-bottom", "solid 1px #ddd !important");
        }

        //});

        //Aditya B || 27-Oct-2020 || To launch collateral pop-up || Start
        function CollateralPopupControl(GroupID, CustomerID, NoteMasterID) {
            try {
                var left = (screen.width / 2) - (900 / 2);
                var topp = (screen.height / 2) - (900 / 2);


                var iframe = $('<iframe src="../UCP/UCP_Collateral/CollateralPopupControl/CollateralPopupControl.aspx?GroupID=' + GroupID + '&CustomerID=' + CustomerID + '&NoteMasterID=' + NoteMasterID + '", width="607px",top="50px !importtant",left="100px !important", status="no",resizable="yes",toolbar="no",scrollbars="no", scrolling="no",menubar="no", frameborder="0", marginwidth="0", marginheight="0"></iframe>');
                var dialog = $("<div class=model style='margin-left:1px'> <br /><br />&nbsp;&nbsp; &nbsp<p2> Credit and collateral calculation in progress...<p2> <br /> <br /></div>").append(iframe).appendTo("body").dialog({
                    height: this.scrollHeight, //'auto'
                    width: 607,
                    modal: true,
                    resizable: true,
                    draggable: true,
                    //autoOpen: true,
                    //title: "Details",

                    bgiframe: true,
                    close: function (event, ui) { $('html').find('#collDialog').html(); },
                    open: function (event, ui) {
                        $('html').find('#collDialog').html('');
                        $('iframe').load(function () {
                            
                            this.style.height = 475; // this.contentWindow.document.body.offsetHeight + 'px';
                            this.style.width = 595;
                        });

                        $('[class="ui-dialog ui-corner-all ui-widget ui-widget-content ui-front ui-dialog-buttons ui-draggable ui-resizable"]').css({ 'top': '120px', 'left': '100px', 'box-shadow': '4px 4px 10px #666666;' })
                        // $('[class="ui-dialog ui-corner-all ui-widget ui-widget-content ui-front ui-dialog-buttons ui-draggable ui-resizable"]').css()
                        $('[class="ui-dialog-buttonset"]').css('float', 'left')
                        $('[class="ui-dialog-buttonset"]').css('margin-left', '19px')
                        //$('[class="ui-dialog-buttonpane"]').css('text-align', 'center')
                    },
                    buttons:
                    {
                        'OK': function () {
                            $(this).dialog('close');
                            dialogConfirmed = true;
                            if (obj) obj.click();
                            dialogConfirmed = false;
                        },
                    }
                });
            }
            catch (error) {
                console.log("Error: " + error);
            }
        }
        //Aditya B || 27-Oct-2020 || To launch collateral pop-up || End
    </script>

    <style type="text/css">
        .auto-style1
        {
            width: 110px;
            padding-left:35px;
            padding-bottom:8px;
            
        }
        .auto-style2
        {
            width: 180px;
             padding-left:25px;
             padding-right:25px;
             padding-bottom:8px;
        }

        .lblOrderEntry {
            font-size: 13px !important;
        }

        hr {
            border: none;
            border-top: 1px dotted #000;
            color: #fff;
            background-color: #fff;
            height: 1px;
            width: 100%;
        }

        .lblLink, .lblMessage {
            color: #0368b6 !important;
        }

        .lbolTitle {
            padding-bottom: 15px !important;
        }

        .lblHeaderStyling {
            font-family: Verdana !important;
            color: #325d81 !important;
            font-size: 14px !important;
            font-weight: bold;
        }

        .txt-amount-fields {
            text-align:right
        }

        .lbl-amount-fields {
            text-align:right;
            text-decoration:underline;
            width:170px;
            display:block
        }
    </style>
</head>
<body>
     <table style="width: 100%;" class="FinIQ_lblFormName" >
                        <tr>
                            <td style="vertical-align: middle; text-align: left;" class="HeaderOrder">
                          
                                &nbsp;<asp:Label ID="FinIQ_lblFormName" runat="server" Text="Mutual Funds Order Capture" CssClass="FinIQ_lblFormName"></asp:Label>
                            </td>
                        </tr>
                    </table>

    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

        <asp:UpdatePanel ID="UpOrderEntry" runat="server">
        <ContentTemplate>
        <table class="Filter" cellpadding="5" cellspacing="2" style="padding-top:17px" align="center" width="100%">

            <tr id="trCustomerName" runat="server">
                <td class="auto-style1">
                    <asp:Label runat="server" ID="lbl1" Text="Customer" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2">
                    <ucsmart:FinIQ_Customer_SmartSearch runat="server" Style="vertical-align: top; white-space: nowrap;" OnUC_Postback="FindCustSmart_UC_Postback" SetTabIndex="1" ID="FindCustSmart" />
                    <asp:Label ID="lblCustomerName" runat="server" CssClass="lbl" Style="display: none"></asp:Label>
                </td>
            </tr>
            <%--'Aditya B || 24-Mar-2020 || For RM smart search & Branch dropdown as told by Harsh M || Start--%>
            <tr id="trRM" runat="server">
                <td class="auto-style1">
                    <asp:Label runat="server" ID="Label10" Text="RM" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2">
                    <dtuc_RM:Smart_Search_RM_Control runat="server" SetWidth="170"  ID="SmartSearchRM"  OnUC_Postback="Smart_Search_RM_UC_Postback"/>
                </td>
            </tr>
            <tr id="trBook" runat="server">
                <td class="auto-style1">
                    <asp:Label runat="server" ID="lblbook" Text="Book" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2">
                    <asp:DropDownList runat="server" ID="ddlbranch" CssClass="ddl ddl1" Width="170px">
                    </asp:DropDownList>
                </td>
            </tr>
           <%-- 'Aditya B || 24-Mar-2020 || For RM smart search & Branch dropdown as told by Harsh M || End--%>
            <tr id="trPortfolio" runat="server">
                <td class="auto-style1">
                    <asp:Label runat="server" ID="lbl2" Text="Portfolio" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2">
                    <asp:DropDownList ID="ddl_Portfolio" runat="server" CssClass="ddl lblOrderEntry" Width="170px" AutoPostBack="true"></asp:DropDownList>
                </td>
            </tr>
            <tr id="trAccountType" runat="server">
                <td class="auto-style1">
                    <asp:Label runat="server" ID="lbl3" Text="Account Type" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2">
                    <asp:DropDownList ID="ddl_AccountType" runat="server" CssClass="ddl lblOrderEntry" Width="170px" AutoPostBack="true"></asp:DropDownList>
                </td>
            </tr>
            <tr id="trAccountNo" runat="server">
                <td class="auto-style1">
                    <asp:Label runat="server" ID="lbl4" Text="Account No" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2">
                    <asp:DropDownList ID="ddlAccountNo" runat="server" CssClass="ddl lblOrderEntry" Width="170px"></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="auto-style1">
                    <asp:Label runat="server" ID="lbl6" Text="Order Type" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2">
                    <asp:DropDownList ID="ddlFundMode" runat="server" CssClass="ddl lblOrderEntry" Width="170px" AutoPostBack="true">
                        <asp:ListItem Text="Subscription" Value="SB" />
                        <asp:ListItem Text="Redemption" Value="RD" />
                        <asp:ListItem Text="Switch" Value="SW" />
                        <asp:ListItem Text="Systematic Investment Plan" Value="SIP" />
                        <asp:ListItem Text="Systematic Withdrawal Plan" Value="SWP" />
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="auto-style1">
                    <asp:Label runat="server" ID="lbl5" Text="Fund Code" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2" style="padding-bottom:0px !important">
                    <asp:Label ID="lblFundCode" runat="server" CssClass="lbl lblOrderEntry"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="auto-style1">
                    <asp:Label runat="server" ID="lbl8" Text="NAV (Indicative)" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2">
                    <asp:TextBox ID="txtNAV" runat="server" CssClass="txt lblOrderEntry txt-amount-fields" Width="170px" Enabled="false"></asp:TextBox>
                </td>
            </tr>
            <tr id="trCashBalance" runat="server">
                <td class="auto-style1">
                    <asp:Label ID="lblFundBalanceHeader" runat="server" CssClass="lblOrderEntry" Text="Cash Balance"></asp:Label></td>
                <td class="auto-style2">
                    <asp:Label ID="lblFundBalance" runat="server" CssClass="lbl lblOrderEntry lbl-amount-fields"></asp:Label>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <hr />
                </td>
            </tr>
            <tr>
                <td></td>
                <td class="auto-style2">
                    <asp:Label ID="lblOrderDetailsCaption" runat="server" CssClass="lblOrderEntry" Text="" Style="font-weight: bold"></asp:Label>
                </td>
            </tr>

            <%--Subscription Validation Fields || START--%>
            <tr id="trMinimumInitialInvestmentAmount" runat="server" visible="false">
                <td class="auto-style1">
                    <asp:Label ID="lblMinInitialInvestmentAmountHeader" runat="server" CssClass="lblOrderEntry" Text="Min Initial Investment Amt"></asp:Label></td>
                <td class="auto-style2">
                    <asp:Label ID="lblMinInitialInvestmentAmount" runat="server" CssClass="lbl lblOrderEntry lbl-amount-fields"></asp:Label>
                </td>
            </tr>
            <tr id="trMinimumSubsequentInvestment" runat="server" visible="false">
                <td class="auto-style1">
                    <asp:Label ID="Label8" runat="server" CssClass="lblOrderEntry" Text="Min Subsequent Investment Amt"></asp:Label></td>
                <td class="auto-style2">
                    <asp:Label ID="lblMinimumSubsequentInvestment" runat="server" CssClass="lbl lblOrderEntry lbl-amount-fields"></asp:Label>
                </td>
            </tr>
            <%--Subscription Validation Fields || END--%>

            <%--SIP Fields || START--%>
            <tr id="trMinSIPInstallment" runat="server" visible="false">
                <td class="auto-style1">
                    <asp:Label ID="Label4" runat="server" CssClass="lblOrderEntry" Text="Min SIP Installment Amt"></asp:Label></td>
                <td class="auto-style2">
                    <asp:Label ID="lblMinSIPInstallment" runat="server" CssClass="lbl lblOrderEntry lbl-amount-fields"></asp:Label>
                </td>
            </tr>
            <tr id="trMinSWPInstallment" runat="server" visible="false">
                <td class="auto-style1">
                    <asp:Label ID="Label5" runat="server" CssClass="lblOrderEntry" Text="Min SWP Installment Amt"></asp:Label></td>
                <td class="auto-style2">
                    <asp:Label ID="lblMinSWPInstallment" runat="server" CssClass="lbl lblOrderEntry lbl-amount-fields"></asp:Label>
                </td>
            </tr>
            <tr id="trSIPFrequency" runat="server" visible="false">
                <td class="auto-style1">
                    <asp:Label ID="Label6" runat="server" CssClass="lblOrderEntry" Text="Frequency"></asp:Label></td>
                <td class="auto-style2">
                    <%--<Prachi>--added on 18-Feb-2020 as told by Krishna Sir/Roshan D. to fetch frequency from Common Data--JIRA Ref: BNPINT-413--<Start>--%>
                    <asp:DropDownList ID="ddlSIPFrequency" runat="server" CssClass="ddl lblOrderEntry" Width="170px">
                        <%-- <asp:ListItem Text="Weekly" Value="Weekly" />
                        <asp:ListItem Text="Monthly" Value="Monthly" />
                        <asp:ListItem Text="Quarterly" Value="Quarterly" />
                        <asp:ListItem Text="Semi Anually" Value="Semi Anually" />
                        <asp:ListItem Text="Anually" Value="Anually" />--%>
                    </asp:DropDownList>
                    <%--<Prachi>--added on 18-Feb-2020 as told by Krishna Sir/Roshan D. to fetch frequency from Common Data--JIRA Ref: BNPINT-413--<End>--%>
                </td>
            </tr>
            <tr id="trSIPStartDate" runat="server" visible="false">
                <td class="auto-style1">
                    <asp:Label ID="Label7" runat="server" CssClass="lblOrderEntry" Text="Start Date"></asp:Label></td>
                <td class="auto-style2">
                    <uc1:DateControl ID="txtSIPStartDate" runat="server" CalenderCss="btn1" TextBoxCss="txt" DoPostBack="false" TextBoxSize="146px" />
                </td>
            </tr>
            <tr id="trSIPMaturityDate" runat="server" visible="false">
                <td class="auto-style1">
                    <asp:Label ID="Label9" runat="server" CssClass="lblOrderEntry" Text="End Date"></asp:Label></td>
                <td class="auto-style2">
                    <uc1:DateControl ID="txtSIPEndDate" runat="server" CalenderCss="btn1" TextBoxCss="txt" DoPostBack="false" TextBoxSize="146px" />
                </td>
            </tr>
            <%--SIP Fields || END--%>

            <tr id="trSwitchingFund" runat="server" visible="false">
                <td class="auto-style1">
                    <asp:Label runat="server" ID="Label3" Text="Switching Fund" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2">
                    <ucFundsearch:FinIQ_FundsCode runat="server" ID="FinIQ_FundsCode" OnUC_FundDetails="FindFund_UC_FundDetails" />
                </td>
            </tr>
            <tr id="trSwitchingFundCode" runat="server" visible="false">
                <td class="auto-style1">
                    <asp:Label runat="server" ID="lblSwitchingFundCodeHeader" Text="Switching Fund Code" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2">
                    <asp:Label ID="lblSwitchingFundCode" runat="server" CssClass="lbl lblOrderEntry"></asp:Label>
                </td>
            </tr>
            <tr id="trMinHoldingCriteria" runat="server" visible="false">
                <td class="auto-style1">
                    <asp:Label ID="Label1" runat="server" CssClass="lblOrderEntry" Text="Min Amount To Hold"></asp:Label></td>
                <td class="auto-style2">
                    <asp:Label ID="lblMinHoldingCriteria" runat="server" CssClass="lbl lblOrderEntry lbl-amount-fields"></asp:Label>
                </td>
            </tr>
            <tr id="trTradeDate" runat="server" visible="false">
                 <td class="auto-style1">
                    <asp:Label runat="server" ID="lblTradeDate" Text="Trade Date" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2">
                    <uc1:DateControl ID="txtTradeDate" runat="server" CalenderCss="btn1" TextBoxCss="txt" DoPostBack="false" TextBoxSize="146px" />
                </td>
            </tr>
            <tr>
                <td class="auto-style1">
                    <asp:Label runat="server" ID="lblNominalAmount" Text="Nominal Amount" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2">
                    <asp:TextBox ID="txtNominalAmount" runat="server" CssClass="txt lblOrderEntry txt-amount-fields" Width="170px" AutoPostBack="true"/> <%--onkeypress="ShowOnlyBottomLine(this)"--%>
                </td>
            </tr>
            <tr id="trUnits" runat="server">
                <td class="auto-style1">
                    <asp:Label runat="server" ID="lblUnits" Text="Units" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2">
                    <asp:TextBox ID="txtUnits" runat="server" CssClass="txt lblOrderEntry txt-amount-fields" AutoPostBack="true" Width="170px"></asp:TextBox>
                </td>
            </tr>
            <tr id="trSwitchingFundNAV" runat="server" style="display: none">
                <td class="auto-style1">
                    <asp:Label runat="server" ID="Label2" Text="Switching Fund NAV" CssClass="lblOrderEntry"></asp:Label>
                </td>
                <td class="auto-style2">
                    <asp:TextBox ID="txtSwitchingFundNAV" runat="server" CssClass="txt lblOrderEntry txt-amount-fields" Width="170px" Enabled="false"></asp:TextBox>
                </td>
            </tr>            
            <tr>
          <%--      <td class="auto-style1">
                    </td>--%>
                <td class="auto-style2" style="padding-left:20px;padding-top:10px" colspan ="2">
                    <table id="tblButtons" runat ="server" cellpadding="5" cellspacing="2" >
                    <tr>
                        <td >
                        <asp:Button ID="btn_SuitabilityCheck" runat="server" Text="Suitability Check" CssClass="btn lblOrderEntry" Style="width: 125px !important" /></td>
                            <td>
                        <asp:Button ID="btn_CreditCheck" runat="server" Text="Credit Check" CssClass="btn lblOrderEntry" Style="width: 125px !important" /></td>
                            <td>
                        <asp:Button ID="btnBookOrder" runat="server" Text="Place Order" CssClass="btn lblOrderEntry" Style="width: 125px !important" OnClientClick="BookOrderLoading();  randomNum();" /></td>
                           
                            <td>
                        <asp:Button ID="btn_pageClose" runat="server" Text="Close" CssClass="btn lblOrderEntry" Style="width: 125px !important" />
                            </td>
                         <td>
                         <div id="DivBookOrderLoading" style="position: absolute"></div></td>
                    </tr>

                </table>

                    
                    <%--<input type="button" id="btnBookOrder" runat="server" style="width:120px !important" value="Book Order" class="btn lblOrderEntry" />--%>
                   
      <%--       </td>--%>

                <%--<td class="auto-style2" style="padding-left:33px;padding-top:10px">
                    <%--<asp:Button ID="btn_CreditCheck" runat="server" Text="Credit Check" CssClass="btn lblOrderEntry" Style="width: 120px !important" />--%>
                    <%--<input type="button" id="btnBookOrder" runat="server" style="width:120px !important" value="Book Order" class="btn lblOrderEntry" />--%>
                <%--    <div id="DivBookOrderLoading" style="position: absolute"></div>--%>
              <%--  </td>

                <td class="auto-style2" style="padding-left:33px;padding-top:10px">--%>
                    <%--<asp:Button ID="btn_SuitabilityCheck" runat="server" Text="Suitability Check" CssClass="btn lblOrderEntry" Style="width: 120px !important" />--%>
                    <%--<input type="button" id="btnBookOrder" runat="server" style="width:120px !important" value="Book Order" class="btn lblOrderEntry" />--%>
               <%--     <div id="DivBookOrderLoading" style="position: absolute"></div>--%>
              <%--  </td>

                <td class="auto-style2" style="padding-left:33px;padding-top:10px">--%>
                    <%--<asp:Button ID="btn_pageClose" runat="server" Text="Close" CssClass="btn lblOrderEntry" Style="width: 120px !important" />--%>
                    <%--<input type="button" id="btnBookOrder" runat="server" style="width:120px !important" value="Book Order" class="btn lblOrderEntry" />--%>
             <%--  <%--     <div id="DivBookOrderLoading" style="position: absolute"></div>--%>
                </td>

               
            </tr>
        


            <tr id="trLinkBtnMoreDetails" runat="server" visible="false">
                <td class="auto-style1">
                    <asp:LinkButton ID="lnkbtnMoreDetails" runat="server" Text="Less Details" CssClass="lblLink"></asp:LinkButton>
                </td>
            </tr>
            <tr><td></td></tr>
            <tr>
                <td class="auto-style1"></td>
                <td class="auto-style2">
                    <asp:Label ID="lblMessage" runat="server" CssClass="lblOrderEntry lblMessage" Style="white-space: pre-wrap;"></asp:Label>
                </td>
            </tr>
        </table>
        <asp:HiddenField ID="hdnCIFNumber" runat="server" Value="" />
        <asp:HiddenField ID="hdnCustomerID" runat="server" Value="" />
        <asp:HiddenField ID="hdnAccountNo" runat="server" Value="" />
        <asp:HiddenField ID="hdnCustomerName" runat="server" Value="" />

        <asp:HiddenField ID="hdnCashBal" runat="server" Value="" />
        <asp:HiddenField ID="hdnHolding" runat="server" Value="" />
        <asp:HiddenField ID="hdnProductId" runat="server" />
        <asp:HiddenField ID="hdnApplicationID" runat="server" Value="" />
        <asp:HiddenField ID="hdnDate" runat="server" Value="" />
        <asp:HiddenField ID="hdnFundCCY" runat="server" Value="" />
        <asp:HiddenField ID="hdnSettlementDate" runat="server" Value="" />
        <asp:HiddenField ID="hdnNMID" runat="server" Value="" />
        <asp:HiddenField ID="hdn_SchemeCode" runat="server" Value="" />
        <%--  Code Added By Dinesh On 21-Apr-2018 Demo--%>
        <asp:HiddenField ID="hdn_Note_Master_ID" runat="server" Value="" />
        <%--  Code Added By Dinesh On 21-Apr-2018 Demo--%>
        <asp:HiddenField ID="hdnNominalAmt" runat="server" Value="" />
        <asp:HiddenField ID="hdncustid" runat="server" />
        <asp:HiddenField ID="hdn_FacilityDescription" runat="server" Value="" />
        <%--  Code Added By Dinesh On 21-Apr-2018 Demo--%>
        <asp:HiddenField ID="hdn_FacilityType" runat="server" Value="" />
        <%--  Code Added By Dinesh On 21-Apr-2018 Demo--%>
        <asp:HiddenField ID="hdnSwitchingFundCode" runat="server" Value="" />
        <asp:HiddenField ID="hdnPurchaseAmount" runat="server" Value="" />
        <asp:HiddenField ID="hdnSwitchFromFundCode" runat="server" Value="" />
        <asp:HiddenField ID="hdnSwitchUnits" runat="server" Value="" />
        <asp:HiddenField ID="hdnSwitchingFundCcy" runat="server" Value="" />
        <asp:HiddenField ID="hdnToFundCcy" runat="server" />
        <asp:HiddenField ID="hdnIsKYCPassed" runat="server" />
        <asp:HiddenField ID="Hdn_DealerId" runat="server" /> 
        <asp:HiddenField ID="Hdn_DealerName" runat="server" /> 
         <asp:HiddenField ID="hdnBranchName" runat="server" />
           <asp:HiddenField ID="hdnTemplateId" runat="server" />
            <asp:HiddenField ID="hdnPTCheck" runat="server" />
            <asp:HiddenField ID="hdnNoteMasterId" runat="server" />
              <%--'Added By MohiniM || to pass logindetails to place order|| 7-Nov-2020 -Start--%>
                    <input type="hidden" id="hdnEntityID"  runat="server" />
                    <input type="hidden" id="hdnUserID" runat="server" />
                <%--'Added By MohiniM || to pass logindetails to place order|| 7-Nov-2020 -End--%>

            </ContentTemplate>
            </asp:UpdatePanel>
    </form>
</body>
</html>
