<%@ Page Title="" Language="C#" MasterPageFile="~/Application.Master" AutoEventWireup="true" CodeBehind="Equipments_RTC.aspx.cs" Inherits="ICDAS_3_0_Web_App.ICDAS_3_0.Configuration.Equipments_RTC" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <%@ Register Src="~/User_Controls/ucSearchGrid.ascx" TagPrefix="ucSearchGrid" TagName="ucSearchGrid" %>
    <%@ Register Src="~/User_Controls/ucDropDown.ascx" TagPrefix="ucDropDown" TagName="ucDropDown" %>
    <%@ Register Src="~/User_Controls/ucUserValidation.ascx" TagPrefix="ucValidate" TagName="ucUserValidation" %>

    <!--THIS SCRIPT IS USED FOR MAINTAINING SCROLL POSITION ON POSTBACK OF GRID-->
    <script type="text/javascript">
        // This Script is used to maintain Grid Scroll on Partial Postback
        var scrollTop;
        //Register Begin Request and End Request 
        Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        //Get The Div Scroll Position
        function BeginRequestHandler(sender, args) {
            var m = document.getElementById('AdjResultsDiv');
            scrollTop = m.scrollTop;
        }
        //Set The Div Scroll Position
        function EndRequestHandler(sender, args) {
            var m = document.getElementById('AdjResultsDiv');
            m.scrollTop = scrollTop;
        }
    </script>

    <style type="text/css">
        body {
            margin: 0;
            padding: 0;
            font-family: Arial;
        }

        .loadingmodal {
            position: fixed;
            z-index: 999 !important;
            height: 100%;
            width: 100%;
            top: 0;
            background-color: white;
            filter: alpha(opacity=60);
            opacity: 0.8;
            -moz-opacity: 1;
        }

        .loadingcenter {
            z-index: 1000 !important;
            width: 200px;
            height: 100px;
            position: absolute;
            left: 45%;
            top: 60%;
            margin-left: -150px;
            margin-top: -150px;
            opacity: 1;
            /*-moz-opacity: 1;*/
            background: url("Images/loading.gif") no-repeat;
        }
    </style>

