public AddInteractionVM()
        {
            NextMissionsList       = new ObservableCollection <MissionVM>();
            CurruntMissionsList    = new ObservableCollection <MissionVM>();
            MissionsList           = new ObservableCollection <MissionVM>();
            missionsInteractionsBL = new MissionsInteractionsBL();
            missionsBL             = new MissionsBL();

            Project temp = new Project();

            temp.Code = Cache.Instance.currentProject.Code;
            MissionVM missionVM;
            MissionVM m = new MissionVM();

            foreach (var mission in missionsBL.GetAllMissions(temp))
            {
                missionVM = new MissionVM()
                {
                    Code        = mission.Id,
                    Description = mission.Description,
                    Name        = mission.Name
                };
                MissionsList.Add(missionVM);
                CurruntMissionsList.Add(missionVM);
                NextMissionsList.Add(missionVM);
            }
        }
Beispiel #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();
 }
Beispiel #3
0
 public MissionProfilePage(MissionVM vm, bool editable)
 {
     InitializeComponent();
     if (editable)
     {
         this.desTxt.IsEnabled       = true;
         deleteMissionBtn.Visibility = Visibility.Visible;
     }
     else
     {
         this.desTxt.IsEnabled       = false;
         deleteMissionBtn.Visibility = Visibility.Collapsed;
     }
     missionsBL       = new MissionsBL();
     this.DataContext = vm;
     viewModel        = vm;
 }
        public ManagedProjectPage(ProjectVM pvm)
        {
            InitializeComponent();
            projectBL  = new ProjectsBL();
            missionsBL = new MissionsBL();

            ProjectDoneBtn.IsEnabled = true;
            Project p = new Project();

            p.Code = pvm.Code;

            foreach (var mission in missionsBL.GetAllMissions(p))
            {
                if (mission.StatusId != 3)
                {
                    ProjectDoneBtn.IsEnabled = false;
                }
            }

            Cache.Instance.currentProject            = pvm;
            Cache.Instance.isManagerOfCurrentProject = true;
            this.vm          = pvm;
            this.DataContext = vm;
            if (vm.EndDate == "01/01/0001")//default null date
            {
                this.msgEndDateLbl.Visibility = Visibility.Visible;
                this.msgEndDateLbl.Content    = "The project is still running";
                this.endDateLbl.Visibility    = Visibility.Collapsed;
                this.endDateVal.Visibility    = Visibility.Collapsed;
            }
            //שצריך לסדר שבהתחברות המשתמש יהיה במדוייק כמו המשתמש שיצרו
            if (pvm.Manager.UserName == Cache.Instance.username)
            {
                editProjectBtn.Visibility = Visibility.Visible;
            }
            else
            {
                editProjectBtn.Visibility = Visibility.Collapsed;
            }
        }
        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);
            }
        }
Beispiel #6
0
 public CriticalPath()
 {
     missionBL = new MissionsBL();
     missionsInteractionsBL = new MissionsInteractionsBL();
 }
Beispiel #7
0
 public AddMissionPage()
 {
     InitializeComponent();
     missionsBL = new MissionsBL();
 }