CodeSmith Community
Your Code. Your Way. Faster!

Confirm messages - how to?

Latest post 05-04-2008 11:25 PM by fweeee. 2 replies.
  • 05-02-2008 7:43 PM

    • fweeee
    • Top 25 Contributor
    • Joined on 08-08-2007
    • Posts 191
    • Points 4,748

    Confirm messages - how to?

    I want to put confirm messages into my winforms project. Basically, when the user changes the value of a certain value, the application will give a warning message "Warning - this will automatically do this & that - do you wish to continue".

    At the moment, the only way I can think of to do this is to write all the code in the presentation layer. Is there a way of putting a confirm/warning messages into the service layer to do what I want?

    Thanks. 

    • Post Points: 35
  • 05-02-2008 10:51 PM In reply to

    • SuperJeffe
    • Top 25 Contributor
    • Joined on 05-05-2006
    • Tulsa, Ok
    • Posts 408
    • Points 10,260

    Re: Confirm messages - how to?

    Yea, I have put some thought into this for our application.  In my audit tables, i would like to put text on what changed.  The way I was going to do it was add a function to the Entity itself and say GetChanges().  It would return a string of changed properties, or maybe a List of changed values and there original values.  I thought this would be the best place since that is where all the data resided.  Plus, i don't use the ServiceLayer in my code.

    Anyway, I never got to this but I wanted to let you know where i would do it and the idea I had.  Although you would still have to handle it in the presentation layer.  You couldn't put any kind of MessageBox stuff in the service layer since in our system, that layer would reside on a server.  The code in the Entity would provide you with a way to get the Text.  Then you could check IsDirty, if that is true, display the message.

    I think this would be a nice feature.

    jeff

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 35
  • 05-04-2008 11:25 PM In reply to

    • fweeee
    • Top 25 Contributor
    • Joined on 08-08-2007
    • Posts 191
    • Points 4,748

    Re: Confirm messages - how to?

     Thanks. I dont think there is any easy way of doing this - it is going to require a bit of coding in the presentation layer to check some condition before attempting to validate the data.

     I'm thinking I'll write some method like "GetConfirmMessage" in the service layer. If this returns blank (or null), then there is nothing to confirm (dont show the confirm message). If there is a confirm message, then show it.

    • Post Points: 5
Page 1 of 1 (3 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems