Example #1
0
        public ActionResult Register(Account Account)
        {
            if (ModelState.IsValid)
            {
                using (FestivalContext Db = new FestivalContext())
                {
                    Db.Accounts.Add(Account);
                    Db.SaveChanges();
                }

                ModelState.Clear();
                ViewBag.Message = Account.Name + ", your account has been successfully registered!";
            }
            return(View());
        }
Example #2
0
        public ActionResult Login(Account Account)
        {
            using (FestivalContext Db = new FestivalContext())
            {
                Account user = Db.Accounts.FirstOrDefault(u => u.Username == Account.Username && u.Password == Account.Password);

                if (user != null)
                {
                    Session["Id"]       = user.Id;
                    Session["Username"] = user.Username;

                    return(RedirectToAction("../Dashboard/Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Username or password is not correct");
                }
            }
            ViewBag.Message = "The username or password is incorrect.";

            return(View("Login"));
        }
Example #3
0
 public TransferServiceRepository(FestivalContext context)
 {
     _context = context;
 }
 public StageRepository(FestivalContext context)
 {
     _context = context;
 }
 public PerformanceRepository(FestivalContext context)
 {
     _context = context;
 }
 public PerformanceController(FestivalContext db, IPerformanceRepository repo)
 {
     _db   = db;
     _repo = repo;
 }
Example #7
0
 public LoggingRepository(FestivalContext context)
 {
     _context = context;
 }
 public TicketTypeRepository(FestivalContext context)
 {
     this.context = context;
 }
Example #9
0
 public SponsorRepository(FestivalContext context)
 {
     this.context = context;
 }
Example #10
0
 public AccommodationRepository(FestivalContext context)
 {
     _context = context;
 }
 public AttendeeRepository(FestivalContext context)
 {
     _context = context;
 }
 public TransferVehicleRepository(FestivalContext context)
 {
     _context = context;
 }
Example #13
0
 public ShopItemRepository(FestivalContext context)
 {
     _context = context;
 }
 public TicketVoucherRepository(FestivalContext context)
 {
     this.context = context;
 }
Example #15
0
 public PurchaseVoucherRepository(FestivalContext context)
 {
     this.context = context;
 }
Example #16
0
 public TransferReservationRepository(FestivalContext context)
 {
     this.context = context;
 }