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

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Product Watch</title>
    <link href="../FinIQJS/jquery-ui.css" rel="stylesheet" />
    <script src='<%=ResolveClientUrl("~/FinIQJS/external/jquery/jquery.js")%>'></script>
    <script src='<%=ResolveClientUrl("~/FinIQJS/jquery-ui.js")%>'></script>
    <link href="../App_Themes/Style1.css" rel="stylesheet" type="text/css" />
    <script src="../FinIQJS/FinIQCommon.js" type="text/javascript"></script>
    <script src="RMW.js"></script>

    <script type="text/javascript">
        function RefreshParent() {
            debugger;
            var rowIndex = '';
            var url = window.location.search.substring(1);
            var vars = url.split('&');
            for (var i = 0; i < vars.length; i++) {
                var pair = vars[i].split('=');
                if (decodeURIComponent(pair[0]) == 'RowIndex') {
                    decodeURIComponent(pair[1]);
                }
            }
            rowIndex = pair[1];

            if (rowIndex < 10)
                rowIndex = "0" + rowIndex;

            window.parent.$('#div' + rowIndex).slideToggle();
            
            //window.parent.document.getElementById('ctl00_MainContent_dlProductPriceDetails_ctl' + rowIndex + '_imghollowwatchproduct').style.display = "none";

            ////window.parent.document.getElementById('ctl00_MainContent_dlProductPriceDetails_ctl' + rowIndex + '_lblMarketPrice').innerHTML = document.getElementById('lblCurrentPrice').innerHTML;

            //if (document.getElementById('rblwatchtypes').value.trim().toUpperCase() == 'PRICE_UP') {
            //    window.parent.document.getElementById('ctl00_MainContent_dlProductPriceDetails_ctl' + rowIndex + '_imggreenwatchproduct').style.display = "block";
            //}
            //else {
            //    window.parent.document.getElementById('ctl00_MainContent_dlProductPriceDetails_ctl' + rowIndex + '_imgredwatchproduct').style.display = "block";
            //}

            window.parent.document.getElementById('ctl00_MainContent_btnLoad').click();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>

        <asp:UpdatePanel ID="upProductWatch" runat="server">
            <ContentTemplate>
                <asp:Panel ID="pnwatchproduct" runat="server" Style="width: 400px; height: 300px;" BorderStyle="Solid" BorderWidth="1px" BorderColor="#aaaaaa" BackColor="White">
                <table cellpadding="5" cellspacing="5">
                    <tr style="display:none">
                        <td colspan="2" align="right">
                            <asp:Button ID="btnclosewatchpopup" runat="server" Text="X" CssClass="btn" />
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblproduct" runat="server" Text="Product" Style="padding-left: 5px !important;"></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="lblproductname" runat="server" Text="" Style="padding-left: 10px !important;"></asp:Label>
                        </td>
                    </tr>
                    <tr style="display:none">
                        <td>
                            <asp:Label ID="Label26" runat="server" Text="Holdings" Style="padding-left: 5px !important;"></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="lblholdings" runat="server" Text="" Style="padding-left: 10px !important;"></asp:Label>
                        </td>
                    </tr>
                    <tr style="display:none">
                        <td>
                            <asp:Label ID="lblwac" runat="server" Text="WAV Cost" Style="padding-left: 5px !important;"></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="lblwavcost" runat="server" Text="" Style="padding-left: 10px !important;"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label1" runat="server" Text="Market Price" Style="padding-left: 5px !important;"></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="lblCurrentPrice" runat="server" Text="" Style="padding-left: 10px !important;"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label27" runat="server" Text="Watching" Style="padding-left: 5px !important;"></asp:Label>
                        </td>
                        <td>
                            <asp:RadioButtonList ID="rblactiveinactive" runat="server" RepeatDirection="Horizontal"
                                Style="padding-left: 10px !important;">
                                <asp:ListItem Text="Active" Value="Active" Selected="True"></asp:ListItem>
                                <asp:ListItem Text="Inactive" Value="Inactive"></asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label28" runat="server" Text="Touched" Style="padding-left: 5px !important;"></asp:Label>
                        </td>
                        <td>
                            <asp:RadioButtonList ID="rbltouchedyn" runat="server" RepeatDirection="Horizontal"
                                Enabled="false">
                                <asp:ListItem Text="Yes" Value="Yes"></asp:ListItem>
                                <asp:ListItem Text="No" Value="No"></asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label29" runat="server" Text="Types" Style="padding-left: 5px !important;"></asp:Label>
                        </td>
                        <td>
                            <asp:RadioButtonList ID="rblwatchtypes" runat="server" RepeatDirection="Horizontal">
                                <%--<asp:ListItem Text="Profit" Value="Profit"></asp:ListItem>
                                <asp:ListItem Text="Loss" Value="Loss"></asp:ListItem>
                                <asp:ListItem Text="Reminder" Value="Reminder"></asp:ListItem>
                                <asp:ListItem Text="Re-Invest" Value="Re-Invest"></asp:ListItem>--%>
                                <asp:ListItem Text="Price(up)" Value="Price_Up"></asp:ListItem>
                                <asp:ListItem Text="Price(down)" Value="Price_Down"></asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbllevelpercentage" runat="server" Text="Watch Price : " CssClass="lbl"
                                Style="padding-left: 5px !important;"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtlevelpercentage" runat="server" Text="" Width="100px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label35" runat="server" Text="" CssClass="lbl"></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="lblerrormsgwatchproduct" runat="server" Text="" CssClass="lblerror"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label30" runat="server" Text="" CssClass="lbl"></asp:Label>
                        </td>
                        <td>
                            <asp:Button ID="btnsetwatch" runat="server" CssClass="btn" Text="Set New Watch" OnClientClick="ApplySetWatchFilterLoading();" />
                            <asp:Button ID="btnviewwatchhistory" runat="server" CssClass="btn" Style="margin-left: 10 px !important"
                                Text="Watch History" OnClientClick="ApplySetWatchFilterLoading();" Visible="false" />
                            <div id="DivApplySetWatchFilterLoading" style="position: absolute">
                            </div>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
