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

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <%@ Register Src="~/User_Controls/ucUserValidation.ascx" TagPrefix="ucValidate" TagName="ucUserValidation" %>
</asp:Content>
<asp:Content ID="cotMain" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="upnlwzRealTimeRunningHours" 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="hdnEquipmentId" Value="" runat="server" />
                            <asp:HiddenField ID="hdnCompanyCode" Value="" runat="server" />
                            <asp:HiddenField ID="hdnResetParameterName" Value="" runat="server" />
                            <asp:HiddenField ID="hdnRowIndex" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnHoursId" 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="hdnchkHoursId" 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>Running Hours</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">
                                                <div class="col-xs-12 col-sm-12 col-lg-5">
                                                    <div class="input-group">
                                                        <span class="input-group-addon">Equipment</span>
                                                        <asp:DropDownList runat="server" ID="ddlEquipmentList" CssClass="form-control" OnSelectedIndexChanged="ddlEquipmentList_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
                                                    </div>
                                                </div>
                                                <div class="col-xs-12 col-sm-12 col-lg-12">
                                                    <asp:Timer Interval="1000000" runat="server" ID="tmrRunningHours" Enabled="false" OnTick="tmrRunningHours_Tick"></asp:Timer>
                                                    <div id="dvInputStatus" runat="server">
                                                        <table border="1" style="width: 100%; font-weight: bold" class="text-center">
                                                            <th style="background-color: #28a067; text-align: center; display: none;">
                                                                <h3 runat="server" id="headDataAvailable" style="font-weight: bold; color: white">Component Running Hours</h3>
                                                                <h3 runat="server" id="headNoData" style="font-weight: bold; color: white">Component Running Hours Not Available!!</h3>
                                                            </th>
                                                            <tr>
                                                                <asp:GridView runat="server" ID="dtlstRunningHours" AutoGenerateColumns="False" CssClass="table table-bordered dt-responsive nowrap" CellPadding="1" CellSpacing="1" Width="100%" OnRowDataBound="dtlstRunningHours_RowDataBound"
                                                                    ShowHeader="true">
                                                                    <Columns>
                                                                        <asp:TemplateField>
                                                                            <ItemTemplate>
                                                                                <asp:Label runat="server" ID="lblEquipmentHoursId" Text='<%# Eval("EquipmentComponentRunningHoursId") %>' />
                                                                            </ItemTemplate>
                                                                            <HeaderStyle CssClass="hidden text-hide" />
                                                                            <ItemStyle CssClass="hidden" />
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField>
                                                                            <ItemTemplate>
                                                                                <asp:Label runat="server" ID="lblHoursId" Text='<%# Eval("ComponentRunningHoursId") %>' />
                                                                            </ItemTemplate>
                                                                            <HeaderStyle CssClass="hidden" />
                                                                            <ItemStyle CssClass="hidden" />
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderStyle-Width="3%" HeaderStyle-BackColor="LightGray" ItemStyle-Width="3%" ItemStyle-BackColor="#cdf9e4">
                                                                            <ItemTemplate>
                                                                                <asp:CheckBox runat="server" ID="chkReset" AutoPostBack="true" OnCheckedChanged="chkReset_CheckedChanged" />
                                                                            </ItemTemplate>

                                                                            <ItemStyle CssClass="text-center" />
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderStyle-Width="30%" HeaderText="Name" HeaderStyle-BackColor="LightGray" ItemStyle-Width="30%" ItemStyle-BackColor="#cdf9e4">
                                                                            <ItemTemplate>
                                                                                <asp:Label Text='<%# Eval("Name") %>' runat="server" ID="lblInputName" ForeColor="Black" />
                                                                            </ItemTemplate>

                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderStyle-Width="25%" HeaderText="Status" HeaderStyle-BackColor="LightGray" ItemStyle-Width="25%" ItemStyle-CssClass="text-center" ItemStyle-BackColor="#cdf9e4">
                                                                            <ItemTemplate>
                                                                                <asp:Label Text='<%# Eval("Value") %>' runat="server" ID="lblValue" ForeColor="white" />
                                                                            </ItemTemplate>
                                                                            <HeaderStyle CssClass="text-center text-capitalize" />
                                                                            <ItemStyle CssClass="text-center" />
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderStyle-Width="20%" HeaderText="Set Run Hours" HeaderStyle-BackColor="LightGray" ItemStyle-Width="20%" ItemStyle-CssClass="text-center" ItemStyle-BackColor="#cdf9e4">
                                                                            <ItemTemplate>
                                                                                <asp:Label Text='<%# Eval("SetRunHours") %>' runat="server" ID="lblSetRunHours" ForeColor="Black" />
                                                                            </ItemTemplate>
                                                                            <HeaderStyle CssClass="text-center text-capitalize" />
                                                                            <ItemStyle CssClass="text-center" />
                                                                        </asp:TemplateField>
                                                                        <asp:TemplateField HeaderStyle-Width="22%" HeaderText="Run Hours" HeaderStyle-BackColor="LightGray" ItemStyle-Width="22%" ItemStyle-CssClass="text-center" ItemStyle-BackColor="#cdf9e4">
                                                                            <ItemTemplate>
                                                                                <asp:Label Text='<%# Eval("RunHours") %>' runat="server" ID="lblRunHours" ForeColor="white" />
                                                                            </ItemTemplate>
                                                                            <HeaderStyle CssClass="text-center text-capitalize" />
                                                                            <ItemStyle CssClass="text-center" />
                                                                        </asp:TemplateField>
                                                                    </Columns>
                                                                </asp:GridView>
                                                            </tr>

                                                        </table>
                                                    </div>
                                                    <br />
                                                </div>
                                                <div class="col-xs-12 col-sm-12 col-lg-12">
                                                    <ucValidate:ucUserValidation runat="server" ID="ucUserValidation" strButtonText="Reset" RemoveValidation="false"/>
                                                </div>
                                            </div>
                                        </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="background-color: lightgray;">
                                                            <tr>
                                                                <td style="width: 3%; text-align: center; display: none;"></td>
                                                                <td style="width: 20%; 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: 20%; 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">
                                                        <div id="AdjResultsDiv" onscroll="SetDivPosition()" runat="server" style="height: 350px; overflow-y: auto; overflow-x: hidden;">
                                                            <asp:GridView ID="grdWriteEvents" runat="server" ShowHeaderWhenEmpty="true" CellPadding="0" CellSpacing="0"
                                                                AllowPaging="false" AllowSorting="true" AutoGenerateColumns="False"
                                                                CssClass="table table-striped table-bordered dt-responsive nowrap"
                                                                ShowHeader="false" EmptyDataText="No records Found">
                                                                <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="chkCancel" runat="server" AutoPostBack="true" OnCheckedChanged="chkAccess_CheckedChanged"></asp:CheckBox>
                                                                        </ItemTemplate>
                                                                        <ItemStyle Width="3%" />
                                                                    </asp:TemplateField>
                                                                    <asp:BoundField DataField="EquipmentName" HeaderText="Equipment Name">
                                                                        <ItemStyle Width="20%" />
                                                                    </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="20%" />
                                                                    </asp:BoundField>
                                                                    <asp:BoundField DataField="CompanyId" HeaderText="Company Id">
                                                                        <HeaderStyle CssClass="hidden txtalign" />
                                                                        <ItemStyle CssClass="hidden" />
                                                                    </asp:BoundField>
                                                                </Columns>
                                                            </asp:GridView>
                                                        </div>
                                                        <br />
                                                        <div class="col-md-12 col-sm-12 col-xs-12 col-lg-12">
                                                            <asp:TextBox ID="txtRunningHoursIds" runat="server" AutoCompleteType="Disabled" autocomplete="off" Style="display: none" />
                                                        </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>
                                                    </div>
                                                </div>
                                        </asp:WizardStep>
                                    </WizardSteps>
                                    <StartNavigationTemplate>
                                        <br />
                                        <asp:Button ID="NextButton" Visible="false" runat="server" Text="Continue" 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" />
                                    </FinishNavigationTemplate>
                                </asp:Wizard>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

        </ContentTemplate>

    </asp:UpdatePanel>
</asp:Content>

