예제 #1
0
 public SearchByTag(User user, Event ev)
 {
     InitializeComponent();
     _user = user;
     _event = ev;
     _logic = new PostLogic();
 }
예제 #2
0
 public TimeLine(User user, Event ev)
 {
     InitializeComponent();
     _user = user;
     _event = ev;
     _logic = new PostLogic();
 }
 /// <summary>
 /// Constructor of the material system
 /// </summary>
 /// <param name="ev"></param>
 public MaterialSystem(Event ev, User user)
 {
     InitializeComponent();
     _event = ev;
     _user = user;
     _rfidScanned = true;
 }
예제 #4
0
 private MakePost(Event ev)
 {
     InitializeComponent();
     _event = ev;
     _logicMedia = new MediaOracleContext();
     _logicPost = new PostLogic(new PostOracleContext());
 }
        public SocialMediaSystemForm(User user, Event ev)
        {
            InitializeComponent();
            _user = user;
            _event = ev;

            Text = $"Tijdlijn {ev.Name}";
        }
예제 #6
0
 public Form1(User user)
 {
     InitializeComponent();
     _logicGuest = new GuestOracleContext();
     _ev = new Event(1, "ICT4Events", new DateTime(2015, 10, 09), new DateTime(2015, 10, 15), "IdontKnowYet", "IdontKnowYet", 100);
     _user = user;
     _guest = _logicGuest.GetById(user.ID);
 }
        public bool Delete(Event entity)
        {
            var ev = _events.FirstOrDefault(e => e.ID == entity.ID);
            if (ev == null) return false;

            _events.Remove(ev);
            return true;
        }
예제 #8
0
 public TimeLine(User user, Event ev)
 {
     InitializeComponent();
     _admin = user;
     _event = ev;
     _logic = new PostLogic();
     _reportContext = new ReportOracleContext();
 }
예제 #9
0
 public ReportSection(User admin, Event ev)
 {
     InitializeComponent();
     _admin = admin;
     _event = ev;
     _logicPost = new PostLogic();
     _getAllPostByEvent = _logicPost.GetAllByEvent(_event);
     lblWelkom.Text = $"Welkom bij de rapporten overzicht,  {_admin.Name} {_admin.Surname}";
 }
예제 #10
0
        public PostFeedExtended(Post post, Event ev, User admin)
        {
            InitializeComponent();
            _logicPost = new PostLogic();
            _reportContext = new ReportOracleContext();

            _post = post;
            _event = ev;
            _admin = admin;
        }
        public Event Insert(Event entity)
        {
            if (GetById(entity.ID) != null) return null;

            var id = _events.Max(e => e.ID);
            var ev = new Event(id, entity.Name, entity.StartDate, entity.EndDate, entity.Location, entity.MapPath,
                entity.MaxCapacity);
            _events.Add(ev);

            return ev;
        }
예제 #12
0
        /// <summary>
        /// Constructor used for the post form for users
        /// </summary>
        /// <param name="user">The user who is placing this post</param>
        /// <param name="ev">The event this post belongs to</param>
        public MakePost(User user, Event ev)
        {
            _user = user;
            InitializeComponent();
            _event = ev;
            _logicPost = new PostLogic(new PostOracleContext());

            _uploadedMedia = new UcUpload(_user, _event);
            tbpLoadUcUpload.Controls.Add(_uploadedMedia);
            LoadMediaList();
        }
예제 #13
0
        public Guest RegisterNewUserForEvent(string username, Event ev, Location location, DateTime start, DateTime end, int leaderID)
        {
            var password = Membership.GeneratePassword(10, 2);

            var user = new User(0, username, LogicCollection.UserLogic.GetHashedPassword(password), "new user");
            user = LogicCollection.UserLogic.RegisterUser(user, true, password);

            SendConfirmationEmail(user, ev, location, start, end);

            return RegisterUserForEvent(user, ev, location, start, end, leaderID);
        }
        public PostFeedExtended(Post post, Event ev, User user)
        {
            InitializeComponent();
            _logicPost = new PostLogic();
            _reportContext = new ReportOracleContext();

            _post = post;
            _event = ev;

            _activeUser = user;
        }
예제 #15
0
        public PostFeedExtended(Post post, Event ev, Guest active)
        {
            InitializeComponent();
            _logicPost = new PostLogic();
            _reportContext = new ReportOracleContext();

            _post = post;
            _event = ev;

            // Currently signed in guest
            _activeUser = active;
        }
예제 #16
0
        public ucLocationEdit(Event ev)
        {
            InitializeComponent();
            _event = ev;

            var locations = LogicCollection.LocationLogic.GetLocationsByEvent(_event);
            lsbLocations.Items.AddRange(locations.ToArray());

            if (string.IsNullOrWhiteSpace(_event.MapPath)) return;

            picMap.ImageLocation = $"{FtpHelper.ServerHardLogin}/{_event.ID}/{_event.MapPath}";
            picMap.SizeMode = PictureBoxSizeMode.Zoom;
        }
        public GuestRegistrationForm(User user, Event ev)
        {
            InitializeComponent();
            _user = user;
            _event = ev;

            cmbLocations.DataSource = LogicCollection.LocationLogic.GetLocationsByEvent(ev);

            calEventDate.MinDate = _event.StartDate;
            calEventDate.MaxDate = _event.EndDate;

            calEventDate.SetSelectionRange(_event.StartDate, _event.EndDate);
            calEventDate.MaxSelectionCount = (int)(_event.EndDate.Subtract(_event.StartDate).TotalDays) + 1;
        }
