public static string GetSKeyBuyEmail(string email, Model.SMSType type) { DateTime date = DateTime.Now.AddSeconds(-BLL.Configuration.CodeTime[type.ToString()]); List <Model.SMS> list = BLL.SMS.GetList(string.Format("Email='{0}' and SType='{1}' and SendState='1' and CreateDate>'{2}' order by SID desc", email, type, date)); if (list.Count > 0) { return(list[0].SMSKey); } return(""); }
private static bool TimeVerify(string tel, Model.SMSType type, int time) { List <Model.SMS> list = BLL.SMS.GetList(string.Format("Tel='{0}' and SType='{1}' order by SID desc", tel, type)); if (list.Count > 0) { if ((DateTime.Now - list[0].CreateDate).TotalSeconds > time) { return(true); } return(false); } return(true); }