public void Init() { Context = new TicketManagementContext(); Data = new DataProvider(Context); manager = Data.SeatManager; Data.Clear(); venue = new Venue() { Description = "asdasd", Address = "asdas", Phone = "asdasd" }; venue.Id = Data.VenueManager.Save(venue); layout = new Layout() { Description = "asdasd", VenueId = venue.Id }; layout.Id = Data.LayoutManager.Save(layout, Data.VenueManager); area = new Area() { Description = "asdasdas", LayoutId = layout.Id, CoordX = 10, CoordY = 10, }; area.Id = Data.AreaManager.Save(area, Data.LayoutManager, Data.SeatManager); }
public void Init() { Context = new TicketManagementContext(); Data = new DataProvider(Context); manager = Data.VenueManager; Data.Clear(); }
public AccountController(UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, TicketManagementContext ticketManagementContext) { var context = ticketManagementContext; _userService = new UserService(new EntityUserRepository(context), new EntityProcedureManager(context)); _userManager = userManager; _signInManager = signInManager; }
public DataProvider(TicketManagementContext context) { Context = context; VenueManager = new VenueService(new EntityVenueRepository(context)); LayoutManager = new LayoutService(new EntityLayoutRepository(context)); AreaManager = new AreaService(new EntityAreaRepository(context)); SeatManager = new SeatService(new EntitySeatRepository(context)); EventManager = new EventService(new EntityEventRepository(context), new EntityProcedureManager(context)); EventSeatService = new EventSeatService(new EntityEventSeatRepository(context)); EventAreaService = new EventAreaService(new EntityEventAreaRepository(context)); }
public DatabaseController(UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, RoleManager <IdentityRole> roleManager, ApplicationContext appContext, TicketManagementContext ticketManagementContext) { string s = ""; var context = ticketManagementContext; _userService = new UserService(new EntityUserRepository(context), new EntityProcedureManager(context)); _userManager = userManager; _signInManager = signInManager; _roleManager = roleManager; _context = appContext; }
public void Init() { Context = new TicketManagementContext(); Data = new DataProvider(Context); manager = Data.LayoutManager; Data.Clear(); venue = new Venue() { Address = "addr", Description = "asdasdasd", Phone = "000" }; venue.Id = Data.VenueManager.Save(venue); }
public EntityLayoutRepository(TicketManagementContext context) { _context = context; _itenContext = context.Layout; }
public EntityEventAreaRepository(TicketManagementContext context) { _context = context; _itenContext = context.EventArea; }
public EntityProcedureManager(TicketManagementContext context) { _context = context; }
public void Init() { Context = new TicketManagementContext(); Data = new DataProvider(Context); manager = Data.EventManager; Data.Clear(); var venue = new Venue() { Address = "sadasd", Description = "asdsadas", Phone = "000", }; venue.Id = Data.VenueManager.Save(venue); layout = new Layout() { Description = "asdadas", VenueId = venue.Id, }; layout.Id = Data.LayoutManager.Save(layout, Data.VenueManager); var area = new Area() { CoordX = 10, CoordY = 20, Description = "asdasd", LayoutId = layout.Id, }; area.Id = Data.AreaManager.Save(area, Data.LayoutManager, Data.SeatManager); var seat = new Seat() { AreaId = area.Id, Number = 3, Row = 3 }; seat.Id = Data.SeatManager.Save(seat, Data.AreaManager); var venueWS = new Venue() { Address = "venueWS", Description = "venueWS", Phone = "000", }; venueWS.Id = Data.VenueManager.Save(venueWS); layoutWithoutSeats = new Layout() { Description = "layoutWS", VenueId = venueWS.Id, }; layoutWithoutSeats.Id = Data.LayoutManager.Save(layoutWithoutSeats, Data.VenueManager); var areaWS = new Area() { CoordX = 12, CoordY = 15, Description = "areaWS", LayoutId = layoutWithoutSeats.Id, }; areaWS.Id = Data.AreaManager.Save(areaWS, Data.LayoutManager, Data.SeatManager); }
public EntityAreaRepository(TicketManagementContext context) { _context = context; _itemContext = context.Area; }
public EntityPurchaseRepository(TicketManagementContext context) { _context = context; _itenContext = context.Purchase; }
private void TicketManagementSeedData(TicketManagementContext context) { IVenueService vsvc = new ManagerServices.VenueService(new EntityVenueRepository(context)); ILayoutService lsvc = new ManagerServices.LayoutService(new EntityLayoutRepository(context)); IAreaService asvc = new ManagerServices.AreaService(new EntityAreaRepository(context)); ISeatService ssvc = new ManagerServices.SeatService(new EntitySeatRepository(context)); IEventService esvc = new ManagerServices.EventService(new EntityEventRepository(context)); IEventSeatService essvc = new ManagerServices.EventSeatService(new EntityEventSeatRepository(context)); IEventAreaService easvc = new ManagerServices.EventAreaService(new EntityEventAreaRepository(context)); IPurchaseService psvc = new ManagerServices.PurchaseService(new EntityPurchaseRepository(context)); foreach (var x in essvc.GetAll()) { context.Entry(x).State = EntityState.Deleted; } context.SaveChanges(); foreach (var x in esvc.GetAll()) { context.Entry(x).State = EntityState.Deleted; } context.SaveChanges(); foreach (var x in ssvc.GetAll()) { ssvc.Delete(x.Id, asvc, essvc, easvc); } foreach (var x in asvc.GetAll()) { asvc.Delete(x.Id, essvc, easvc); } foreach (var x in lsvc.GetAll()) { lsvc.Delete(x.Id, essvc, easvc); } foreach (var x in vsvc.GetAll()) { vsvc.Delete(x.Id, essvc, easvc, lsvc); } foreach (var x in psvc.GetAll()) { psvc.Delete(x.Id); } Venue v = new Venue() { Address = "Address000", Description = "Description000", Phone = "Phone000" }; v.Id = vsvc.Save(v); Layout l = new Layout() { Description = "Description", VenueId = v.Id }; l.Id = lsvc.Save(l, vsvc); Area a = new Area() { CoordX = 1, CoordY = 1, Description = "Description2", LayoutId = l.Id }; a.Id = asvc.Save(a, lsvc, ssvc); Seat s = new Seat() { AreaId = a.Id, Number = 1, Row = 1 }; ssvc.Save(s, asvc); Event e = new Event() { Description = "Description3", EventDate = DateTime.Now, LayoutId = l.Id, Name = "Name" }; Event e2 = new Event() { Description = "Description4", EventDate = DateTime.Now.AddDays(1), LayoutId = l.Id, Name = "Name2" }; e.Id = context.AddEvent(e.Name, e.Description, e.LayoutId, e.EventDate); e2.Id = context.AddEvent(e2.Name, e2.Description, e2.LayoutId, e2.EventDate); foreach (var data in easvc.GetForEvent(e.Id)) { data.Price = 100; easvc.Update(data); } foreach (var data in easvc.GetForEvent(e2.Id)) { data.Price = 200; easvc.Update(data); } }
public void Seed() { TicketManagementContext context = new TicketManagementContext(); TicketManagementSeedData(context); }
public EntityVenueRepository(TicketManagementContext context) { _context = context; _itenContext = context.Venue; }
public EntityUserRepository(TicketManagementContext context) { _context = context; _itenContext = context.User; }
public EntitySeatRepository(TicketManagementContext context) { _context = context; _itenContext = context.Seat; }
public static void ClassInitialize(TestContext context) { Context = new TicketManagementContext(); Data = new DataProvider(Context); Manager = Data.AreaManager; }