예제 #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CurEvent = LogicCollection.EventLogic.GetByID(2);

            StartDate.TodaysDate = CurEvent.StartDate;
            EndDate.TodaysDate = CurEvent.StartDate;

            var user = SiteMaster.CurrentUser();
            if (user != null)
            {
                lblLoggedIn.Visible = true;
                lblLoggedIn.Text = "Je bent al ingelogd.";
                fromRegister.Visible = false;
            }
        }
예제 #19
0
        public PostFeed(Post post, Event ev, User user, bool reply)
        {
            InitializeComponent();

            Post = post;
            _event = ev;

            lbReaction.Visible = !reply;

            // Currently signed in user
            _activeUser = user;

            // Guest of the post
            _postUser = LogicCollection.UserLogic.GetById(Post.GuestID);
        }
예제 #20
0
        public ucEventEdit(Event ev = null)
        {
            InitializeComponent();
            _ev = ev;

            btnUpdateEvent.Text = _ev == null ? "Evenement toevoegen" : "Evenement wijzigen";

            if (_ev == null) return;

            txtName.Text = _ev.Name;
            txtLocation.Text = _ev.Location;
            numCapacity.Value = _ev.MaxCapacity;
            dtpStartDate.Value = _ev.StartDate;
            dtpEndDate.Value = _ev.EndDate;
        }
예제 #21
0
        public Guest RegisterUserForEvent(User user, Event ev, Location location, DateTime start, DateTime end, int leaderID = 0)
        {
            var existingGuest = _context.GetGuestByEvent(ev, user.ID); // Checks if user is already registered for an event
            if (existingGuest != null) return existingGuest;

            var guest = new Guest(user.ID, user.Username, user.Password, user.Name, "", false, ev.ID, false, start, end,
                location.ID, user.RegistrationDate, user.Permission, user.Surname, user.Country, user.City, user.Postal,
                user.Address, user.Telephone, leaderID);

            SendConfirmationEmail(user, ev, location, start, end);

            FtpHelper.CreateDirectory($"{ev.ID}/{guest.ID}");

            return _context.Insert(guest);
        }
예제 #22
0
        private static bool SendConfirmationEmail(User user, Event ev, Place location, DateTime start, DateTime end)
        {
            var fromAddress = new MailAddress(Properties.Settings.Default.Email, "ICT4Events");
            var toAddress = new MailAddress(user.Email, user.Username);
            var fromPassword = Properties.Settings.Default.EmailPassword;

            var message = new MailMessage(fromAddress, toAddress)
            {
                Subject = "Confirmation of your new reservation for "+ ev.Name,
                Body =
                    "Hello " + user.Username + ",\r\n\r\n" +
                    $"Your have been registered to participate in event {ev.Name}!\r\n" +
                    $"The location you entered is {location.Name}.\r\n" +
                    $"We will be expecting to see you on {start.Date.ToShortDateString()} until {end.Date.ToShortDateString()}.\r\n" +
                    $"Your user ID is: {user.ID}. Make sure to remember this for your check-in!" +
                    "\r\n\r\nHave a nice day!"
            };

            var smtp = new SmtpClient
            {
                Host = "smtp.gmail.com",
                Port = 587,
                EnableSsl = true,
                DeliveryMethod = SmtpDeliveryMethod.Network,
                UseDefaultCredentials = false,
                Credentials = new NetworkCredential(fromAddress.Address, fromPassword)
            };

            try
            {
                smtp.Send(message);
                return true;
            }
            catch (SmtpException e)
            {
                throw new Exception(e.Message);
            }
        }
예제 #23
0
 public Guest GetGuestByEvent(Event ev, int userID)
 {
     return _context.GetGuestByEvent(ev, userID);
 }
예제 #24
0
 /// <summary>
 /// Initialize a new instance of the <see cref="EntranceControl"/> class.
 /// </summary>
 public EntranceControl(Event ev)
 {
     InitializeComponent();
     _event = ev;
     _guests = LogicCollection.GuestLogic.GetGuestsByEvent(_event);
 }
예제 #25
0
        public List<Guest> RegisterUsersForEvent(List<string> usernames, Event ev, Location location, DateTime start, DateTime end, int leaderID)
        {
            var res = new List<Guest>();

            foreach (var username in usernames)
            {
                var user = LogicCollection.UserLogic.GetByUsername(username);
                var guest = (user != null
                    ? RegisterUserForEvent(user, ev, location, start, end)
                    : RegisterNewUserForEvent(username, ev, location, start, end, leaderID));

                res.Add(guest);
            }

            return res;
        }
예제 #26
0
 public List<Guest> GetGuestsByGroup(Event ev, int leaderID)
 {
     return _context.GetGuestsByGroup(ev, leaderID);
 }
예제 #27
0
 public Catalogue(Event ev,User user)
 {
     InitializeComponent();
     _user = user;
     _event = ev;
 }
예제 #28
0
 public int GetGuestCountByEvent(Event ev)
 {
     return _context.GetGuestCountByEvent(ev);
 }
 public MaterialReservationSystem(Event ev, Guest guest)
 {
     InitializeComponent();
     _event = ev;
     _guest = guest;
 }
예제 #30
0
 public List<Guest> GetGuestsByEvent(Event ev)
 {
     return _context.GetAllByEvent(ev);
 }