public InnerCircleMemberViewModel(AppUser loggedInUser)
        {
            User = loggedInUser;

            EventTypeRepository etRep = new EventTypeRepository();

            EventTypes = new SelectList(etRep.GetAll(), "Id", "Description");
        }
Exemplo n.º 2
0
        // Constructor
        public MessageDisplayViewModel(Message message, string userName)
        {
            Message = message;

            MessageTypeRepository mtRep = new MessageTypeRepository();

            if (null == Message.MessageTypeReference.EntityKey)
            {
                MessageTypes = new SelectList(mtRep.GetAll(), "Id", "Description");
            }
            else
            {
                MessageTypes = new SelectList(mtRep.GetAll(), "Id", "Description", Message.MessageTypeReference.EntityKey.EntityKeyValues[0].Value);
            }

            EventTypeRepository etRep = new EventTypeRepository();

            if (null == Message.EventTypeReference.EntityKey)
            {
                EventTypes = new SelectList(etRep.GetAll(), "Id", "Description");
            }
            else
            {
                EventTypes = new SelectList(etRep.GetAll(), "Id", "Description", Message.EventTypeReference.EntityKey.EntityKeyValues[0].Value);
            }

            VideoRepository vRep = new VideoRepository();

            if (null == Message.VideoReference.EntityKey)
            {
                MyVideos = new SelectList(vRep.FindAllVideosByUser(userName).ToList(), "Id", "Description");
            }
            else
            {
                MyVideos = new SelectList(vRep.FindAllVideosByUser(userName).ToList(), "Id", "Description", Message.VideoReference.EntityKey.EntityKeyValues[0].Value);
            }

            if (!string.IsNullOrEmpty(userName))
            {
                AppUserRepository userRepository = new AppUserRepository();
                User = userRepository.GetByUserName(userName);
            }
        }
Exemplo n.º 3
0
        public List <Category> GetEventTypes()
        {
            var eventTypes = new List <Category>();

            using (var db = new ManagementToolProjectEntities())
            {
                var resp  = new EventTypeRepository(db);
                var types = resp.GetAll().ToList();

                var transformer = new CategoryTransformer();
                eventTypes = transformer.Transform(types);
            }

            return(eventTypes);
        }
Exemplo n.º 4
0
 public ActionResult CreateEvent() //Complete
 {
     TempData["EventType"] = EventTypeRepo.GetAll();
     return(View());
 }
Exemplo n.º 5
0
 public ActionResult EventPrivacy()
 {
     return(View(EventTypeRepo.GetAll()));
 }