public void actAddTab(request request, UserControl view) { Tab tab = new Tab(request.creation_date.ToString(), view , request, null); requestTabs.Add(tab); this.selectedTab = tab; }
public DeleteRequestViewModel(request request) { this.cmdDelete = new RelayCommand<Object>(actDelete); this.request = request; this.nbrProposition = request.propositions.Count; this.nbrEvent = request.events.Count; }
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); }
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); }
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); }
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(); }
public void actShowRequest(request request) { mediator.openShowRequestView(request); }
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); }
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(); }
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(); }
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(); }
public void actEdit(request request) { mediator.openEditRequestView(this.request); }
public void actViewDetail(request request) { mediator.openShowRequestView(request); }