Exemplo n.º 1
0
        public Project switchProjectVMToProject(ProjectVM vm)
        {
            Project result = new Project();

            result.Code        = vm.Code;
            result.Description = vm.Description;
            result.Name        = vm.Name;
            return(result);
        }
Exemplo n.º 2
0
 public MissionsByStatusVM(ProjectVM curProject)
 {
     this.curProject       = curProject;
     missionsBL            = new MissionsBL();
     inProcessMissionsList = new ObservableCollection <MissionVM>();
     doneMissionsList      = new ObservableCollection <MissionVM>();
     pendingMissionsList   = new ObservableCollection <MissionVM>();
     Init();
 }
Exemplo n.º 3
0
        public void Init()
        {
            PersonalManagerProjectsList.Clear();
            PersonalParticipantProjectsList.Clear();
            List <Project> managerListFromBL     = projectsBL.GetPersonalManagerProjects(Cache.Instance.username, true);
            List <Project> participantListFromBL = projectsBL.GetPersonalParticipantProjects(Cache.Instance.username);

            //List<Project> managerListFromBL = projectsBL.GetPersonalManagerProjects("BotBurg3r", true);
            //List<Project> participantListFromBL = projectsBL.GetPersonalParticipantProjects("BotBurg3r");
            foreach (Project project in managerListFromBL)
            {
                ProjectVM p = new ProjectVM()
                {
                    Code        = project.Code,
                    Name        = project.Name,
                    StartDate   = project.StartDate.ToShortDateString(),
                    EndDate     = project.EndDate.ToShortDateString(),
                    Description = project.Description,
                    Manager     = new PlayerVM()
                    {
                        UserName = project.Manager
                    },
                };
                foreach (string username in project.Participants)
                {
                    p.Participants.Add(new PlayerVM()
                    {
                        UserName = username
                    });
                }
                PersonalManagerProjectsList.Add(p);
            }

            foreach (Project project1 in participantListFromBL)
            {
                ProjectVM p = new ProjectVM()
                {
                    Code        = project1.Code,
                    Name        = project1.Name,
                    StartDate   = project1.StartDate.ToShortDateString(),
                    EndDate     = project1.EndDate.ToShortDateString(),
                    Description = project1.Description,
                    Manager     = new PlayerVM()
                    {
                        UserName = project1.Manager
                    }
                };
                PersonalParticipantProjectsList.Add(p);
            }
            OnPropertyRaised("PersonalManagerProjectsList");
            OnPropertyRaised("PersonalParticipantProjectsList");
            OnPropertyRaised("CountManagerProjects");
            OnPropertyRaised("CountParticipantProjects");
        }
        public MissionsInteractionsVM(ProjectVM curProject)
        {
            this.curProject        = curProject;
            missionsBL             = new MissionsBL();
            missionsInteractionsBL = new MissionsInteractionsBL();
            NextMissionsList       = new ObservableCollection <MissionVM>();
            PreviousMissionsList   = new ObservableCollection <MissionVM>();
            MissionsList           = new ObservableCollection <MissionVM>();
            ObservableCollection <MissionVM> tempMissionList = new ObservableCollection <MissionVM>();

            foreach (Mission mission in missionsBL.GetAllMissions(switchProjectVMToProject(curProject)))
            {
                MissionVM m = new MissionVM()
                {
                    Code        = mission.Id,
                    Duration    = mission.Duration,
                    Description = mission.Description,
                    Name        = mission.Name,
                    ProjectId   = mission.ProjectId,
                    Status      = mission.StatusId,
                    Progress    = mission.Progress
                };
                MissionsList.Add(m);
            }
            foreach (var cur in MissionsList)
            {
                if (IsThereAnInteraction(cur))
                {
                    tempMissionList.Add(cur);
                }
            }
            MissionsList.Clear();
            foreach (var mission in tempMissionList)
            {
                MissionsList.Add(mission);
            }
        }
 public ProjectParticipantsVM(ProjectVM pvm)
 {
     projectsBL     = new ProjectsBL();
     this.ProjectVM = pvm;
     initParticipantsView();
 }