コード例 #1
0
        public void actAddTab(request request, UserControl view)
        {
            Tab tab = new Tab(request.creation_date.ToString(), view , request, null);

            requestTabs.Add(tab);
            this.selectedTab = tab;
        }
コード例 #2
0
 public DeleteRequestViewModel(request request)
 {
     this.cmdDelete = new RelayCommand<Object>(actDelete);
     this.request = request;
     this.nbrProposition = request.propositions.Count;
     this.nbrEvent = request.events.Count;
 }
コード例 #3
0
        public EditRequestViewModel(request request)
        {
            currentRequest = request;
            this.journey = Journey.list[Journey.indexByValue(request.journey_type)];
            this.student = request.student;
            this.students = request.contact.students.ToList();
            this.journeys = Helper.Enum.Journey.list;

            this.cmdEdit = new RelayCommand<object>(actEdit);
        }
コード例 #4
0
        public ShowRequestViewModel(request request)
        {
            this.request = request;
            this.propositions = new ObservableCollection<proposition>(request.propositions.ToList());
            this.cmdEdit = new RelayCommand<request>(actEdit);

            this.cmdAddProposition = new RelayCommand<Object>(actAddProposition);
            this.cmdDeleteProposition = new RelayCommand<proposition>(actDeleteProposition);
            this.cmdDeleteRequest = new RelayCommand<Object>(actDeleteRequest);
            mediator.Register(Helper.Event.ADD_PROPOSITION,this);
        }
コード例 #5
0
        public AddPropositionViewModel(request request)
        {
            this.student = request.student;
            this.request = request;
            this.customer = request.contact;
            this.programs = db.programs.ToList();

            foreach (proposition p in this.request.propositions)
                this.programs.Remove(p.program);

            this.cmdAdd = new RelayCommand<Object>(actAdd);
        }
コード例 #6
0
        public void actAdd(Object o)
        {
            _event _newEvent = new _event();
            _newEvent.event_types = db.event_types.OrderBy(event_type => event_type.order).First();

            request request = new request();

            request.events.Add(_newEvent);
            request.contact = this.customer;
            request.user = mediator.user;
            request.journey_type = journey.getValue();
            request.student = student;
            request.creation_date = DateTime.Now;

            db.requests.Add(request);

            db.SaveChanges();

            mediator.NotifyViewModel(Helper.Event.ADD_REQUEST, request);
            this.CloseActionAdd();
        }
コード例 #7
0
 public void actShowRequest(request request)
 {
     mediator.openShowRequestView(request);
 }
コード例 #8
0
        public void openShowRequestView(request request)
        {
            mainViewModel.selectedTab = BaseViewModel.tabs["request"];
            ShowRequestUCView showRequestView = new ShowRequestUCView();
            showRequestView.DataContext = new ShowRequestViewModel(request);

            ((RequestViewModel)mainTabs["request"].tabViewModel).actAddTab(request, showRequestView);
        }
コード例 #9
0
        public void openEditRequestView(request request)
        {
            EditRequestViewModel editRequestViewModel = new EditRequestViewModel(request);
            EditRequestView editRequestView = new EditRequestView();

            editRequestView.DataContext = editRequestViewModel;
            editRequestViewModel.CloseActionEdit = new Action(() => editRequestView.Close());

            editRequestView.Show();
        }
コード例 #10
0
        public void openDeleteRequestView(request request)
        {
            DeleteRequestViewModel deleteRequestViewModel = new DeleteRequestViewModel(request);
            DeleteRequestView deleteRequestView = new DeleteRequestView();

            deleteRequestView.DataContext = deleteRequestViewModel;
            deleteRequestViewModel.CloseActionDelete = new Action(() => deleteRequestView.Close());

            deleteRequestView.ShowDialog();
        }
コード例 #11
0
        public void openAddPropositionView(request request)
        {
            AddPropositionViewModel addPropositionViewModel = new AddPropositionViewModel(request);
            AddPropositionView addPropositionView = new AddPropositionView();

            addPropositionView.DataContext = addPropositionViewModel;
            addPropositionViewModel.CloseActionAdd = new Action(() => addPropositionView.Close());

            addPropositionView.Show();
        }
コード例 #12
0
 public void actEdit(request request)
 {
     mediator.openEditRequestView(this.request);
 }
コード例 #13
0
 public void actViewDetail(request request)
 {
     mediator.openShowRequestView(request);
 }