Ejemplo n.º 1
0
        //Manager
        //Get all projects in a list with project id,name and description
        public List <ReleaseManagementModel> GetAllAssignedModules(string userName)
        {
            DataSet dsGetprojectId = dal.GetProjectId(userName);
            List <ReleaseManagementModel> projects = new List <ReleaseManagementModel>();
            ReleaseManagementModel        project;

            foreach (DataRow row in dsGetprojectId.Tables[0].Rows)
            {
                project             = new ReleaseManagementModel();
                project.ProjectId   = row[0].ToString();
                project.ProjectName = row[1].ToString();
                projects.Add(project);
            }
            DataSet dsGetAllAssignedModules;
            ReleaseManagementModel        modules;
            List <ReleaseManagementModel> assignedModules = new List <ReleaseManagementModel>();

            for (int i = 0; i < projects.Count; i++)
            {
                dsGetAllAssignedModules = dal.GetAllAssignedModules(projects[i].ProjectId);
                foreach (DataRow row in dsGetAllAssignedModules.Tables[0].Rows)
                {
                    modules              = new ReleaseManagementModel();
                    modules.ProjectName  = row[0].ToString();
                    modules.ModuleName   = row[1].ToString();
                    modules.ModuleStatus = row[2].ToString();
                    modules.ModuleId     = row[3].ToString();
                    assignedModules.Add(modules);
                }
            }

            DataSet dsGetAllDeveloperName = dal.GetAllDeveloperName();
            DataSet dsGetAllTesterName    = dal.GetAllTesterName();
            List <ReleaseManagementModel> developerList = new List <ReleaseManagementModel>();

            ReleaseManagementModel developer;

            foreach (DataRow row in dsGetAllDeveloperName.Tables[0].Rows)
            {
                developer = new ReleaseManagementModel();
                developer.DeveloperName = row[0].ToString();
                developer.ModuleId      = row[1].ToString();
                developerList.Add(developer);
            }
            List <ReleaseManagementModel> testerList = new List <ReleaseManagementModel>();

            ReleaseManagementModel tester;

            foreach (DataRow row in dsGetAllTesterName.Tables[0].Rows)
            {
                tester            = new ReleaseManagementModel();
                tester.TesterName = row[0].ToString();
                tester.ModuleId   = row[1].ToString();
                testerList.Add(tester);
            }
            for (int i = 0; i < developerList.Count; i++)
            {
                for (int j = 0; j < assignedModules.Count; j++)
                {
                    if (developerList[i].ModuleId == assignedModules[j].ModuleId)
                    {
                        assignedModules[j].DeveloperName = developerList[i].DeveloperName;
                    }
                }
            }
            for (int i = 0; i < testerList.Count; i++)
            {
                for (int j = 0; j < assignedModules.Count; j++)
                {
                    if (testerList[i].ModuleId == assignedModules[j].ModuleId)
                    {
                        assignedModules[j].TesterName = testerList[i].TesterName;
                    }
                }
            }

            return(assignedModules);
        }