/// <summary> /// 画面初期化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FormRegist_Load(object sender, EventArgs e) { try { if (GetProductValue()) { string[] products = product.Split(';'); foreach (string prod in products) { cmbProduct.Items.Add(prod); } cmbProduct.SelectedIndex = 0; } txtProductID.Text = NCCryp.getProductID(); if (txtProductID.Text == "") { string msg = NCMessage.GetInstance(db.Language).GetMessageById("CM0106I", db.Language); MessageBox.Show(msg); return; } } catch (Exception ex) { NCLogger.GetInstance().WriteExceptionLog(ex); return; } if (GetConfigValue()) { txtLicId.Text = lic; if (txtLicId.Text != "" && NCCryp.checkLic(txtLicId.Text)) { btnRegist.Enabled = false; btnSend.Enabled = false; btnAdd.Enabled = false; } } if (isOwner()) { txtProductID.ReadOnly = false; btnCreate.Enabled = true; btnCreate.Visible = true; btnAdd.Enabled = true; } else { btnCreate.Enabled = false; btnCreate.Visible = false; btnAdd.Enabled = false; } }
/// <summary> /// 注册 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnRegist_Click(object sender, EventArgs e) { if (NCCryp.checkLic(txtLicId.Text)) { SetLicValue(txtLicId.Text); string msg = NCMessage.GetInstance(db.Language).GetMessageById("CM0104I", db.Language); MessageBox.Show(msg); Close(); } else { string msg = NCMessage.GetInstance(db.Language).GetMessageById("CM0105I", db.Language); MessageBox.Show(msg); } }
/// <summary> /// 取得实例 /// </summary> /// <param name="paramenter"></param> public void GetInstance(object[] paramenter) { CmWinServiceAPI db_ = null; if (paramenter.Length > 0) { db_ = (CmWinServiceAPI)paramenter[0]; } if (paramenter.Length > 1) { string serialNo = (string)paramenter[1]; if (!String.IsNullOrEmpty(serialNo)) { if (NCCryp.checkLic(serialNo, SYSTEM_ID)) { FormMain form = new FormMain(db_); form.ShowDialog(); } } } }