コード例 #1
0
 public static void SendUserVerificationCode(User _user)
 {
     if (!UserExists(_user.phoneunumber))
     {
         _user.lastcode = StringGenerator.GenerateRandomString(6, false, true);
         _user.date     = DateTime.Now.Ticks;
         string req = "INSERT INTO Customer (username,phonenumber,email,password,tokenpass,lastcode,enddate,score) Values(";
         req += _user.ToString() + ')';
         SMSManagement.SendVerificationCode(_user);
         DataConnection.SendQuery(req);
     }
     else
     {
         _user.lastcode = StringGenerator.GenerateRandomString(6, false, true);
         _user.date     = DateTime.Now.Ticks;
         string req = "UPDATE Customer SET lastcode=\'" + StringGenerator.GenerateRandomString(6, false, true) + "\' date=" + DateTime.Now + "WHERE phonenumber=\'" + _user.phoneunumber + "\'";
         req += _user.ToString() + ')';
         SMSManagement.SendVerificationCode(_user);
         DataConnection.SendQuery(req);
     }
 }