Connecting Tech Pros Worldwide Forums | Help | Site Map

Help with payment method logic

netasp
Guest
 
Posts: n/a
#1: Jul 9 '06
hi all,
I need your help with the following scenario:
I am using VS 2005 and SQL server DB, my form has 3 textboxes

txtTotalAmount, txtAmountEntered, txtAmountBalance. If txtTotalAmount is
$20.00 for example then user can enter $2.00 in cash, $2.00 in MasterCard,
$16.00 in Cash ,..etc until total amount is reached then balance will show
to user.

I just don't know whats the best way to approach this? store everything in
public variables? public properties? Datatable fields? what is the most
effecient and less overhead call (best practice)?
If user enters the proper amount, then its an easy formula, but when you
have
multiple payments (ex: $5 in cash, $5 in Interac, $5 in visa and $20 in
cash - here is the problem!) the LAST $20 in cash is actually ONLY
$5.00(toward the balance)
that must be added to the cash value for that transaction and $15.00 must be
returned to the customer.

does anyone have a solution for this scenario?

thanks alot




V
Guest
 
Posts: n/a
#2: Jul 9 '06

re: Help with payment method logic


Well you could use a number of client-side approaches. You could make a
custom validator with the javascript that you provide implementing the
logic for your page (totaling, showing balance, etc.)... and only when
the amounts are right, will your page postback.

- Vaibhav

netasp wrote:
Quote:
hi all,
I need your help with the following scenario:
I am using VS 2005 and SQL server DB, my form has 3 textboxes
>
txtTotalAmount, txtAmountEntered, txtAmountBalance. If txtTotalAmount is
$20.00 for example then user can enter $2.00 in cash, $2.00 in MasterCard,
$16.00 in Cash ,..etc until total amount is reached then balance will show
to user.
>
I just don't know whats the best way to approach this? store everything in
public variables? public properties? Datatable fields? what is the most
effecient and less overhead call (best practice)?
If user enters the proper amount, then its an easy formula, but when you
have
multiple payments (ex: $5 in cash, $5 in Interac, $5 in visa and $20 in
cash - here is the problem!) the LAST $20 in cash is actually ONLY
$5.00(toward the balance)
that must be added to the cash value for that transaction and $15.00 must be
returned to the customer.
>
does anyone have a solution for this scenario?
>
thanks alot
netasp
Guest
 
Posts: n/a
#3: Jul 9 '06

re: Help with payment method logic


Thanks V for your reply,

it's a windows application not a web, and some suggested the use of public
variables where storing all values and someone else suggested storing them
in a datatable, the app suppose to be a multi-user access, and i don't think
the use of public variable all over the application is a wise thing.

I am sure there are a lot of ppl in here who developed something similar to
this and i am very much interested to hear their input on this matter and
how did they approach it?

thanks,

"V" <vaibhav.gadodia@gmail.comwrote in message
news:1152454738.532533.15470@m79g2000cwm.googlegro ups.com...
Quote:
Well you could use a number of client-side approaches. You could make a
custom validator with the javascript that you provide implementing the
logic for your page (totaling, showing balance, etc.)... and only when
the amounts are right, will your page postback.
>
- Vaibhav
>
netasp wrote:
Quote:
>hi all,
>I need your help with the following scenario:
>I am using VS 2005 and SQL server DB, my form has 3 textboxes
>>
>txtTotalAmount, txtAmountEntered, txtAmountBalance. If txtTotalAmount is
>$20.00 for example then user can enter $2.00 in cash, $2.00 in
>MasterCard,
>$16.00 in Cash ,..etc until total amount is reached then balance will
>show
>to user.
>>
>I just don't know whats the best way to approach this? store everything
>in
>public variables? public properties? Datatable fields? what is the most
>effecient and less overhead call (best practice)?
>If user enters the proper amount, then its an easy formula, but when you
>have
>multiple payments (ex: $5 in cash, $5 in Interac, $5 in visa and $20 in
>cash - here is the problem!) the LAST $20 in cash is actually ONLY
>$5.00(toward the balance)
>that must be added to the cash value for that transaction and $15.00 must
>be
>returned to the customer.
>>
>does anyone have a solution for this scenario?
>>
>thanks alot
>

Jeffrey Tan[MSFT]
Guest
 
Posts: n/a
#4: Jul 10 '06

re: Help with payment method logic


Hi Netasp,

I have added a reply to you in microsoft.public.dotnet.languages.vb
newsgroup, please check it there. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Closed Thread