CSLA .NET

From Rockford Lhotka's Expert C# 2005 and VB 2005 Business Objects books

Welcome to CSLA .NET Sign in | Join | Help
in Search

SmartDate and ISmartField

Last post 10-02-2008, 6:15 AM by drozd. 0 replies.
Sort Posts: Previous Next
  •  10-02-2008, 6:15 AM 26812

    SmartDate and ISmartField

    Hi,

    When generating some BOs from templates I found that the SmartDate class is missing. I've merged the class and the required interface (ISmartField) from the full CSLA project, removed the non-existing attribute from SmartDate and substituted the DateTime.TryParse with a call to a newly implemented:

       private static bool TryParseDateTime(string s, out DateTime result)
            {
                result = DateTime.MinValue;
                try
                {
                    result = DateTime.Parse(s);
                    return true;
                }
                catch (ArgumentNullException)
                {
                    return false;
                }
                catch (FormatException)
                {
                    return false;
                }
            }

    I haven't yet tested it thoroughly but I think it should work.

    Are there any other reasons why the SmartDate class has been removed from the CSLA CE project?

    Thanks,
    Michał
View as RSS news feed in XML

Please contact Magenic for your .NET consulting and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Powered by Community Server, by Telligent Systems