<%@ Page Title="" Language="C#" MasterPageFile="~/MasterFile/TimeCheck.master" AutoEventWireup="true"
    CodeFile="TA_UI_TimeSheetEntry.aspx.cs" Inherits="Masters_TA_UI_TimeSheetEntry" EnableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ContentPlaceHolderID="BodyContentPH" ID="conEmployee" runat="server" onload="Pageload();">
    <!--[if gt IE 5.5]>
	<link rel="stylesheet" type="text/css" href="../css/anytimeIE.css" />
	<link rel="stylesheet" type="text/css" href="../css/ProgressforIE.css" />
 <![endif]-->
    <script>
        $(function () {
            $('#ctl00_BodyContentPH_txtShiftDate').datetimepicker({
                format: document.getElementById('ctl00_BodyContentPH_hdnShiftDateFormat').value
              
            }
            );
        });
        function DynamicDatePickerForTime(Format, txtBoxId) {
            $("#" + txtBoxId).datetimepicker({ format: "HH:mm" });
        }
        var xPos, yPos;
        var prm = Sys.WebForms.PageRequestManager.getInstance();

        //function BeginRequestHandler(sender, args) {
        //    if ($get('dvScroll') != null) {
        //        xPos = $get('dvScroll').scrollLeft;
        //        yPos = $get('dvScroll').scrollTop;
        //    }
        //}

        //function EndRequestHandler(sender, args) {
        //    if ($get('dvScroll') != null) {
        //        $get('dvScroll').scrollLeft = xPos;
        //        $get('dvScroll').scrollTop = yPos;
        //    }
        //}
        //prm.add_beginRequest(BeginRequestHandler);
        //prm.add_endRequest(EndRequestHandler);
    </script>
    <div class="content-header">
        <h1 style="background-image: url('../dist/img/emp-master.png'); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lbl_HeaderEmployeeMaster" runat="server" Text="Time Sheet Entry"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <div class="border-table new-space">
            <div class="row form-group">
                <div class="col-md-3">
                    <asp:HiddenField ID="hdnShiftDateFormat" runat="server" />
                    <asp:Label ID="lblShiftDate" runat="server" Text="Timesheet Date:"></asp:Label>
                </div>
                <div class="col-md-3">
                    <asp:TextBox onpaste="return true" ID="txtShiftDate" runat="server" CssClass="form-control"
                        EnableViewState="False" onCut="return false" onDrop="return false">
                    </asp:TextBox>
                </div>
            </div>
            <div class="row form-group">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:HiddenField ID="hiddenTime" runat="server" Value="%I:%M:%S %p" />
                        <div class="col-md-12" id="dvScroll">
                            <asp:GridView ID="gvTaskEntry" runat="server" Width="100%" AutoGenerateColumns="false" HeaderStyle-Font-Size="14px" RowStyle-Font-Size="14px"
                                HeaderStyle-Height="50" FooterStyle-Height="50" CssClass="table das-table1"
                                ShowFooter="true" OnRowCommand="gvTaskEntry_RowCommand" OnRowDeleting="gvTaskEntry_RowDeleting"
                                OnRowDataBound="gvTaskEntry_RowDataBound" OnRowUpdating="gvTaskEntry_RowUpdating"
                                OnRowCancelingEdit="gvTaskEntry_RowCancelingEdit" OnRowEditing="gvTaskEntry_RowEditing">
                                <Columns>
                                    <asp:TemplateField HeaderText="Project Name" HeaderStyle-BackColor="#d9f0fb" HeaderStyle-ForeColor="black" FooterStyle-Width="500px">
                                        <ItemTemplate>
                                            <asp:Label ID="lblProjectName" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Project_Name") %>' Style="padding: 0px 5px;"></asp:Label>
                                            <asp:Label Style="display: none" ID="lblProjectID" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "ProjectID") %>'></asp:Label>
                                            <asp:Label Style="display: none" ID="lblProjectTaskID" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "TaskDetailID") %>'></asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:DropDownList runat="server" ID="ddlProjectNameEdit" AutoPostBack="true" Width="500px"
                                                CssClass="form-control select2">
                                                <asp:ListItem Text="-Select-" Value="0"></asp:ListItem>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <FooterTemplate>
                                            <asp:DropDownList runat="server" ID="ddlProjectNameAdd" AutoPostBack="true" Width="300px"
                                                CssClass="form-control select2" OnSelectedIndexChanged="ddlProjectNameAdd_SelectedIndexChanged" Style="width: 500px">
                                                <asp:ListItem Text="-Select-" Value="0"></asp:ListItem>
                                            </asp:DropDownList>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Task List" HeaderStyle-BackColor="#d9f0fb" HeaderStyle-ForeColor="black" FooterStyle-Width="500px">
                                        <ItemTemplate>
                                            <asp:Label ID="lblTaskList" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "TaskName") %>'></asp:Label>

                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:DropDownList runat="server" ID="ddlTaskListEdit" AutoPostBack="true" Width="300px"
                                                CssClass="form-control select2" Style="width: 300px">
                                                <asp:ListItem Text="-Select-" Value="0"></asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:Label Style="display: none" ID="lblTaskID" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "TaskID") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <FooterTemplate>
                                            <asp:DropDownList runat="server" ID="ddlTaskListAdd" AutoPostBack="true" Width="300px"
                                                CssClass="form-control select2" OnSelectedIndexChanged="ddlTaskListAdd_SelectedIndexChanged" Style="width: 300px">
                                                <asp:ListItem Text="-Select-" Value="0"></asp:ListItem>
                                            </asp:DropDownList>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Defined Hours" HeaderStyle-BackColor="#d9f0fb" HeaderStyle-ForeColor="black">
                                        <ItemTemplate>
                                            <asp:Label ID="lbldefinedHoursView" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "TaskHours") %>' Style="text-align: center"></asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:Label ID="lbldefinedHoursEdit" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "TaskHours") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <FooterTemplate>
                                            <asp:Label ID="lbldefinedHoursAdd" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "TaskHours") %>'></asp:Label>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Task Description" HeaderStyle-BackColor="#d9f0fb" HeaderStyle-ForeColor="black">
                                        <ItemTemplate>
                                            <asp:Label ID="lblTaskDescription" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "TaskDescription") %>' Style="padding: 0px 5px;" TextMode="MultiLine"></asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox onCut="return false" onDrop="return false" ID="txtedit_TaskDesc" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "TaskDescription") %>' TextMode="MultiLine" Style="height: 30px; width: 300px; resize: none"></asp:TextBox>
                                        </EditItemTemplate>
                                        <FooterTemplate>
                                            <asp:TextBox onCut="return false" onDrop="return false" ID="txtadd_TaskDesc" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "TaskDescription") %>' TextMode="MultiLine" Style="height: 30px; width: 300px; resize: none"></asp:TextBox>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Spent Hours" HeaderStyle-BackColor="#d9f0fb" HeaderStyle-ForeColor="black" HeaderStyle-Width="100">
                                        <ItemTemplate>
                                            <asp:Label ID="lblSpentHours" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SpentHours") %>' Style="padding: 0px 5px;"></asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox onCut="return false" onDrop="return false" ID="txtEditSpentHours" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SpentHours") %>' Style="height: 30px; width: 80px"></asp:TextBox>
                                        </EditItemTemplate>
                                        <FooterTemplate>
                                            <asp:TextBox onCut="return false" onDrop="return false" ID="txtaddSpentHours" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SpentHours") %>' Style="height: 30px; width: 80px"></asp:TextBox>
                                        </FooterTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Spent Hours" Visible="false" HeaderStyle-BackColor="#d9f0fb" HeaderStyle-ForeColor="black" HeaderStyle-Width="100">
                                        <ItemTemplate>
                                            <asp:Label ID="lblSpentMinuts" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SpentMinuts") %>' Style="padding: 0px 5px;"></asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:Label ID="lblSpentMinuts1" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SpentMinuts") %>' Style="padding: 0px 5px;"></asp:Label>
                                        </EditItemTemplate>
                                        <FooterTemplate>
                                            <asp:Label ID="lblSpentMinuts2" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SpentMinuts") %>' Style="padding: 0px 5px;"></asp:Label>
                                        </FooterTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Action" HeaderStyle-BackColor="#d9f0fb" HeaderStyle-ForeColor="black" ItemStyle-Width="100px">
                                        <ItemTemplate>
                                            &nbsp;&nbsp;<asp:LinkButton ID="imgbtnEdit" runat="server" Font-Size="16px" CommandName="Edit" Text="Edit"></asp:LinkButton>
                                            &nbsp;&nbsp;<asp:Label ID="lblbackslash" runat="server" Text="/"></asp:Label>
                                            &nbsp;&nbsp;<asp:LinkButton ID="imgbtnDelete" runat="server" Font-Size="16px" CommandName="Delete" Text="Delete"></asp:LinkButton>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            &nbsp;&nbsp;<asp:LinkButton ID="imgbtnUpdate" runat="server" Font-Size="16px" CommandName="Update" Text="&nbsp;&nbsp;Update"></asp:LinkButton>
                                            <asp:Label ID="lblbackslash1" runat="server" Text="/"></asp:Label>
                                            <asp:LinkButton ID="imgbtnCancel" runat="server" Font-Size="16px" CommandName="Cancel" Text="&nbsp;&nbsp;Cancel"></asp:LinkButton>
                                        </EditItemTemplate>
                                        <FooterTemplate>
                                            <asp:LinkButton ID="lbtnAdd" runat="server" Font-Size="16px" Style="vertical-align: central; display: table-row; text-align: center" CommandName="ADD" Text="&nbsp;&nbsp;Add" Width="100px"></asp:LinkButton>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="pull-right-button">
                        <asp:LinkButton ID="btn_add" CssClass="btn add-btn fa-plus" runat="server" Text="&nbsp;&nbsp;Submit" OnClick="btn_add_Click" />
                        <asp:LinkButton ID="btnReset" CssClass="btn add-btn fa-undo" runat="server" Text="&nbsp;&nbsp;Reset" style="display:none" OnClick="btnReset_Click" />
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
