Net Logon points (only one logon point per day) time comparison, points plus one

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.