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

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _applicationsystembo_datetimeformat_applicationlanguage = new zAppDev.DotNet.Framework.Identity.Model.DateTimeFormat
            {
                LongDatePattern  = "DateTimeFormat_LongDatePattern",
                LongTimePattern  = "DateTimeFormat_LongTimePattern",
                MonthDayPattern  = "DateTimeFormat_MonthDayPattern",
                RFC1123Pattern   = "DateTimeFormat_RFC1123Pattern",
                ShortDatePattern = "DateTimeFormat_ShortDatePattern",
                ShortTimePattern = "DateTimeFormat_ShortTimePattern",
                YearMonthPattern = "DateTimeFormat_YearMonthPattern",
            };

            new PersistenceSpecification <zAppDev.DotNet.Framework.Identity.Model.ApplicationLanguage>(Session)
            .CheckProperty(p => p.Name, "ApplicationLanguage_Name")
            .CheckProperty(p => p.Code, "ApplicationLanguage_Code")
            .CheckProperty(p => p.Icon, (new System.Text.ASCIIEncoding()).GetBytes("TestValue_Icon"))
            .CheckReference(p => p.DateTimeFormat, _applicationsystembo_datetimeformat_applicationlanguage)
            .VerifyTheMappings();
        }