tijian_tieying/web/dccdc.BLL/DuanXinYanZheng.cs
2025-02-20 12:14:39 +08:00

54 lines
2.3 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using dccdc.Models;
namespace dccdc.BLL
{
public class DuanXinYanZhengBll
{
public Models.DuanXinYanZheng getYanZheng(string sessionID, string cookieid, string userHostAddress, string mobile)
{
/* throw new NotImplementedException();
* var yz = cont.DuanXinYanZheng.Where(t => t.ShouJiHao == sjh && DbFunctions.DiffDays(DateTime.Now,t.sendtime)==0).Count();
if(yz>=5)
{
return new Model.DuanXinYanZheng { bz = "同一个手机号一天之内只能获取5次验证码" };
}
else
{
var yzm = new Model.DuanXinYanZheng { state = 0, cookie = cookieid, IP = ip, sendtime = DateTime.Now, SessionID = sessionid, ShouJiHao = sjh, YanZhengYouXiaoQi = 10, smscode = new Common.ValidateCode().CreateValidateCode(6) };
cont.DuanXinYanZheng.Add(yzm);
cont.SaveChanges();
return yzm;
}*/
//var c = new DAL.DuanXinYanZhengDal().getDRYZCS(mobile);
//var cangetcont = new BLL.Common().getParm_Value("tysjmrjdsl", "3", "同一手机每日可最大获取验证码次数!");
//int cc = 0;
//int.TryParse(cangetcont, out cc);
//if (c >= cc)
//{
// return new Models.DuanXinYanZheng { bz = "同一个手机号一天之内只能获取" + cangetcont + "次验证码!" };
//}
var yzm = new Models.DuanXinYanZheng { state = 0, cookie = cookieid, IP = userHostAddress, sendtime = DateTime.Now, SessionID = sessionID, ShouJiHao = mobile, YanZhengYouXiaoQi = 10, smscode = new dccdc.ValidateCode().CreateValidateCode(6) };
yzm = new DAL.DuanXinYanZhengDal().Create(yzm);
return yzm;
}
public Models.DuanXinYanZheng getYZMById(string yzmid)
{
//throw new NotImplementedException();
return new DAL.DuanXinYanZhengDal().getYZMById(yzmid);
}
public void YanZhenged(DuanXinYanZheng yzm)
{
//throw new NotImplementedException();
new DAL.DuanXinYanZhengDal().YanZhenged(yzm);
}
}
}