</asp:Content>
<asp:Content ID="cotMain" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="upnlwzEquipmentRTC">
        <ProgressTemplate>
            <div class="loadingmodal">
                <div class="loadingcenter">
                </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="upnlwzEquipmentRTC" UpdateMode="Always" runat="server">
        <ContentTemplate>
            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="x_panel">
                        <div class="x_content">
                            <asp:HiddenField ID="hdnRecordId" Value="" runat="server" />
                            <asp:HiddenField ID="hdnRecordIds" Value="" runat="server" />
                            <asp:HiddenField ID="hdnEquipmentId" Value="" runat="server" />
                            <asp:HiddenField ID="hdnRowIndex" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnBusinessUnitId" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnBranchId" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnCompanyId" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnCancelRecordId" Value="" runat="server" />
                            <asp:HiddenField ID="hdnComments" runat="server" />
                            <asp:HiddenField ID="hdnEquipmentMasterWriteId" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnParameterNo" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnParameterType" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnParameterLabel" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnParameterValue" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnParameterStatus" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnParameterCode" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnModbusAddress" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnParameterTypeCancel" Value="0" runat="server" />
                            <div class="x_title">
                                <h4>
                                    <asp:Label ID="lblFormTitle" runat="server"></asp:Label></h4>
                                <div class="clearfix"></div>
                            </div>
                            <div id="wizard" class="form_wizard wizard_horizontal">
                                <ul class="wizard_steps">
                                    <li>
                                        <a runat="server" id="aStep1" class="selected">
                                            <span class="step_no">1</span>
                                            <small>Search Records</small>
                                            </span>
                                        </a>
                                    </li>
                                    <li>
                                        <a runat="server" id="aStep2" class="disabled">
                                            <span class="step_no">2</span>
                                            <small>Equipment Write status</small>
                                            </span>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                            <div class="col-xs-12 col-sm-12 col-lg-12">
                                <asp:Wizard ID="wzMain" CssClass="col-sm-12" DisplaySideBar="false" OnActiveStepChanged="wzMain_ActiveStepChanged"
                                    runat="server" class="form_wizard wizard_horizontal">
                                    <WizardSteps>
                                        <asp:WizardStep ID="Step0" runat="server">
                                            <div class="row" runat="server" id="idTimerType" visible="false">
                                                <div class="col-xs-10 col-sm-10 col-lg-4">
                                                    <div class="input-group">
                                                        <span class="input-group-addon">Reset Timer</span>
                                                        <asp:RadioButtonList ID="rdBtn" runat="server" CssClass="form-control" RepeatDirection="Horizontal">
                                                            <asp:ListItem Value="LUXT" Selected="True" style="margin: 0 10px 0 10px;">LUX</asp:ListItem>
                                                            <asp:ListItem Value="UVT" style="margin: 0 10px 0 10px;">UV</asp:ListItem>
                                                            <asp:ListItem Value="Both" style="margin: 0 10px 0 10px;">Both</asp:ListItem>
                                                        </asp:RadioButtonList>
                                                    </div>
                                                </div>
                                            </div>

                                            <ucSearchGrid:ucSearchGrid runat="server" ID="ucSearchGrid" strCellClick="Y" strheadercbx="N" />
                                            <br />
                                            <ucValidate:ucUserValidation runat="server" ID="ucUserValidation" strButtonText="Reset" RemoveValidation="true" />
                                        </asp:WizardStep>
                                        <asp:WizardStep ID="Step1" runat="server">

                                            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                                                <div class="row">
                                                    <div class="col-xs-12 col-sm-12 col-lg-12">
                                                        <table id="tblHeader0" runat="server" class="table table-bordered dt-responsive nowrap" style="overflow: auto; position: relative; width: 100%; background-color: lightgray;">
                                                            <tr>
                                                                <td style="width: 3%; text-align: center; display: none;"></td>
                                                                <td style="width: 23%; text-align: center"><strong>Equipment Name</strong></td>
                                                                <td style="width: 15%; text-align: center"><strong>Write Date Time</strong></td>
                                                                <td style="width: 20%; text-align: center"><strong>Parameter Label</strong></td>
                                                                <td style="width: 15%; text-align: center"><strong>Parameter Value</strong></td>
                                                                <td style="width: 7%; text-align: center"><strong>Status</strong></td>
                                                                <td style="width: 17%; text-align: center"><strong>Status Description</strong></td>
                                                            </tr>
                                                        </table>
                                                    </div>
                                                    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                                                        <asp:UpdatePanel runat="server">
                                                            <ContentTemplate>
                                                                <div id="AdjResultsDiv" onscroll="SetDivPosition()" runat="server" style="overflow: auto; overflow-x: hidden; height: 350PX;">
                                                                    <asp:GridView ID="grdWriteEvents" runat="server" ShowHeaderWhenEmpty="true" CellPadding="0" CellSpacing="0"
                                                                        AllowPaging="false" AllowSorting="false" AutoGenerateColumns="False"
                                                                        CssClass="table table-striped table-bordered dt-responsive nowrap"
                                                                        ShowHeader="false">
                                                                        <HeaderStyle CssClass="bg-success" />
                                                                        <EmptyDataRowStyle HorizontalAlign="Center" />
                                                                        <EmptyDataTemplate>
                                                                            No Records Found
                                                                        </EmptyDataTemplate>
                                                                        <Columns>
                                                                            <asp:BoundField DataField="EquipmentMasterId" HeaderText="EquipmentMaster Id">
                                                                                <HeaderStyle CssClass="hidden txtalign" />
                                                                                <ItemStyle CssClass="hidden" />
                                                                            </asp:BoundField>
                                                                            <asp:BoundField DataField="EquipmentMasterWriteId" HeaderText="EquipmentMasterWrite Id">
                                                                                <HeaderStyle CssClass="hidden txtalign" />
                                                                                <ItemStyle CssClass="hidden" />
                                                                            </asp:BoundField>
                                                                            <asp:TemplateField ControlStyle-CssClass="widthchk" Visible="false">
                                                                                <ItemTemplate>
                                                                                    <asp:CheckBox ID="chkEditAccess" runat="server" AutoPostBack="true" OnCheckedChanged="chkAccess_CheckedChanged"></asp:CheckBox>
                                                                                </ItemTemplate>
                                                                                <ItemStyle Width="3%" />
                                                                            </asp:TemplateField>
                                                                            <asp:BoundField DataField="EquipmentName" HeaderText="Equipment Name">
                                                                                <ItemStyle Width="23%" />
                                                                            </asp:BoundField>
                                                                            <asp:BoundField DataField="LogDatetime" HeaderText="Write Date Time">
                                                                                <ItemStyle Width="15%" />
                                                                            </asp:BoundField>
                                                                            <asp:BoundField DataField="SettingParameterLabel" HeaderText="Parameter Label">
                                                                                <ItemStyle Width="20%" />
                                                                            </asp:BoundField>
                                                                            <asp:BoundField DataField="SettingParameterValue" HeaderText="Parameter Value">
                                                                                <ItemStyle Width="15%" />
                                                                            </asp:BoundField>
                                                                            <asp:BoundField DataField="Status" HeaderText="Status">
                                                                                <ItemStyle Width="7%" />
                                                                            </asp:BoundField>
                                                                            <asp:BoundField DataField="StatusDescription" HeaderText="Status Description">
                                                                                <ItemStyle Width="17%" />
                                                                            </asp:BoundField>
                                                                            <asp:BoundField DataField="CompanyId" HeaderText="Company Id">
                                                                                <HeaderStyle CssClass="hidden txtalign" />
                                                                                <ItemStyle CssClass="hidden" />
                                                                            </asp:BoundField>
                                                                        </Columns>
                                                                    </asp:GridView>
                                                                </div>
                                                                <div class="center-block" style="text-align: center;">
                                                                    <asp:Button CssClass="alert-danger btn btn-success btn-sm" runat="server" ID="btnCancel" Text="Cancel" OnClick="btnCancel_Click" Visible="false" />
                                                                    <asp:Button CssClass="btn btn-success btn-sm" runat="server" ID="btnRefresh" Text="Refresh" OnClick="btnRefresh_Click" ToolTip="Refresh" />
                                                                </div>
                                                            </ContentTemplate>
                                                        </asp:UpdatePanel>
                                                    </div>
                                                </div>
                                                <br />
                                                <br />

                                            </div>
                                        </asp:WizardStep>
                                    </WizardSteps>
                                    <StartNavigationTemplate>
                                        <br />
                                        <asp:Button ID="NextButton" Visible="false" formnovalidate="false" runat="server" Text="Save" CommandName="MoveNext" CssClass="btn btn-primary btn-sm" />
                                    </StartNavigationTemplate>
                                    <FinishNavigationTemplate>
                                        <asp:Button ID="btnPrevious" runat="server" formnovalidate="true" Text="Previous" CssClass="btn btn-success btn-sm" ToolTip="MOVE BACK TO PREVIOUS SCREEN" CommandName="MovePrevious" CausesValidation="false" />
                                    </FinishNavigationTemplate>
                                </asp:Wizard>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

