<%@ page language="C#" autoeventwireup="true" inherits="SystemDiagnosis, App_Web_systemdiagnosis.aspx.de3fb1ff" enableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/UserControls/iERPToolBar.ascx" TagName="iERPToolBar" TagPrefix="dsit" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head id="Head1" runat="server">
    <title>..:: ICDAS 2.1 ::..</title>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />

    <script type="text/javascript" language="javascript" src="../App_Include/JavaScript/js_functions.js"> </script>
    
    <script type="text/javascript" language="javascript" src="../App_Include/JavaScript/ScreenSaverStar.js"> </script>

    <link href="../App_Include/StyleSheet/Style.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" language="javascript">

        function resizeObject() {
            var w = getBrowserWindowSize().width;
            var h = getBrowserWindowSize().height - 5;
            //window.resizeTo(w, h);
            var cObj = document.getElementById("divChildBody");
            if (cObj != null) {
                //cObj.style.height = parseInt((h*79)/100) +"px";
                cObj.style.height = (parseInt(h) - 10) + "px";
                //cObj.style.width = parseInt(w) +"px";
            }

            cObj = document.getElementById("tabInstrument");
            if (cObj != null) {
                cObj.style.height = (parseInt(h) - 180) + "px";
            }

            cObj = document.getElementById("<%#tabInstrumentList.ClientID%>");
            if (cObj != null) {
                cObj.style.height = (parseInt(h) - 130) + "px";
            }
            hideWait();

        }

        function validateRecord() {
            var doc = document.forms[0];
            if (confirm("DO YOU WANT TO RESTART THE LOCAL SEVICE ?"))
            {
                if (doc.cmbBusinessUnitId.selectedIndex == 0) {
                    alert("Select BusninessUnit...");
                    doc.cmbBusinessUnitId.focus();
                    return false;
                }
            }
            else
            {
                    return false;
            }
        }
        
        function CheckValidation()
        {
         
            if (confirm("DO YOU WANT TO RESTART THE SERVER SEVICE ?"))
            {
                 return true;    
            }
            else 
            {
                 return false;
            }
        }
        			
    </script>

