Real Software Forums
http://forums.realsoftware.com/

I need a Idea ToDo this
http://forums.realsoftware.com/viewtopic.php?f=9&t=47275
Page 1 of 1

Author:  jetpr [ Tue Mar 12, 2013 9:03 pm ]
Post subject:  I need a Idea ToDo this

I need to make some algorithm to approve credit to some customers.

When the employee called the owner to see if the credit approved as the owner runs a small APPLICATION or a mathematical calculation and gives the approval number that customer credit.

Something like that is the idea

:idea:

Author:  kermit [ Wed Mar 13, 2013 1:48 am ]
Post subject:  Re: I need a Idea ToDo this

Really not enough information.

Based on just that:

constant  CredLimit as double = 1000.00
If (AmountCurrentlyOwed + AMountBeingAskedFor) < CredLimit then
msgbox "Approve"
else
msgbox "Do not Approve : available credit = " + format (credLimit - AmountCurrentlyOwed,"0.00)
end if

Author:  jetpr [ Wed Mar 13, 2013 7:25 am ]
Post subject:  Re: I need a Idea ToDo this

no is no that

what i need is like type off security to produce a security code
:?:

Author:  silverpie [ Wed Mar 13, 2013 10:26 am ]
Post subject:  Re: I need a Idea ToDo this

Sounds like a job for SSLSocket.

Author:  Bob Coleman [ Wed Mar 13, 2013 3:39 pm ]
Post subject:  Re: I need a Idea ToDo this

Sounds like you need a one off authorization code.

  • I would have the program generate a random number of the required digits.
  • Check a database to see if it was already used.
  • Repeat 1 and 2 as needed until you have a unique code.
  • Store the unique code in the database along with any customer details collected.

Author:  jetpr [ Wed Mar 13, 2013 3:46 pm ]
Post subject:  Re: I need a Idea ToDo this

Yes Bob

Author:  Bob Coleman [ Wed Mar 13, 2013 5:44 pm ]
Post subject:  Re: I need a Idea ToDo this

This is off the top of my head:

' This code would be under a generate button.

Dim r as New Random
Dim u as Double

r.RandomizeSeed

Do
u = r.InRange(100000,999999) ' Going for six digit numbers here.
Loop Until uniqueVal(u)

Return u


Function uniqueVal(u As Double) As Boolean

' I'm assuming you have opened the database elsewhere.

Dim rs as RecordSet = db.SQLSelect("select * from discounttable where ID=""" + str(u) + """") ' Properly this should be a prepared statement.
If rs <> Nil then
Return False
Else
Return True
End If

End Function


You would update the database in the save button's event along with any other information in your form.

Author:  jetpr [ Wed Mar 13, 2013 8:03 pm ]
Post subject:  Re: I need a Idea ToDo this

thanks

:idea:

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/