Пример #1
0
 public EventService()
 {
     DAL.TicketManagementContext context = new DAL.TicketManagementContext();
     _service          = new ManagerServices.EventService(new EntityEventRepository(context), new EntityProcedureManager(context));
     _eventAreaService = new ManagerServices.EventAreaService(new EntityEventAreaRepository(new DAL.TicketManagementContext()));
     _eventSeatService = new ManagerServices.EventSeatService(new EntityEventSeatRepository(context));
 }
        public override void Validate(string userName, string password)
        {
            // Validate arguments
            //throw new ArgumentNullException("userName");
            if (String.IsNullOrEmpty(userName))
            {
                throw new ArgumentNullException("userName");
            }

            if (String.IsNullOrEmpty(password))
            {
                throw new ArgumentNullException("password");
            }

            // Check the user name and password
            if (userName != "test" || password != "test")
            {
                bool result = false;
                DAL.TicketManagementContext context = new DAL.TicketManagementContext();
                var service = new ManagerServices.UserService(new EntityUserRepository(context), new EntityProcedureManager(context));
                var users   = service.Find(userName);
                if (users.Any())
                {
                    var user = users.First();
                    if (user.Password == password)
                    {
                        result = true;
                    }
                }
                if (!result)
                {
                    throw new SecurityTokenException("Unknown username or password.");
                }
            }
        }
Пример #3
0
 public SeatService()
 {
     DAL.TicketManagementContext context = new DAL.TicketManagementContext();
     _service          = new ManagerServices.SeatService(new EntitySeatRepository(context));
     _eventAreaService = new ManagerServices.EventAreaService(new EntityEventAreaRepository(context));
     _areaService      = new ManagerServices.AreaService(new EntityAreaRepository(context));
     _eventSeatService = new ManagerServices.EventSeatService(new EntityEventSeatRepository(context));
 }
Пример #4
0
 public LayoutService()
 {
     DAL.TicketManagementContext context = new DAL.TicketManagementContext();
     _service          = new ManagerServices.LayoutService(new EntityLayoutRepository(context));
     _eventAreaService = new ManagerServices.EventAreaService(new EntityEventAreaRepository(context));
     _eventSeatService = new ManagerServices.EventSeatService(new EntityEventSeatRepository(context));
     _venueService     = new ManagerServices.VenueService(new EntityVenueRepository(context));
 }
Пример #5
0
 public UserService()
 {
     DAL.TicketManagementContext context = new DAL.TicketManagementContext();
     _service = new ManagerServices.UserService(new EntityUserRepository(context), new EntityProcedureManager(context));
 }
Пример #6
0
 public EventSeatService()
 {
     DAL.TicketManagementContext context = new DAL.TicketManagementContext();
     _service = new ManagerServices.EventSeatService(new EntityEventSeatRepository(context));
 }
 public PurchaseService()
 {
     DAL.TicketManagementContext context = new DAL.TicketManagementContext();
     _service = new ManagerServices.PurchaseService(new EntityPurchaseRepository(context));
 }