<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="Unit_Master.aspx.cs" Inherits="Neclog_3_0.Unit_Master" %>

<%@ Register Src="~/UserControls/ucSearchControl.ascx" TagName="ucSearchControl" TagPrefix="ucSearch" %>
<%@ Register TagPrefix="OBgrid" Namespace="Obout.Grid" Assembly="obout_Grid_NET" %>
<%@ Register TagPrefix="HtmlColor" Namespace="UNLV.IAP.WebControls" Assembly="UNLV.IAP.WebControls.HtmlColorDropDown" %>
<%@ Register Src="~/UserControls/ucAdminLoginControl.ascx" TagPrefix="ucRpt" TagName="ucAdminLoginControl" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function grdSearch_OnClientDblClick(recordIndex) {
            grdSearch_OnInternalClientDblClick(recordIndex);
            var cObj = document.getElementById("<%= btnEdit.ClientID%>");
            cObj.click();
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div class='divtable'>
        <asp:HiddenField ID="hdnRecordKeyId" runat="server" />
        <div class='form-box'>
            <div class="box box-success">
                <div class="box-header with-border">
                    <div class='row'>
                        <div class='col-md-7'>
                            <asp:Label ID="lblTitle" runat="server" class="box-title"></asp:Label>
                            <asp:HiddenField ID="hdnHeaderNote" Value="0" runat="server" />
                            <asp:HiddenField ID="hdnFooterNote" Value="0" runat="server" />
                        </div>
                        <div class='col-md-5' align="right">
                            <asp:UpdatePanel runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <asp:Button ID="btnSearch" runat="server" Text="Find" OnClick="SearchData" CssClass="myButton" CausesValidation="false" ToolTip="Find" />&nbsp;
                                    <asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="AddData" CssClass="myButton" CausesValidation="false" ToolTip="Add" />&nbsp;
                                    <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="SaveData" CssClass="myButton" ToolTip="Save" />&nbsp;
                                    <asp:Button ID="btnEdit" runat="server" Text="Edit" OnClick="btnEdit_Click" CssClass="myButton" ToolTip="Edit" />&nbsp;
                                    <asp:Button ID="btnDelete" runat="server" Text="Delete" OnClick="btnDelete_Click" OnClientClick="return validateDelete();" CssClass="myButton" CausesValidation="false" ToolTip="Delete" />&nbsp;
                                    <asp:Button ID="btnPrint" runat="server" Text="Print" OnClick="btnPrint_Click" CssClass="myButton" CausesValidation="false" ToolTip="Print" />
                                </ContentTemplate>
                                <Triggers>
                                    <asp:PostBackTrigger ControlID="btnPrint" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </div>
                    </div>
                </div>
                <!-- /.box-header -->
                <!-- form start -->

                <div class="form-horizontal">
                    <div class="box-body" id="divFormContent" runat="server">
                        <div class="form-group">
                            <asp:Label Text="Unit Name*" CssClass="control-label col-sm-2" runat="server" />
                            <div class="col-sm-3">
                                <asp:TextBox ID="txtUnitName" MaxLength="20" CssClass="form-control" runat="server" />
                            </div>
                            <div class="col-sm-3">
                                <asp:RequiredFieldValidator ErrorMessage="Enter Unit Name" CssClass="text-alert" ControlToValidate="txtUnitName" Display="Dynamic" runat="server" />
                            </div>
                        </div>
                        <div class="form-group">
                            <asp:Label Text="Unit*" CssClass="control-label col-sm-2" runat="server" />
                            <div class="col-sm-3">
                                <asp:TextBox ID="txtUnit" MaxLength="5" CssClass="form-control" runat="server" />
                            </div>
                            <div class="col-sm-3">
                                <asp:Label Text="(E.g. º C, %RH )" CssClass="control-label" runat="server" />
                            </div>
                            <div class="col-sm-3">
                                <asp:RequiredFieldValidator ErrorMessage="Enter Unit" CssClass="text-alert" ControlToValidate="txtUnit" Display="Dynamic" runat="server" />
                            </div>
                        </div>
                        <div class="form-group">
                            <asp:Label Text="Unit Type*" CssClass="control-label col-sm-2" runat="server" />
                            <div class="col-sm-3">
                                <asp:TextBox ID="txtUnitType" MaxLength="2" CssClass="form-control" runat="server" />
                            </div>
                            <div class="col-sm-3">
                                <asp:Label Text="(E.g. T - Temperature, H - Humidity )" CssClass="control-label" runat="server" />
                            </div>
                            <div class="col-sm-3">
                                <asp:RequiredFieldValidator ErrorMessage="Enter Unit Type" CssClass="text-alert" ControlToValidate="txtUnitType" Display="Dynamic" runat="server" />
                            </div>
                        </div>
                    </div>
                </div>
                <div class="box-body" id="divSearchContent" runat="server" visible="false">
                    <ucSearch:ucSearchControl ID="ucSearch" runat="server" strSearchProcedurename="UnitMasterView"
                        strDelePrecedure="UnitMaster_Delete" strDeletekeys="0,-1" strDeleteColName="@hdnRecordKeyId,@sssUserId" blnOutParameter="true" strColWidth="0,60,20,20" />
                </div>
            </div>

        </div>
    </div>


</asp:Content>
