using System; using WX.CRM.BLL.Base; using WX.CRM.IBLL.SYQ; using WX.CRM.Model.Entity; namespace WX.CRM.BLL.SYQ { /// /// 试用期类 /// public class SYQManager_BL : ISYQManager { public bool JudgeSYQ() { bool result = true; //string cacheKey = "cache_IsGuoQI_bool"; //if (CacheHelper.Exists(cacheKey)) //{ // result = CacheHelper.Get(cacheKey); //} //else //{ BAS_PARAMETER_BL bl = new BAS_PARAMETER_BL(); BAS_PARAMETER param = bl.GetModel_Patameter("bas_gqsj"); if (param != null) { string value = System.Web.HttpUtility.UrlDecode(param.PARAVALUE); //string value = "2018-09-30 00:00:00"; DateTime time = Convert.ToDateTime(value); //LogHelper.Info("我出来和:" + time.ToString("yyyy-MM-dd HH:mm:ss")); if (time < DateTime.Now)//试用时间已过期 { result = false; } } //CacheHelper.Set(cacheKey, result, DateTime.Now.AddMinutes(1), false);//设置缓存 一天后过期 //bl.GetModel_Patameter("") //} return result; } public void SYQErro() { if (JudgeSYQ() == false) { throw new Exception("system error 500 !At the end of the probation period, please contact the system supplier.试用期结束,请联系系统供应方。"); } } } }