/// <summary>
        /// Create report WorkerReport
        /// </summary>
        /// <param name="viewName">viewName </param>
        /// <returns>List<ReportWorker></returns>
        public static List <ReportProject> CreateReportsProject(string viewName)
        {
            Func <MySqlDataReader, List <ReportProject> > func = (reader) =>
            {
                List <ReportProject> reportProject = new List <ReportProject>();
                while (reader.Read())
                {
                    reportProject.Add(ConvertReport.ConvertDBtoReport(reader));
                }
                return(reportProject);
            };
            List <ReportProject> reportProjects = DBAccess.RunReader(func, "report", new List <string>()
            {
                viewName
            }, new List <string>()
            {
                "viewName"
            });

            foreach (var item in reportProjects)
            {
                item.Items = GetDepartmentsWorkersProject(item.Id);
            }

            return(reportProjects);
        }
        public static List <ReportProject> CreateReportsProject(string viewName)
        {
            Func <MySqlDataReader, List <ReportProject> > func = (reader) =>
            {
                List <ReportProject> reportProject = new List <ReportProject>();
                while (reader.Read())
                {
                    reportProject.Add(ConvertReport.ConvertDBtoReport(reader));
                }
                return(reportProject);
            };
            List <ReportProject> reportProjects = DBAccess.RunReader(func, "report", new List <string>()
            {
                viewName
            }, new List <string>()
            {
                "viewName"
            });

            foreach (var item in reportProjects)
            {
                item.Project.workers = new List <UserWithoutPassword>();
                List <ProjectWorker> workerInProject = LogicManager.getUsersBelongProjects(item.Project.ProjectId);
                var workerInProjectGroup             = workerInProject.GroupBy(p => p.User.DepartmentId);

                foreach (var departmentWorkers in workerInProjectGroup)
                {
                    item.DepartmentUser.Add(new HourDepartmentProject());
                }
            }

            return(reportProjects);
        }
        public static List <ReportProject> CreateReports(List <string> param)
        {
            Func <MySqlDataReader, List <ReportProject> > func = (reader) =>
            {
                List <ReportProject> reportProject = new List <ReportProject>();
                while (reader.Read())
                {
                    reportProject.Add(ConvertReport.ConvertDBtoReport(reader));
                }
                return(reportProject);
            };

            return(DBAccess.RunReader(func, "CreateReport", new List <string>()
            {
                param[0]
            }, new List <string>()
            {
                param[1]
            }));
        }
        public static List <ReportProject> CreateReports1(string viewName)
        {
            Func <MySqlDataReader, List <ReportProject> > func = (reader) =>
            {
                List <ReportProject> reportProject = new List <ReportProject>();
                while (reader.Read())
                {
                    reportProject.Add(ConvertReport.ConvertDBtoReport(reader));
                }
                return(reportProject);
            };

            return(DBAccess.RunReader(func, "report", new List <string>()
            {
                viewName
            }, new List <string>()
            {
                "viewName"
            }));
        }