public string ApproveWorkHour(ApproveAndDenyJson data)
        {
            IEnumerable <WorkHour> result;
            UnitOfWork             uow = new UnitOfWork();

            TimeSheetManager timeSheetManager = new TimeSheetManager(uow);

            result = timeSheetManager.GetByDateAndTaskId(data.date, Guid.Parse(data.id)).ToList();


            foreach (var item in result)
            {
                if (timeSheetManager.IsUserOrganisationMnager(item, User.Identity.Name) && timeSheetManager.IsUserProjectMnager(item, User.Identity.Name) && item.WorkflowStage.Order == 2)
                {
                    for (int i = 0; i < 2; i++)
                    {
                        timeSheetManager.ApproveWorkHour(item);
                        HistoryUtilities.RegisterApproveHistory(data, item);
                    }
                }
                else
                {
                    timeSheetManager.ApproveWorkHour(item);
                    HistoryUtilities.RegisterApproveHistory(data, item);
                }
            }


            return("عملیات تایید با موفقیت انجام گردید");
        }
        public string DenyWorkHour(ApproveAndDenyJson data)
        {
            IEnumerable <WorkHour> result;
            UnitOfWork             uow = new UnitOfWork();
            TimeSheetManager       timeSheetManager = new TimeSheetManager(uow);

            result = timeSheetManager.GetByDateAndTaskId(data.date, Guid.Parse(data.id)).ToList();
            foreach (var item in result)
            {
                timeSheetManager.DenyWorkHour(item);
                HistoryUtilities.RegisterDenyHistory(data, item);
            }


            return("عملیات رد با موفقیت انجام گردید");
        }