Exemplo n.º 1
0
 /// <summary>
 /// Save the entity to the database. This method will auto-generate activity tracking.
 /// </summary>
 public CustomerInfo Save()
 {
     // Ensure data does not contain cross site scripting injection HTML/Js/SQL
     FirstName  = new HtmlUnsafeCleanser(FirstName).Cleanse();
     MiddleName = new HtmlUnsafeCleanser(MiddleName).Cleanse();
     LastName   = new HtmlUnsafeCleanser(LastName).Cleanse();
     return(base.Update());
 }
Exemplo n.º 2
0
 public void Core_Text_Cleanser_HtmlUnsafe()
 {
     var safeHtml = string.Empty;
     var cleanser = new HtmlUnsafeCleanser(unsafeHtml);
     safeHtml = cleanser.Cleanse();
     Assert.IsTrue(safeHtml.Contains(unsafeTag1.SubstringLeft(6)) == false, "Did not work.");
     Assert.IsTrue(safeHtml.Contains(safeTag1) == true, "Did not work.");
 }
Exemplo n.º 3
0
        public void Text_Cleanser_HtmlUnsafe()
        {
            var safeHtml = TypeExtension.DefaultString;
            var cleanser = new HtmlUnsafeCleanser(unsafeHtml);

            safeHtml = cleanser.Cleanse();
            Assert.IsTrue(safeHtml.Contains(unsafeTag1.SubstringLeft(6)) == false, "Did not work.");
            Assert.IsTrue(safeHtml.Contains(safeTag1) == true, "Did not work.");
        }
Exemplo n.º 4
0
 /// <summary>
 /// Commits to database
 /// </summary>
 public async Task <ResourceTimeRecurring> SaveAsync()
 {
     ResourceName        = new HtmlUnsafeCleanser(ResourceName).Cleanse().ToPascalCase();
     ResourceDescription = new HtmlUnsafeCleanser(ResourceDescription).Cleanse();
     using (var writer = new EntityWriter <ResourceTimeRecurring>(this, new ResourceTimeRecurringSPConfig()))
     {
         return(await writer.SaveAsync());
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Save the entity to the database.
 /// This method requires a valid Activity to track this database commit
 /// </summary>
 /// <param name="activity">Activity tracking this record</param>
 public new CustomerInfo Save(IActivityContext activity)
 {
     base.ActivityContextID = activity.ActivityContextID;
     // Ensure data does not contain cross site scripting injection HTML/Js/SQL
     FirstName  = new HtmlUnsafeCleanser(FirstName).Cleanse();
     MiddleName = new HtmlUnsafeCleanser(MiddleName).Cleanse();
     LastName   = new HtmlUnsafeCleanser(LastName).Cleanse();
     return(base.Update());
 }
Exemplo n.º 6
0
        /// <summary>
        /// Save the entity to the database. This method will auto-generate activity tracking.
        /// </summary>
        public CustomerInfo Save()
        {
            var writer = new StoredProcedureWriter <CustomerInfo>();

            // Ensure data does not contain cross site scripting injection HTML/Js/SQL
            FirstName  = new HtmlUnsafeCleanser(FirstName).Cleanse();
            MiddleName = new HtmlUnsafeCleanser(MiddleName).Cleanse();
            LastName   = new HtmlUnsafeCleanser(LastName).Cleanse();
            this.Fill(writer.Save(this));
            return(this);
        }
Exemplo n.º 7
0
 /// <summary>
 /// Save the entity to the database. This method will auto-generate activity tracking.
 /// </summary>
 public async Task <ResourcePerson> SaveAsync()
 {
     // Ensure data does not contain cross site scripting injection HTML/Js/SQL
     FirstName  = new HtmlUnsafeCleanser(this.FirstName).Cleanse();
     MiddleName = new HtmlUnsafeCleanser(this.MiddleName).Cleanse();
     LastName   = new HtmlUnsafeCleanser(this.LastName).Cleanse();
     using (var writer = new EntityWriter <ResourcePerson>(this, new ResourcePersonSPConfig()))
     {
         return(await writer.SaveAsync());
     }
 }