Beispiel #1
0
        public void ReadEmpWithoutCEO()
        {
            DataAccessList dataAccess = new DataAccessList();

            var EmpWithoutCEO = dataAccess.Data <ListingProperties>(@"SELECT Roles.RoleName, FirstName, LastName, Age, Project.ProjectName FROM dbo.PM
                                                        INNER JOIN Project ON Project.ProjectId = PM.ProjectId
                                                        INNER JOIN Roles ON Roles.RoleId = PM.RoleId
                                                        UNION ALL
                                                        SELECT Roles.RoleName, FirstName, LastName, Age, Project.ProjectName FROM dbo.DEV
                                                        INNER JOIN Project ON Project.ProjectId = DEV.ProjectId
                                                        INNER JOIN Roles ON Roles.RoleId = DEV.RoleId
                                                        UNION ALL
                                                        SELECT Roles.RoleName, FirstName, LastName, Age, Project.ProjectName FROM dbo.DSNR
                                                        INNER JOIN Project ON Project.ProjectId = DSNR.ProjectId
                                                        INNER JOIN Roles ON Roles.RoleId = DSNR.RoleId
                                                        UNION ALL
                                                        SELECT Roles.RoleName, FirstName, LastName, Age, Project.ProjectName FROM dbo.ST
                                                        INNER JOIN Project ON Project.ProjectId = ST.ProjectId
                                                        INNER JOIN Roles ON Roles.RoleId = ST.RoleId; ").ToList();

            Console.WriteLine();
            Console.WriteLine(String.Format("{0,-10}{1,8}{2,12}{3,9}", "Role", "First Name", "Last Name", "Age"));
            Console.WriteLine();
            foreach (ListingProperties emp in EmpWithoutCEO)
            {
                Console.WriteLine(String.Format(" {0,-10}{1,8}{2,12}{3,10}", emp.RoleName, emp.FirstName, emp.LastName, emp.Age));
            }
        }
Beispiel #2
0
        public void STList()
        {
            DataAccessList dataAccess = new DataAccessList();
            int            a          = 2;
            string         FirstName  = "Ivana";
            string         LastName   = "Markić";

            //var softwareTesters = dataAccess.Data<SoftwareTesterDetail>(@"INSERT INTO  dbo.PM VALUES (@FirstName, @LastName)", FirstName, LastName).ToList();
        }
Beispiel #3
0
        public void CEOList()
        {
            DataAccessList dataAccess = new DataAccessList();
            var            EmpCEO     = dataAccess.Data <ChiefExecutiveOfficer>(@"SELECT Roles.RoleName, FirstName, LastName, Age, CeoYears FROM dbo.CEO
                                                        INNER JOIN Roles ON Roles.RoleId = CEO.RoleId;").ToList();

            Console.WriteLine();
            foreach (ChiefExecutiveOfficer emp in EmpCEO)
            {
                Console.WriteLine("Current CEO: ");
                Console.WriteLine(String.Format("First name: {0}, Last name: {1}, Age: {2}, Years as CEO: {3}", emp.FirstName, emp.LastName, emp.Age, emp.CeoYears));
                Console.WriteLine();
            }
        }
Beispiel #4
0
        public void DEVList()
        {
            DataAccessList dataAccess = new DataAccessList();

            var EmpWithoutCEO = dataAccess.Data <DeveloperDetail>(@"SELECT FirstName, LastName, Age, Project.ProjectName, IsStudent FROM dbo.DEV
                                                        INNER JOIN Project ON Project.ProjectId = DEV.ProjectId").ToList();

            Console.WriteLine();
            Console.WriteLine(String.Format("{0,18}{1,15}{2,15}{3,10}{4,25}{5,10}", "Role", "First Name", "Last Name", "Age", "Project Name", "Student"));
            Console.WriteLine();
            foreach (DeveloperDetail emp in EmpWithoutCEO)
            {
                Console.WriteLine(String.Format(" {0,18}{1,15}{2,15}{3,10}{4,25}{5,10}", "Project Manager", emp.firstName, emp.lastName, emp.age, emp.projectName, emp.isStudent));
            }
        }
Beispiel #5
0
        public void PMList()
        {
            DataAccessList dataAccess = new DataAccessList();

            var EmpWithoutCEO = dataAccess.Data <ProjectManagerDetail>(@"SELECT FirstName, LastName, Age, Project.ProjectName FROM dbo.PM
                                                        INNER JOIN Project ON Project.ProjectId = PM.ProjectId").ToList();

            Console.WriteLine();
            Console.WriteLine(String.Format("{0,18}{1,15}{2,15}{3,10}{4,25}", "Role", "First Name", "Last Name", "Age", "Project Name"));
            Console.WriteLine();
            foreach (ProjectManagerDetail emp in EmpWithoutCEO)
            {
                Console.WriteLine(String.Format(" {0,18}{1,15}{2,15}{3,10}{4,25}", "Project Manager", emp.firstName, emp.lastName, emp.age, emp.projectName));
            }
        }
Beispiel #6
0
        public void DSNRList()
        {
            DataAccessList dataAccess = new DataAccessList();

            var EmpWithoutCEO = dataAccess.Data <DesignerDetail>(@"SELECT FirstName, LastName, Age, Project.ProjectName, CanDraw FROM dbo.DSNR
                                                        INNER JOIN Project ON Project.ProjectId = DSNR.ProjectId").ToList();

            Console.WriteLine();
            Console.WriteLine(String.Format("{0,18}{1,15}{2,15}{3,10}{4,25}{5,10}", "Role", "First Name", "Last Name", "Age", "Project Name", "Can Draw"));
            Console.WriteLine();
            foreach (DesignerDetail emp in EmpWithoutCEO)
            {
                Console.WriteLine(String.Format(" {0,18}{1,15}{2,15}{3,10}{4,25}{5,10}", "Designer", emp.firstName, emp.lastName, emp.age, emp.projectName, emp.canDraw));
            }
        }
Beispiel #7
0
        public void STList()
        {
            DataAccessList dataAccess = new DataAccessList();

            var softwareTesters = dataAccess.Data <SoftwareTesterDetail>(@"SELECT FirstName, LastName, Age, Project.ProjectName, UsesAutomatedTests FROM dbo.ST
                                                        INNER JOIN Project ON Project.ProjectId = ST.ProjectId").ToList();

            Console.WriteLine();
            Console.WriteLine(String.Format("{0,18}{1,15}{2,15}{3,10}{4,25}{5,20}", "Role", "First Name", "Last Name", "Age", "Project Name ", "   Uses Automated Tests"));
            Console.WriteLine();

            foreach (SoftwareTesterDetail emp in softwareTesters)
            {
                Console.WriteLine(String.Format(" {0,18}{1,15}{2,15}{3,10}{4,25}{5,20}", "Designer", emp.firstName, emp.lastName, emp.age, emp.projectName, emp.usesAutomatedTests));
            }
        }
Beispiel #8
0
        public void ReadEmpWithCEO()
        {
            DataAccessList dataAccess = new DataAccessList();
            Display        display    = new Display();


            var empWithCEO = dataAccess.Data <ListingProperties>(@"SELECT Roles.RoleName, FirstName, LastName, Age, '**No Project**' AS ProjectName FROM dbo.CEO                                         
                                                        INNER JOIN Roles ON Roles.RoleId = CEO.RoleId").ToList();


            display.ReadEmpWithoutCEO();
            foreach (ListingProperties emp in empWithCEO)
            {
                Console.WriteLine(String.Format(" {0,-10}{1,8}{2,12}{3,10}", emp.RoleName, emp.FirstName, emp.LastName, emp.Age));
            }
        }