Esempio n. 1
0
 public void DeleteApplicationLanguage(zAppDev.DotNet.Framework.Identity.Model.ApplicationLanguage applicationlanguage, bool doNotCallDeleteForThis = false, bool isCascaded = false, object calledBy = null)
 {
     if (applicationlanguage == null || applicationlanguage.IsTransient())
     {
         return;
     }
     if (applicationlanguage.DateTimeFormat != null)
     {
         var toDelete = applicationlanguage.DateTimeFormat;
         applicationlanguage.DateTimeFormat.ApplicationLanguage = null;
         applicationlanguage.DateTimeFormat = null;
         DeleteDateTimeFormat(toDelete, false, isCascaded, applicationlanguage);
     }
     if (!doNotCallDeleteForThis)
     {
         Delete <zAppDev.DotNet.Framework.Identity.Model.ApplicationLanguage>(applicationlanguage, isCascaded);
     }
 }
Esempio n. 2
0
        public void DateTimeFormat_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _applicationsystembo_applicationlanguage_datetimeformat = new zAppDev.DotNet.Framework.Identity.Model.ApplicationLanguage
            {
                Name = "ApplicationLanguage_Name",
                Code = "ApplicationLanguage_Code",
                Icon = (new System.Text.ASCIIEncoding()).GetBytes("TestValue_Icon"),
            };

            new PersistenceSpecification <zAppDev.DotNet.Framework.Identity.Model.DateTimeFormat>(Session)
            .CheckProperty(p => p.LongDatePattern, "DateTimeFormat_LongDatePattern")
            .CheckProperty(p => p.LongTimePattern, "DateTimeFormat_LongTimePattern")
            .CheckProperty(p => p.MonthDayPattern, "DateTimeFormat_MonthDayPattern")
            .CheckProperty(p => p.RFC1123Pattern, "DateTimeFormat_RFC1123Pattern")
            .CheckProperty(p => p.ShortDatePattern, "DateTimeFormat_ShortDatePattern")
            .CheckProperty(p => p.ShortTimePattern, "DateTimeFormat_ShortTimePattern")
            .CheckProperty(p => p.YearMonthPattern, "DateTimeFormat_YearMonthPattern")
            .CheckReference(p => p.ApplicationLanguage, _applicationsystembo_applicationlanguage_datetimeformat)
            .VerifyTheMappings();
        }