private void BindKeys()
        {
            gridRegKeys.DataSource = null;

            RegistrationKeyController ctrlKey = new RegistrationKeyController();
            gridRegKeys.DataSource = ctrlKey.GetItems(_regID);
            gridRegKeys.DataBind();
        }
Exemplo n.º 2
0
 public int KeysUsed()
 {
     RegistrationKeyController ctrlKeys = new RegistrationKeyController();
     return ctrlKeys.GetItems(ID).Count();
 }
        protected void lbnApprove_Click(object sender, EventArgs e)
        {
            RegistrationProductController ctrlReg = new RegistrationProductController();
            _regProduct.Approved = true;

            RegistrationKeyController ctrlKey = new RegistrationKeyController();
            foreach (var key in ctrlKey.GetItems(_regProduct.ID))
            {
                if (key.RegKey == null)
                {
                    key.RegKey = ctrlKey.GenerateRegistrationKey(Settings["Seed"].ToString(), key, _regProduct);
                    ctrlKey.Update(key);
                    SendCustomerNotification(key.HostName, key.RegKey);
                    _regProduct.Status = "Keys Generated";
                }
            }

            ctrlReg.Update(_regProduct);

            Response.Redirect(EditUrl("RegID", _regID.ToString(), "Edit", "Success=Existing key requests have been processed and future requests will be processed automatically" ));
        }