public ServiceBasedController() { if (service == null) { this.service = new PublicService(); } log = LogManager.GetLogger(this.GetType().FullName); _LicenseInfo = this.service._LicenseInfo;//zjy //ViewBag.LinceseInfo = string.Format("{0}({1}{2})", _LicenseInfo.LicenceTo, _LicenseInfo.Edition, _LicenseInfo.DaysLeftInTrial > 30 ? "" : "-" + _LicenseInfo.DaysLeftInTrial); //if(_LicenseInfo.Verify&&_LicenseInfo.type==1) // ViewBag.LinceseInfo = string.Format("{0}({1}{2})", "永久授权", "版本号:", _LicenseInfo.Version); try { if (_LicenseInfo.Verify && _LicenseInfo.type == 2) { DateTime dateEnd = Convert.ToDateTime(_LicenseInfo.DateEnd); if (dateEnd.AddDays(-7) < DateTime.Now) { ViewBag.LinceseInfo = string.Format("{0}({1}{2})", "限时授权 " + Convert.ToDateTime(_LicenseInfo.DateEnd).ToString("yyyy年MM月dd日") + "到期", " 版本号:", _LicenseInfo.Version); } } } catch (Exception e) { ViewBag.LinceseInfo = e.Message; } }
/// <summary> /// /// </summary> /// <param name="uow"></param> internal ServiceBase(IUnitOfWork uow) { this.m_UnitOfWork = uow; this.m_RepoBase = this.m_UnitOfWork.GetRepositoryBase <TEntity>(); this.logger = LogManager.GetLogger(this.GetType().FullName); _LicenseInfo = GetLic(); //zjy }