public ActivationViewModel() { CleanUp(); string connectionStringName = DbCommandUtil.GetActivationConnectionString(); _dbContext = new EntitiesModel(connectionStringName); _unitOfWork = new UnitOfWork(DbContextUtil.GetDbContextInstance()); ProductActivation = _unitOfWork.Repository <ProductActivationDTO>() .Query().Get() .FirstOrDefault() ?? new ProductActivationDTO(); ProgressBarVisibility = "Collapsed"; CommandsEnability = true; BiosNo = "Bios No:" + new ProductActivationDTO().BiosSn; }
private ActivationKey CheckProductRenewalOnActivationServer(string productKey) { try { string connectionStringName = DbCommandUtil.GetActivationConnectionString(); var dbContext = new EntitiesModel(connectionStringName); ActivationKey key = dbContext.ActivationKeys .FirstOrDefault(a => a.ProductKey == productKey && a.KeyStatus == 0 && a.ProductType == 0); return(key); } catch { return(null); } }