Jaben
  • Posts: 2544
  • Joined: 09/10/2004
Welcome to the Modifications and Patches Forum

This is the only forum that allows file uploading (max 5 megs).

Please enhance the YAF community by posting your:

  • Modifications
  • Bug fixes/Patches
  • Smiles Packs
  • Avatars Packs
  • Themes
  • Updated Language Files

    If you are posting a Theme please attach a screen shot of the theme. For all items explain WHICH version of YAF they are designed for.

    Thanks!

    -Jaben
  • Sponsor
    Jaben
    • Posts: 2544
    • Joined: 09/10/2004
    How do you post a file?

    First, create a new topic like usual and click "Post". Then, after your new topic has been created, you click the "Attach" button on your new post. From there, you can easily upload multiple files.
    alii
    • Posts: 1
    • Joined: 23/07/2008
    Where can I have file for translating from English?
    bbobb
    • Posts: 1558
    • Joined: 21/10/2008
    Simply patch for data layer.

    bbobb
    • Posts: 1558
    • Joined: 21/10/2008
    Simply patch for data layer.
    File Attachment(s):
    sp_report_copyover.diff.zip (1kb) downloaded 218 time(s).

    bbobb
    • Posts: 1558
    • Joined: 21/10/2008
    A patch to begin separate data layer remnants from core code(harmless one).
    On applying, the /YetAnotherForum.Net/ folder will be completly cleared from MS SQL database code. And it's completly safe and tested.
    After this all the DB related code should be separated at last:-d .
    File Attachment(s):
    data_layer_separation4.patch.zip (7kb) downloaded 154 time(s).

    bbobb
    • Posts: 1558
    • Joined: 21/10/2008
    Missing conversion hacks for other data layers
    File Attachment(s):
    universal_casts_for_other_datalayers_r1.txt (3kb) downloaded 205 time(s).

    RavenDev
    • Posts: 2
    • Joined: 13/02/2009
    Lithuanian Language

    my forum at web adress www.ravendev.lt/forum 


    File Attachment(s):
    lithuanian.xml (39kb) downloaded 170 time(s).
    test2005
    • Posts: 761
    • Joined: 12/02/2005
    RavenDev wrote:

    Lithuanian Language

    my forum at web adress www.ravendev.lt/forum 




    Thanks for the contribution! :)

    .....the man in black fled across the desert..........and the gunslinger followed.....
    RavenDev
    • Posts: 2
    • Joined: 13/02/2009
    from my forum you can get image files with Lithuanian language
    bbobb
    • Posts: 1558
    • Joined: 21/10/2008
    The proposed patch to make all data layers almost safe proof compatable in future.
    It's for MS SQL data layer, but the only difference is in the DBAccess.cs file and class CoolCoverter.
    For MySQL it reads for any data layer like this^
    Quote:


    public static class CoolConverter
    {
    public static int VerifyInt32(object value)
    {
    if (value == DBNull.Value) return 0;
    return Convert.ToInt32(value);
    }
    public static bool VeryfyBool(object value)
    {
    if (value == DBNull.Value || value.ToString() == "0") return false;
    if ( value.ToString() == "1") return true;
    return Convert.ToBoolean(value);
    }
    }


    For postgreSQL it's like this
    Quote:

    public static class CoolConverter
    {

    public static int VerifyInt32(object o)
    {
    //if (o == DBNull.Value || o =="f" ) o = 0;
    // if (o == "t") o = 1;
    return Convert.ToInt32(o);
    }
    public static bool VeryfyBool(object o)
    {
    if (o.ToString() == "t") { return true; }
    if (o.ToString() == "f") { return false; }
    return false;
    }
    }


    For MS SQL Server it's simply
    Quote:

    public static class CoolConverter
    + {
    + public static int VerifyInt32(object o)
    + {
    + return (int)o;
    + }
    + public static bool VeryfyBool(object o)
    + {
    + return (bool)o;
    + }
    + }



    In the last case it's much more faster than using Convert.ToInt32 or Convert.ToBool :wink:

    Jaben
    • Posts: 2544
    • Joined: 09/10/2004
    On little thing... I have to change the name to "SqlDataLayerConverter".

    CoolConverter just isn't proper naming for the class.

    Thank you for all your help though, bbobb.
    bbobb
    • Posts: 1558
    • Joined: 21/10/2008
    Jaben wrote:

    On little thing... I have to change the name to "SqlDataLayerConverter".
    CoolConverter just isn't proper naming for the class.


    No matter, it was a temporary example class name anyway. I wait while it appears and verify data layers again to avoid any possible bugs.
    Thanks that you found time for it:)
    bbobb
    • Posts: 1558
    • Joined: 21/10/2008
    No, I was wrong.
    The class for MSSQL
    public static class SqlDataLayerConverter
    + {
    + public static int VerifyInt32(object o)
    + {
    + return (int)o;
    + }
    + public static bool VeryfyBool(object o)
    + {
    + return (bool)o;
    + }
    + }
    doesn't work, because unboxing doesn't work safe in the case though it's fast.
    Convert.To... should be used anyway:cry:
    This makes boxing of DataRow value which is already filled by a value.
    I was somehow completly sure that it should work.
    And it's impossible to make dynamic conversion class without code deep changing in many places.
    Sorry.
    Jaben
    • Posts: 2544
    • Joined: 09/10/2004
    Interestingly, I haven't applied the conversion code yet. So I'll just hold off for now. I did apply the data layer centralization changes.
    Users browsing this topic
      Forum Jump  
      • You cannot post new topics in this forum.
      • You cannot reply to topics in this forum.
      • You cannot delete your posts in this forum.
      • You cannot edit your posts in this forum.
      • You cannot create polls in this forum.
      • You cannot vote in polls in this forum.

      About Us

      The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

      Powered by Resharper Donate with PayPal button

      Project Twitter Updates

      Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved