示例#1
0
        /// <summary>
        /// Saves the video to the file system.
        /// </summary>
        public void Save(IContentLocator contentLocator)
        {
            if (!this.IsValidFile)
            {
                throw new Exception("Invalid file type. Can only accept mp4, avi, ogv and webm extensions.");
            }

            String filePath = contentLocator.GetPath(this.Url);
            this.File.SaveAs(filePath);
        }
示例#2
0
        /// <summary>
        /// Saves the Audio to the file system
        /// </summary>
        public void Save(IContentLocator contentLocator)
        {
            if (!this.IsValidFile)
            {
                throw new Exception("Invalid file type. Can only accept mp3 and wav extensions.");
            }

            String filePath = contentLocator.GetPath(this.Url);

            this.File.SaveAs(filePath);
        }
示例#3
0
        /// <summary>
        /// Sends an email to the user with verification link.
        /// </summary>
        private void SendVerificationEmail(String userId, IContentLocator contentLocator)
        {
            String filePath = contentLocator.GetPath("~/Content/documents/VerifyAccount.html");

            string emailContent =
                File.ReadAllText(filePath)
                    .Replace("%FirstName%", this.User.FirstName)
                    .Replace("%UserId%", userId);

            Email email = new Email
            {
                FromEmail = "*****@*****.**",
                FromName = "Crime Buster Admin",
                ToEmail = this.User.Email,
                Subject = "[Crime Busters] Please Verify Your Account",
                Body = emailContent,
                IsHighImportance = true
            };
            email.SendEmail();
        }
示例#4
0
        /// <summary>
        /// Sends an email to the user with verification link.
        /// </summary>
        private void SendVerificationEmail(String userId, IContentLocator contentLocator)
        {
            String filePath = contentLocator.GetPath("~/Content/documents/VerifyAccount.html");

            string emailContent =
                File.ReadAllText(filePath)
                .Replace("%FirstName%", this.User.FirstName)
                .Replace("%UserId%", userId);

            Email email = new Email
            {
                FromEmail        = "*****@*****.**",
                FromName         = "Crime Buster Admin",
                ToEmail          = this.User.Email,
                Subject          = "[Crime Busters] Please Verify Your Account",
                Body             = emailContent,
                IsHighImportance = true
            };

            email.SendEmail();
        }