Esempio n. 1
0
        public ActionResult Event(int sourceId, int targetId)
        {
            Source source = this.sourceTasks.GetSource(sourceId);

            if (source != null)
            {
                Profiling2.Domain.Prf.Events.Event ev = this.eventTasks.GetEvent(targetId);
                if (ev != null)
                {
                    EventSourceViewModel vm = new EventSourceViewModel();
                    vm.SourceId = source.Id;
                    vm.EventId  = ev.Id;
                    vm.PopulateDropDowns(this.sourceTasks.GetReliabilities());

                    ViewBag.Event  = ev;
                    ViewBag.Source = source;

                    EventSource es = source.GetEventSource(ev);
                    if (es != null)
                    {
                        // Event is already attached to Source
                        vm.Id         = es.Id;
                        vm.Commentary = es.Commentary;
                        vm.Notes      = es.Notes;
                    }

                    return(View(vm));
                }
            }
            return(new HttpNotFoundResult());
        }
        public ActionResult Add(int eventId)
        {
            Event e = this.eventTasks.GetEvent(eventId);

            if (e != null)
            {
                EventSourceViewModel esvm = new EventSourceViewModel(e);
                esvm.PopulateDropDowns(this.sourceTasks.GetReliabilities());
                return(View(esvm));
            }
            return(new HttpNotFoundResult());
        }
        public ActionResult Edit(int id)
        {
            EventSource es = this.sourceAttachmentTasks.GetEventSource(id);

            if (es != null)
            {
                EventSourceViewModel vm = new EventSourceViewModel(es);
                vm.PopulateDropDowns(this.sourceTasks.GetReliabilities());

                // get SourceDTO in order to not load Source entity
                vm.PopulateSource(this.sourceTasks.GetSourceDTO(es.Source.Id));

                return(View(vm));
            }
            return(new HttpNotFoundResult());
        }