public EditTicketReservation(int id, Event selectedEvent)
        {
            InitializeComponent();

            if (_viewModel == null)
            {
                _viewModel = new EditTicketReservationViewModel(selectedEvent);
            }

            DataContext = _viewModel;

            _viewModel.LoadDataByTicketId(Convert.ToInt32(id));
            this._viewModel.TicketValidationErrorsEvent += new EventHandler(OnCustomValidationError);
            AppMessages.TicketAddedMessage.Register(this, OnTicketAdded);
        }
        public EditTicketReservationViewModel(Event selectedEvent)
        {
            _saveChangesCommand = new RelayCommand(OnSaveChanges);
            _generateSeatCommand = new RelayCommand(OnGenerateSeatNumber);
            _context = ContextFactory.GetTicketContext();
            _eventTicketContext = ContextFactory.GetEventTicketContext();
            _teamContext = ContextFactory.GetTeamContext();
            SelectedEvent = selectedEvent;

            MemberList = _teamContext.Members;
            TicketTypes = _context.TicketTypes;
            PaymentMethodsList = _context.PaymentMethods;

            WebContext.Current.Authentication.LoggedIn += (s, e) => UpdateForUsersRole();
            WebContext.Current.Authentication.LoggedOut += (s, e) => UpdateForUsersRole();
            UpdateForUsersRole();

            LoadData();
        }
Exemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Events EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEvents(Event @event)
 {
     base.AddObject("Events", @event);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Create a new Event object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="dateStart">Initial value of the DateStart property.</param>
 /// <param name="dateEnd">Initial value of the DateEnd property.</param>
 /// <param name="description">Initial value of the Description property.</param>
 /// <param name="isPostponed">Initial value of the IsPostponed property.</param>
 /// <param name="isCancelled">Initial value of the IsCancelled property.</param>
 /// <param name="isDeleted">Initial value of the IsDeleted property.</param>
 /// <param name="availableTickets">Initial value of the AvailableTickets property.</param>
 public static Event CreateEvent(global::System.Int32 id, global::System.String name, global::System.DateTime dateStart, global::System.DateTime dateEnd, global::System.String description, global::System.Boolean isPostponed, global::System.Boolean isCancelled, global::System.Boolean isDeleted, global::System.Int32 availableTickets)
 {
     Event @event = new Event();
     @event.ID = id;
     @event.Name = name;
     @event.DateStart = dateStart;
     @event.DateEnd = dateEnd;
     @event.Description = description;
     @event.IsPostponed = isPostponed;
     @event.IsCancelled = isCancelled;
     @event.IsDeleted = isDeleted;
     @event.AvailableTickets = availableTickets;
     return @event;
 }