Esempio n. 1
0
 public void Receive(string from, string to, string content, string date)
 {
     if (ModelState.IsValid)
     {
         try
         {
             if (!string.IsNullOrEmpty(content))
             {
                 var OTPModel = new OTP()
                 {
                     Content = content,
                     Passed = false,
                     CreatedTime = DateTime.Parse(date),
                     From = from,
                     To = to
                 };
                 ParseOTP(OTPModel);
                 db.OTPs.Add(OTPModel);
                 db.SaveChanges();
             }
         }
         catch (Exception ex)
         {
             DebugHelper.Error(ex);
         }
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Parse OTP by Regular Expression
 /// </summary>
 /// <param name="OTPModel"></param>
 private void ParseOTP(OTP OTPModel)
 {
     // There aren't any parser yet 
     OTPModel.Ref = "";
     OTPModel.Result = "";
 }