Inheritance: Connect.Conference.Core.Data.AuditableEntity
Esempio n. 1
0
        public ConferenceBase GetConferenceBase()
        {
            ConferenceBase res = new ConferenceBase();

            res.ConferenceId            = ConferenceId;
            res.PortalId                = PortalId;
            res.Name                    = Name;
            res.Description             = Description;
            res.StartDate               = StartDate;
            res.EndDate                 = EndDate;
            res.MaxCapacity             = MaxCapacity;
            res.SessionVoting           = SessionVoting;
            res.AttendeeRole            = AttendeeRole;
            res.SpeakerRole             = SpeakerRole;
            res.Location                = Location;
            res.Url                     = Url;
            res.SubmittedSessionsPublic = SubmittedSessionsPublic;
            res.TimeZoneId              = TimeZoneId;
            res.MqttBroker              = MqttBroker;
            res.MqttBrokerUsername      = MqttBrokerUsername;
            res.MqttBrokerPassword      = MqttBrokerPassword;
            res.BaseTopicPath           = BaseTopicPath;
            res.CreatedByUserID         = CreatedByUserID;
            res.CreatedOnDate           = CreatedOnDate;
            res.LastModifiedByUserID    = LastModifiedByUserID;
            res.LastModifiedOnDate      = LastModifiedOnDate;
            return(res);
        }
 public ActionResult Edit(ConferenceBase conference)
 {
     var previousRecord = _repository.GetConference(PortalSettings.PortalId, conference.ConferenceId);
     if (previousRecord == null)
     {
         _repository.AddConference(ref conference, User.UserID);
     }
     else
     {
         conference.CreatedOnDate = previousRecord.CreatedOnDate;
         conference.CreatedByUserID = previousRecord.CreatedByUserID;
         _repository.UpdateConference(conference, User.UserID);
     }
     return RedirectToDefaultRoute();
 }
Esempio n. 3
0
        public static void SaveLogo(this ConferenceBase conference, PortalSettings portal, Stream logo, string extension)
        {
            conference.ClearLogos(portal);
            var folderName = string.Format("{0}\\{1}", portal.HomeDirectoryMapPath,
                                           Common.Globals.GetConferenceImagePath(conference.ConferenceId, "\\")
                                           );

            if (!Directory.Exists(folderName))
            {
                Directory.CreateDirectory(folderName);
            }
            using (var sw = new FileStream(string.Format("{0}original{1}", folderName, extension), FileMode.OpenOrCreate, FileAccess.Write))
            {
                logo.CopyTo(sw);
            }
        }
Esempio n. 4
0
       public ConferenceBase GetConferenceBase()
       {
           ConferenceBase res = new ConferenceBase();
            res.ConferenceId = ConferenceId;
            res.PortalId = PortalId;
            res.Name = Name;
            res.Description = Description;
            res.StartDate = StartDate;
            res.EndDate = EndDate;
            res.MaxCapacity = MaxCapacity;
            res.SessionVoting = SessionVoting;
            res.AttendeeRole = AttendeeRole;
            res.SpeakerRole = SpeakerRole;
            res.Location = Location;
            res.Url = Url;
 res.CreatedByUserID = CreatedByUserID;
 res.CreatedOnDate = CreatedOnDate;
 res.LastModifiedByUserID = LastModifiedByUserID;
 res.LastModifiedOnDate = LastModifiedOnDate;
           return res;
       }
Esempio n. 5
0
        public void ReadConferenceBase(ConferenceBase conference)
        {
            if (conference.ConferenceId > -1)
                ConferenceId = conference.ConferenceId;

            if (conference.PortalId > -1)
                PortalId = conference.PortalId;

            if (!String.IsNullOrEmpty(conference.Name))
                Name = conference.Name;

            if (!String.IsNullOrEmpty(conference.Description))
                Description = conference.Description;

            if (conference.StartDate != null)
            StartDate = conference.StartDate;

            if (conference.EndDate != null)
            EndDate = conference.EndDate;

            if (conference.MaxCapacity > -1)
                MaxCapacity = conference.MaxCapacity;

            SessionVoting = conference.SessionVoting;

            if (conference.AttendeeRole > -1)
                AttendeeRole = conference.AttendeeRole;

            if (conference.SpeakerRole > -1)
                SpeakerRole = conference.SpeakerRole;

            if (!String.IsNullOrEmpty(conference.Location))
                Location = conference.Location;

            if (!String.IsNullOrEmpty(conference.Url))
                Url = conference.Url;

        }