</head>
<body bottommargin="0" leftmargin="0" topmargin="0" rightmargin="0" onload="resizeObject(); resizeHolder(); init(); initScreenSaver('1',<%=Session["AutoLogOutTime"]%>);">
    <form id="Form1" runat="server" class="formbg">
    <asp:ToolkitScriptManager runat="Server" EnablePartialRendering="true" AsyncPostBackTimeout="0"
        ID="ToolkitScriptManager1" />
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="left" class="formbg">
        <tr>
            <td valign="top" align="left">
                <div id="divMainBody" align="center" runat="server" width="100%" height="100%">
                    <asp:UpdatePanel ID="uplChildBody" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:HiddenField ID="hdnRecordKeyId" runat="server" Value="0" />
                            <asp:HiddenField ID="hdnRecordIds" runat="server" Value="" />
                            <asp:HiddenField ID="hdnUserId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnBusinessUnitId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnBranchId" runat="server" Value="" />
                            <asp:HiddenField ID="hdnServerServiceStatus" runat="server" Value="" />
                            <table style="width: 100%; table-layout: fixed;">
                                <tr>
                                    <td class="headerbg" align="left" style="border-style: none; height: 26px; width: 100%;
                                        position: absolute; left: 1px; top: 8px;">
                                        <asp:Label ID="lblCaption" runat="server" Text="System Diagnosis" Width="100%" Font-Bold="true"
                                            Font-Names="Tahoma" ForeColor="AntiqueWhite" Font-Size="Medium"></asp:Label>
                                    </td>
                                </tr>
                                <tr height="45px">
                                    <td>
                                        &nbsp
                                    </td>
                                </tr>
                            </table>
                            <div id="divChildBody" runat="server" style="overflow: auto; width: 99%;">
                                <table width="100%" border="0" cellspacing="1" cellpadding="1" align="center">
                                    <tr>
                                        <td>
                                            <table width="100%" align="left" cellpadding="1" cellspacing="0" class="tablefont">
                                                <tr class="whitebg">
                                                    <td align="left" valign="middle">
                                                        <asp:ImageButton ID="imgbtnStartStop" runat="server" ImageUrl="~/Images/Stop.png"
                                                            Height="29" Width="67" ToolTip="Stop Diagnosis" OnClick="imgbtnStartStop_Click" />
                                                        &nbsp;<asp:ImageButton ID="imgBtnReset" runat="server" ImageUrl="~/Images/reset.png"
                                                            Height="29" Width="67" ToolTip="Reset" OnClick="imgBtnReset_Click" />
                                                        &nbsp;<asp:ImageButton ID="imgBtnStartStopServerService" runat="server" ImageUrl="~/Images/restartserverservice.png"
                                                            Height="29" Width="150" ToolTip="Restart Server Service" OnClick="imgBtnStartStopServerService_Click" OnClientClick="javascript:return CheckValidation();" />
                                                            &nbsp;<asp:DropDownList ID="cmbBusinessUnitId" runat="server"></asp:DropDownList>
                                                            <asp:ImageButton ID="imgBtnStartStopLocalService" runat="server" ImageUrl="~/Images/restartlocalservice.png"
                                                            Height="29" Width="150" ToolTip="Restart Local Service" OnClick="imgBtnStartStopLocalService_Click" OnClientClick="javascript:return validateRecord();"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <asp:UpdatePanel ID="upnlTimer1" UpdateMode="Conditional" runat="server">
                                                            <ContentTemplate>
                                                                <asp:TabContainer ID="tabInstrument" runat="server" ActiveTabIndex="0" ScrollBars="Auto"
                                                                    CssClass="tabCont">
                                                                    <asp:TabPanel ID="tabInstrumentList" runat="server" TabIndex="1">
                                                                        <HeaderTemplate>
                                                                            Equipment Status
                                                                        </HeaderTemplate>
                                                                        <ContentTemplate>
                                                                            <table class="tablebg" id="Table4" cellspacing="0" cellpadding="0" width="99%" border="0">
                                                                                <tr>
                                                                                    <td>
                                                                                        <asp:GridView ID="GVEquipmentDiagnosis" Width="100%" runat="server" CellPadding="0"
                                                                                            CellSpacing="0" AllowSorting="True" AutoGenerateColumns="False" AlternatingRowStyle-CssClass="DGR_ALTERNATE"
                                                                                            RowStyle-CssClass="DGR_ITEM" HeaderStyle-CssClass="DGR_HEADER" OnSorting="SortRecords"
                                                                                            OnRowDataBound="ItemDataBound" HeaderStyle-Height="25px" AllowPaging="false">
                                                                                            <HeaderStyle CssClass="DGR_FIXEDHEADER" />
                                                                                            <Columns>
                                                                                                <asp:TemplateField HeaderStyle-CssClass="DGR_HEADER">
                                                                                                    <HeaderTemplate>
                                                                                                    </HeaderTemplate>
                                                                                                    <ItemTemplate>
                                                                                                        <asp:CheckBox ID="chkRecordId" runat="server"></asp:CheckBox>
                                                                                                    </ItemTemplate>
                                                                                                    <ItemStyle HorizontalAlign="Center" Width="10px" CssClass="hiddencol" />
                                                                                                    <HeaderStyle HorizontalAlign="Center" Width="10px" CssClass="hiddencol" />
                                                                                                </asp:TemplateField>
                                                                                                <asp:BoundField DataField="EquipmentMasterId" HeaderText="EquipmentMasterId">
                                                                                                    <HeaderStyle CssClass="hiddencol"></HeaderStyle>
                                                                                                    <ItemStyle CssClass="hiddencol"></ItemStyle>
                                                                                                </asp:BoundField>
                                                                                                <asp:BoundField DataField="EquipmentName" HeaderText="Equipment Name">
                                                                                                    <HeaderStyle CssClass="DGR_HEADER"></HeaderStyle>
                                                                                                    <ItemStyle CssClass="" Width="15%"></ItemStyle>
                                                                                                </asp:BoundField>
                                                                                                <asp:BoundField DataField="EquipmentOnlineStatus" HeaderText="Online Status">
                                                                                                    <HeaderStyle CssClass="DGR_HEADER"></HeaderStyle>
                                                                                                    <ItemStyle CssClass="" Width="10%"></ItemStyle>
                                                                                                </asp:BoundField>
                                                                                                <asp:BoundField DataField="EquipmentOnlineStatusDescription" HeaderText="Online Status Desc.">
                                                                                                    <HeaderStyle CssClass="DGR_HEADER"></HeaderStyle>
                                                                                                    <ItemStyle CssClass="" Width="20%"></ItemStyle>
                                                                                                </asp:BoundField>
                                                                                                <asp:BoundField DataField="EquipmentLastLogDateTime" HeaderText="Last Log DateTime">
                                                                                                    <HeaderStyle CssClass="DGR_HEADER"></HeaderStyle>
                                                                                                    <ItemStyle CssClass="" Width="15%"></ItemStyle>
                                                                                                </asp:BoundField>
                                                                                                <asp:BoundField DataField="DataLogStatus" HeaderText="Data Log Status">
                                                                                                    <HeaderStyle CssClass="DGR_HEADER"></HeaderStyle>
                                                                                                    <ItemStyle CssClass="" Width="25%"></ItemStyle>
                                                                                                </asp:BoundField>
                                                                                                <asp:BoundField DataField="AlarmLogStatus" HeaderText="Alarm Log Status">
                                                                                                    <HeaderStyle CssClass="DGR_HEADER"></HeaderStyle>
                                                                                                    <ItemStyle CssClass="" Width="15%"></ItemStyle>
                                                                                                </asp:BoundField>
                                                                                                <asp:BoundField DataField="EquipmentStatus" HeaderText="Status">
                                                                                                    <HeaderStyle CssClass="hiddencol"></HeaderStyle>
                                                                                                    <ItemStyle CssClass="hiddencol"></ItemStyle>
                                                                                                </asp:BoundField>
                                                                                            </Columns>
                                                                                            <RowStyle CssClass="DGR_ITEM" />
                                                                                            <HeaderStyle CssClass="DGR_HEADER" />
                                                                                            <AlternatingRowStyle CssClass="DGR_ALTERNATE" />
                                                                                            <PagerStyle CssClass="DGR_PAGER"></PagerStyle>
                                                                                            <PagerSettings Position="TopAndBottom" />
                                                                                        </asp:GridView>
                                                                                    </td>
                                                                                </tr>
                                                                            </table>
                                                                        </ContentTemplate>
                                                                    </asp:TabPanel>
                                                                    <asp:TabPanel ID="TabPanel1" runat="server" TabIndex="1">
                                                                        <HeaderTemplate>
                                                                            Service Status
                                                                        </HeaderTemplate>
                                                                        <ContentTemplate>
                                                                            <table class="tablebg" id="Table3" cellspacing="0" cellpadding="0" width="99%" border="0">
                                                                                <tr>
                                                                                    <td>
                                                                                        <asp:GridView ID="GVServiceStatus" Width="100%" runat="server" CellPadding="0" CellSpacing="0"
                                                                                            AllowSorting="True" AutoGenerateColumns="False" AlternatingRowStyle-CssClass="DGR_ALTERNATE"
                                                                                            RowStyle-CssClass="DGR_ITEM" HeaderStyle-CssClass="DGR_HEADER" OnRowDataBound="GVServiceStatus_ItemDataBound"
                                                                                            HeaderStyle-Height="25px" AllowPaging="false">
                                                                                            <HeaderStyle CssClass="DGR_FIXEDHEADER" />
                                                                                            <Columns>
                                                                                                <asp:BoundField DataField="ServiceStatusId" HeaderText="ServiceStatusId">
                                                                                                    <HeaderStyle CssClass="hiddencol"></HeaderStyle>
                                                                                                    <ItemStyle CssClass="hiddencol"></ItemStyle>
                                                                                                </asp:BoundField>
                                                                                                <asp:BoundField DataField="ServiceStep" HeaderText="Service Step">
                                                                                                    <HeaderStyle CssClass="DGR_HEADER"></HeaderStyle>
                                                                                                    <ItemStyle CssClass="" Width="40%"></ItemStyle>
                                                                                                </asp:BoundField>
                                                                                                <asp:BoundField DataField="ServiceStepValue" HeaderText="Service Step Value">
                                                                                                    <HeaderStyle CssClass="DGR_HEADER"></HeaderStyle>
                                                                                                    <ItemStyle CssClass="" Width="60%"></ItemStyle>
                                                                                                </asp:BoundField>
                                                                                            </Columns>
                                                                                            <RowStyle CssClass="DGR_ITEM" />
                                                                                            <HeaderStyle CssClass="DGR_HEADER" />
                                                                                            <AlternatingRowStyle CssClass="DGR_ALTERNATE" />
                                                                                            <PagerStyle CssClass="DGR_PAGER"></PagerStyle>
                                                                                            <PagerSettings Position="TopAndBottom" />
                                                                                        </asp:GridView>
                                                                                    </td>
                                                                                </tr>
                                                                            </table>
                                                                        </ContentTemplate>
                                                                    </asp:TabPanel>
                                                                </asp:TabContainer>
                                                                <asp:Timer ID="Timer1" runat="server" Interval="5000" Enabled="true" OnTick="Timer1_Tick">
                                                                </asp:Timer>
                                                            </ContentTemplate>
                                                            <Triggers>
                                                                <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
                                                            </Triggers>
                                                        </asp:UpdatePanel>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </ContentTemplate>
                        <Triggers>
                        </Triggers>
                    </asp:UpdatePanel>
                </div>
            </td>
        </tr>
    </table>
    </form>

    <script type="text/javascript">

        var xPos, yPos;
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_beginRequest(BeginRequestHandler);
        prm.add_endRequest(EndRequestHandler);
        function BeginRequestHandler(sender, args) {
            xPos = $get('<%=divChildBody.ClientID %>').scrollLeft;
            yPos = $get('<%=divChildBody.ClientID %>').scrollTop;
        }
        function EndRequestHandler(sender, args) {
            $get('<%=divChildBody.ClientID %>').scrollLeft = xPos;
            $get('<%=divChildBody.ClientID %>').scrollTop = yPos;
        }
    </script>

</body>
</html>
