Exemplo n.º 1
0
        private List <ProjectsData> GetProjectList()
        {
            List <ProjectsData> dataList = new List <ProjectsData>();

            try
            {
                ProjectsHelper dbHelper = new ProjectsHelper(_appSettings.Secrets.DbConnectionString);

                if ("M0000002".Equals(HttpContext.Session.GetString(Constants.Session.SystemRoleId)))
                {
                    dataList = dbHelper.SelectData(HttpContext.Session.GetString(Constants.Session.EmployeeId));
                }
                else
                {
                    dataList = dbHelper.SelectFullData();
                }
            }
            catch (Exception ex)
            {
                _logger.LogError("Error GetProjectList: {0}", ex.Message);
            }

            return(dataList);
        }