ERLB time entry

ERLB time entry

Old forum URL: forums.lhotka.net/forums/t/6464.aspx


esteban404 posted on Friday, February 20, 2009

I have a perplexing issue using 3.0.5. I have an ERLB object populating a DevExpress XtraGrid. In the object, there is default value for the production date created automagically. Then they enter a duration or a start and stop time which calculates a duration.

The user request is quite Access-ish. The problem is that when they enter their start and stop times, they only enter 345, not 3:45PM or 15:45, etc. Fortunately, they also enter the shift when it occurred. I created a method to take the entered value as a string and the shift number. So 345 returns 3:45PM for 2nd, and 3:45AM for 1st or 3rd shift.

Dandy.

When this value shows up in the grid and gets sent to the db, it comes through as 3:45AM regarless of my actions. It will not set correctly unless the user enters the military or AM/PM value. That's not the requested behavior.

This is a new object before insertion in the database being managed by a BindingSource.

I've tried multiple events from the grid's control and view to set the correct value and they all show the correct value leaving the event. But the UI shows and the db stores the unconverted AM value every time. It's like it's locked or set in the binding source, and will not change. If I update, it updates, but not to the manipulated date value unless that value is entered with the correct format.

Any suggestions out that to help? Is this another instance where I need to unbind? doesn't seem like I would need to since I'm setting a value in the object itself, but maybe...

[edit: I'm NOT setting it in the object. I'm setting it in the UI code. I'll try moving the method into the object and see if that helps.]

_E

Fintanv replied on Friday, February 20, 2009

Sounds like something that could be handled by a rule in your BO.

esteban404 replied on Friday, February 20, 2009

Rule didn't work. It was the way they were entering the data. That last idea I had to run the conversion from within the object and it worked. The users of this object are unique across the application, and I think I can get this to work.

In the field's setter, I call the conversion. Now I need to trap invalid entries. I just don't like doing that, but this particular object is riddled with set and get actions out of necessity for the user demands.

Thanks for the input.

Copyright (c) Marimer LLC