public async Task<ActionResult> OtherDashboard()
        {
            try
            {
                if (_UtilitySession.Session != null)
                {


                    ViewBag.Name = _UtilitySession.Session.user.name;
                    string User_id = _UtilitySession.Session.user.id;
                    LabourOtherDetailDTO _LabourOtherDetailDTO = new LabourOtherDetailDTO();
                    _LabourOtherDetailDTO = await Task.Run(() => _Repository.getOtherDashboardData(DateTime.Now.AddDays(-10), DateTime.Now, ""));
                    _LabourOtherDetailDTO.PageSize = 5;
                    _LabourOtherDetailDTO.TotalCount = _LabourOtherDetailDTO._TimesheetEnqGridPostDTO.Count;

                    return View(_LabourOtherDetailDTO);
                }
                else
                {
                    return RedirectToAction("Index", "Home");
                }
            }
            catch (Exception e)
            {
                ViewBag.Error = e.ToString();
                return View();
            }
        }
        public async Task <ActionResult> Index(TimesheetENQPostDTO _TimesheetENQPostDTO)
        {
            try
            {
                if (_UtilitySession.Session != null)
                {
                    LabourOtherDetailDTO           _LabourOtherDetailDTO    = new LabourOtherDetailDTO();
                    List <TimesheetEnqGridPostDTO> _TimesheetEnqGridPostDTO = new List <TimesheetEnqGridPostDTO>();
                    ViewBag.Name = _UtilitySession.Session.user.name;
                    string User_id = _UtilitySession.Session.user.id;

                    ts_user _ts_user = new ts_user();
                    _ts_user = _UtilitySession.Session.user;
                    _TimesheetEnqGridPostDTO = await Task.Run(() => _Repository.setTimesheetEnqData(_TimesheetENQPostDTO, _ts_user));

                    _LabourOtherDetailDTO._TimesheetEnqGridPostDTO = _TimesheetEnqGridPostDTO;

                    return(View(_LabourOtherDetailDTO));
                }
                else
                {
                    return(RedirectToAction("Index", "Home"));
                }
            }
            catch (NullReferenceException e)
            {
                ViewBag.Error = e.ToString();
                return(View());
            }
        }
        public async Task <ActionResult> Index()
        {
            try
            {
                if (_UtilitySession.Session != null)
                {
                    TimesheetEntities _TimesheetEntities = new TimesheetEntities();

                    ViewBag.Name = _UtilitySession.Session.user.name;
                    string User_id = _UtilitySession.Session.user.id;
                    LabourOtherDetailDTO _LabourOtherDetailDTO = new LabourOtherDetailDTO();
                    _LabourOtherDetailDTO.user = _UtilitySession.Session.user;
                    _LabourOtherDetailDTO      = await Task.Run(() => _Repository.getEnquiryTimesheetData(User_id));

                    _LabourOtherDetailDTO.PageSize   = 5;
                    _LabourOtherDetailDTO.TotalCount = _LabourOtherDetailDTO._TimesheetEnqGridPostDTO.Count;
                    return(View(_LabourOtherDetailDTO));
                }
                else
                {
                    return(RedirectToAction("Index", "Home"));
                }
            }
            catch (Exception e)
            {
                ViewBag.Error = e.ToString();
                return(View());
            }
        }
        public async Task <ActionResult> AllCheckOut(string CheckoutTime)
        {
            LabourOtherDetailDTO _LabourOtherDetailDTO = new LabourOtherDetailDTO();

            if (_UtilitySession.Session != null)
            {
                ViewBag.Name = _UtilitySession.Session.user.name;
                List <TimesheetEnqGridPostDTO> _TimesheetEnqGridPostDTO = new List <TimesheetEnqGridPostDTO>();

                _UtilitySession.Session._TimesheetGridDTO = null;
                ts_user _ts_user = new ts_user();
                _ts_user = _UtilitySession.Session.user;
                _TimesheetEnqGridPostDTO = await Task.Run(() => _Repository.AllOtherCheckOut(_ts_user, CheckoutTime));

                _LabourOtherDetailDTO._TimesheetEnqGridPostDTO = _TimesheetEnqGridPostDTO;
                _LabourOtherDetailDTO.PageSize   = 5;
                _LabourOtherDetailDTO.TotalCount = _UtilitySession.Session._TimesheetGridDTO.Count;

                return(View(_LabourOtherDetailDTO));
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
        public async Task <ActionResult> IndividualCheckOut(int?empid, string checkOutTime)
        {
            LabourOtherDetailDTO _LabourOtherDetailDTO = new LabourOtherDetailDTO();

            if (_UtilitySession.Session != null)
            {
                ViewBag.Name = _UtilitySession.Session.user.name;
                List <TimesheetEnqGridPostDTO> _TimesheetEnqGridPostDTO = new List <TimesheetEnqGridPostDTO>();
                ts_user _ts_user = new ts_user();
                _ts_user = _UtilitySession.Session.user;
                _TimesheetEnqGridPostDTO = await Task.Run(() => _Repository.IndividualOtherCheckOut(_ts_user, empid, checkOutTime));

                return(View(_TimesheetEnqGridPostDTO));
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
        public async Task<ActionResult> GridViewOtherDashboard(string datepicker, string datepicker2, string com_no)
        {
            LabourOtherDetailDTO _LabourOtherDetailDTO = new LabourOtherDetailDTO();

            if (_UtilitySession.Session != null)
            {
                if (_UtilitySession.Session.Status == true)
                {
                    try
                    {
                        DateTime _fromdate = DateTime.ParseExact(datepicker.ToString(), "dd/MM/yyyy",
                                                CultureInfo.InvariantCulture);

                        DateTime _todate = DateTime.ParseExact(datepicker2, "dd/MM/yyyy", CultureInfo.InvariantCulture);

                        ViewBag.Name = _UtilitySession.Session.user.name;
                        string User_id = _UtilitySession.Session.user.id;
                        _LabourOtherDetailDTO.user = _UtilitySession.Session.user;
                        _LabourOtherDetailDTO._TimesheetEnqGridPostDTO = await Task.Run(() => _Repository.DashboardOtherForProjectEngineers(_fromdate, _todate, com_no));
                        _LabourOtherDetailDTO.PageSize = 5;
                        _LabourOtherDetailDTO.TotalCount = _LabourOtherDetailDTO._TimesheetEnqGridPostDTO.Count;
                    }
                    catch (Exception ex)
                    {

                        throw;
                    }
                    return PartialView("_PartialViewGridOtherDashboard", _LabourOtherDetailDTO);
                }
                else
                {
                    return RedirectToAction("Detail", "Home");
                }
            }
            else
            {
                return RedirectToAction("Detail", "Home");
            }
        }