473,396 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with payment method logic

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

Jul 9 '06 #1
3 947
V
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:
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
Jul 9 '06 #2
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" <va*************@gmail.comwrote in message
news:11*********************@m79g2000cwm.googlegro ups.com...
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:
>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

Jul 9 '06 #3
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.

Jul 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Craig Keightley | last post by:
Please help, i have attached my page which worksin IE but i cannnot get the drop down menu to fucntion in firefox. Any one have any ideas why? Many Thanks Craig ...
18
by: Jeremy Weiss | last post by:
I'm trying to build a database that will handle the monthly billing needs of a small company. I'm charting everything out and here's what I see: table for customers sub table to track payments...
2
by: Karen | last post by:
I inserted this statement and it worked great for the customers that have no payment history, but for the customers that have a history and an open invoice, it still used today's date in the mix...
0
by: paapa21 | last post by:
I have got a page that shows student payment information. On the page the user can view total amount paid by student, amount outstanding and the course fee; add paymnent to the database; and also...
2
by: netasp | last post by:
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...
3
by: Jano | last post by:
Hi - Happy New Year! I have a web-site which accepted paypal payment for membership. No-one's buying so I want to make it free. The page which inputs the member details into the database needs...
1
by: suresh_nsnguys | last post by:
Hi guys, i am having this logic regarding payment after usage functionality for my application in my mind. when user login to my application , The popup windiow will be displayed with paypal...
2
by: eskelies | last post by:
So here is my issue. I have a multiple IF statement in Excel 2003, which I am trying to convert to Access 2003. My error in Access has to do with the OR function , which is taking place inside the IF...
8
by: Energizer100 | last post by:
My assignment is LoanTable Background: When buying a home, a very important financial consideration that many buyers face is obtaining a qualifying loan from a financial institution. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.