Exemplo n.º 1
0
 public SearchByTag(User user, Event ev)
 {
     InitializeComponent();
     _user = user;
     _event = ev;
     _logic = new PostLogic();
 }
Exemplo n.º 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;
 }
Exemplo n.º 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}";
        }
Exemplo n.º 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;
        }
Exemplo n.º 8
0
 public TimeLine(User user, Event ev)
 {
     InitializeComponent();
     _admin = user;
     _event = ev;
     _logic = new PostLogic();
     _reportContext = new ReportOracleContext();
 }
Exemplo n.º 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}";
 }
Exemplo n.º 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;
        }
Exemplo n.º 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();
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 17
0
        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;
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 23
0
 public Guest GetGuestByEvent(Event ev, int userID)
 {
     return _context.GetGuestByEvent(ev, userID);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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;
        }
Exemplo n.º 26
0
 public List<Guest> GetGuestsByGroup(Event ev, int leaderID)
 {
     return _context.GetGuestsByGroup(ev, leaderID);
 }
Exemplo n.º 27
0
 public Catalogue(Event ev,User user)
 {
     InitializeComponent();
     _user = user;
     _event = ev;
 }
Exemplo n.º 28
0
 public int GetGuestCountByEvent(Event ev)
 {
     return _context.GetGuestCountByEvent(ev);
 }
 public MaterialReservationSystem(Event ev, Guest guest)
 {
     InitializeComponent();
     _event = ev;
     _guest = guest;
 }
Exemplo n.º 30
0
 public List<Guest> GetGuestsByEvent(Event ev)
 {
     return _context.GetAllByEvent(ev);
 }