Net Logon points (only one logon point per day) time comparison, points plus one
Public void jifenchange () // Point Method {// Point Module // determine the current date and the date size obtained by the task completion log database. Note: Compare () method returns 1, 0,-1. 1 indicates that the front is greater than the back, 0 is equal, and-1 is smaller than if (ids! = Null & ids. tables [0]. rows. count> 0) // if the date {DateTime nowtime = DateTime exists. now; DateTime createtime = Convert. toDateTime (ids. tables [0]. rows [0] ["creatime"]. toString (); if (DateTime. compare (nowtime. date, createtime. date) = 1) // points can be added only when the current time is greater than the database time {if (tsk. isStop = "0") // determine whether to disable this rule {// daily logon points }}} else // if not, insert the points {if (tsk. isStop = "0") {// daily logon credits }}}
ASPnet member credit code: Only one credit is added when a Member logs on several times a day.
Are you logging on to add points? Redeem the gift and deduct points ....
Code for adding credits to a logon:
Yes. In my member table, the LoginDate field indicates the logon date of the member.
If (user! = Null & (user. userName = userName) & (user. password = password )))
{
DateTime nowtime = DateTime. Now;
If (DateTime. compare (nowtime. date, user. loginDate. date) = 1) // determine the current Date and the size of the Date retrieved from the database. Note: The Compare () method returns only,-1. 1 indicates that the front is greater than the back, 0 is equal, and-1 is light rain
{
User. loginDate = nowtime;
User. integral + = 2; // Add point 2 for Logon
Us. ModifUser (user); // ModifUser () is the method for updating Member information.
}
}
It is the same principle to deduct points for a gift. First, judge whether the Member points are sufficient. If it is enough, redeem the gift, deduct the Member points, and update the database,
I didn't write the code. The code above was from my previous project. I hope you can understand the truth. Thank you !!!
What is the difference between adding logon credits for the current day to the mobile phone logon for Renren and getting the logon credits for the same day on Renren desktop?
It is calculated separately. If you get the credits for the day, you will double the credits when you log on to the Renren desktop. If you log on to the mobile phone, you will add the credits.