Esempio n. 6
0
        public static string GetLogo(this ConferenceBase conference, PortalSettings portal, int size)
        {
            var folderName = string.Format("{0}\\{1}", portal.HomeDirectoryMapPath,
                                           Common.Globals.GetConferenceImagePath(conference.ConferenceId, "\\")
                                           );

            if (!Directory.Exists(folderName))
            {
                return("");
            }
            var folder = new DirectoryInfo(folderName);
            var files  = folder.GetFiles(size.ToString() + ".*");

            if (files.Length > 0)
            {
                return(files[0].FullName);
            }
            files = folder.GetFiles("original.*");
            if (files.Length == 0)
            {
                return("");
            }
            // resize logic
            var ext = Path.GetExtension(files[0].Name);

            using (var sr = new FileStream(files[0].FullName, FileMode.Open, FileAccess.Read))
            {
                var sizedContent = DotNetNuke.Common.Utilities.ImageUtils.CreateImage(sr, size, size, Path.GetExtension(files[0].Name));
                sizedContent.Seek(0, SeekOrigin.Begin);
                using (var sw = new FileStream(string.Format("{0}{1}{2}", folderName, size, ext), FileMode.OpenOrCreate, FileAccess.Write))
                {
                    sizedContent.CopyTo(sw);
                }
            }
            return(string.Format("{0}{1}{2}", folderName, size, ext));
        }
Esempio n. 7
0
        public static void ClearLogos(this ConferenceBase conference, PortalSettings portal)
        {
            var folderName = string.Format("{0}\\{1}", portal.HomeDirectoryMapPath,
                                           Common.Globals.GetConferenceImagePath(conference.ConferenceId, "\\")
                                           );

            if (!Directory.Exists(folderName))
            {
                return;
            }
            var folder = new DirectoryInfo(folderName);
            var files  = Directory.GetFiles(folderName, "*.*");

            foreach (var f in files)
            {
                try
                {
                    File.Delete(f);
                }
                catch (System.Exception)
                {
                }
            }
        }
Esempio n. 8
0
        public void ReadConferenceBase(ConferenceBase conference)
        {
            if (conference.ConferenceId > -1)
            {
                ConferenceId = conference.ConferenceId;
            }

            if (conference.PortalId > -1)
            {
                PortalId = conference.PortalId;
            }

            if (!String.IsNullOrEmpty(conference.Name))
            {
                Name = conference.Name;
            }

            if (!String.IsNullOrEmpty(conference.Description))
            {
                Description = conference.Description;
            }

            if (conference.StartDate != null)
            {
                StartDate = conference.StartDate;
            }

            if (conference.EndDate != null)
            {
                EndDate = conference.EndDate;
            }

            if (conference.MaxCapacity > -1)
            {
                MaxCapacity = conference.MaxCapacity;
            }

            SessionVoting = conference.SessionVoting;

            if (conference.AttendeeRole > -1)
            {
                AttendeeRole = conference.AttendeeRole;
            }

            if (conference.SpeakerRole > -1)
            {
                SpeakerRole = conference.SpeakerRole;
            }

            if (!String.IsNullOrEmpty(conference.Location))
            {
                Location = conference.Location;
            }

            if (!String.IsNullOrEmpty(conference.Url))
            {
                Url = conference.Url;
            }

            SubmittedSessionsPublic = conference.SubmittedSessionsPublic;
        }
Esempio n. 9
0
        public void ReadConferenceBase(ConferenceBase conference)
        {
            if (conference.ConferenceId > -1)
            {
                ConferenceId = conference.ConferenceId;
            }

            if (conference.PortalId > -1)
            {
                PortalId = conference.PortalId;
            }

            if (!String.IsNullOrEmpty(conference.Name))
            {
                Name = conference.Name;
            }

            if (!String.IsNullOrEmpty(conference.Description))
            {
                Description = conference.Description;
            }

            if (conference.StartDate != null)
            {
                StartDate = conference.StartDate;
            }

            if (conference.EndDate != null)
            {
                EndDate = conference.EndDate;
            }

            if (conference.MaxCapacity > -1)
            {
                MaxCapacity = conference.MaxCapacity;
            }

            SessionVoting = conference.SessionVoting;

            if (conference.AttendeeRole > -1)
            {
                AttendeeRole = conference.AttendeeRole;
            }

            if (conference.SpeakerRole > -1)
            {
                SpeakerRole = conference.SpeakerRole;
            }

            if (!String.IsNullOrEmpty(conference.Location))
            {
                Location = conference.Location;
            }

            if (!String.IsNullOrEmpty(conference.Url))
            {
                Url = conference.Url;
            }

            SubmittedSessionsPublic = conference.SubmittedSessionsPublic;

            if (!String.IsNullOrEmpty(conference.TimeZoneId))
            {
                TimeZoneId = conference.TimeZoneId;
            }

            if (!String.IsNullOrEmpty(conference.MqttBroker))
            {
                MqttBroker = conference.MqttBroker;
            }

            if (!String.IsNullOrEmpty(conference.MqttBrokerUsername))
            {
                MqttBrokerUsername = conference.MqttBrokerUsername;
            }

            if (!String.IsNullOrEmpty(conference.MqttBrokerPassword))
            {
                MqttBrokerPassword = conference.MqttBrokerPassword;
            }

            if (!String.IsNullOrEmpty(conference.BaseTopicPath))
            {
                BaseTopicPath = conference.BaseTopicPath;
            }
        }