private void BindLicenseAllocatedGridView() { GridViewLicenseAllocated.DataSource = License.GetLicenseListByLicenseKey(DropDownListLicenseAllocated.SelectedItem.Text, this.insightSupplierId); GridViewLicenseAllocated.DataBind(); PanelLicenseAllocatedGrid.Visible = GridViewLicenseAllocated.Rows.Count > 0; }
private void BindLicenseAllocatedGridView() { GridViewLicenseAllocated.DataSource = License.GetLicenseListByLicenseKey(TextBoxLicenseKey.Text, Convert.ToInt32(DropDownListInsightSupplier.SelectedValue)); GridViewLicenseAllocated.DataBind(); PanelLicenseAllocatedGrid.Visible = GridViewLicenseAllocated.Rows.Count > 0; }
private void ClearLicenseAllocated() { DropDownListLicenseAllocated.ClearSelection(); DropDownListLicenseAllocated.Items.FindByValue("0").Selected = true; GridViewLicenseAllocated.DataSource = null; GridViewLicenseAllocated.DataBind(); PanelLicenseAllocatedGrid.Visible = GridViewLicenseAllocated.Rows.Count > 0; }
protected void ButtonAddLicense_Click(object sender, EventArgs e) { bool hasError = false; PanelError.Visible = false; LabelError.Text = ""; if (RadioButtonAvailableLicenseKeys.Checked) { if (DropDownListLicense.SelectedValue == "0") { LabelError.Text += "Available License Key is required."; hasError = true; } } else { if (DropDownListLicenseAllocated.SelectedValue == "0") { LabelError.Text += "Allocated License Key is required."; hasError = true; } } if (DropDownListQlikviewVersion.SelectedValue == "0") { LabelError.Text += "Qlikview version is required."; hasError = true; } if (hasError == true) { PanelError.Visible = true; return; } InsightSupplierContactLicense insightSupplierContactLicense = new InsightSupplierContactLicense(); insightSupplierContactLicense.InsightSupplierContactId = this.insightSupplierContactId; insightSupplierContactLicense.AccessMethodId = Convert.ToInt32(DropDownListAccessMethod.SelectedValue); insightSupplierContactLicense.Username = ""; insightSupplierContactLicense.Password = ""; if (RadioButtonAvailableLicenseKeys.Checked) { insightSupplierContactLicense.LicenseId = Convert.ToInt32(DropDownListLicense.SelectedValue); } else { insightSupplierContactLicense.LicenseId = Convert.ToInt32(DropDownListLicenseAllocated.SelectedValue); } insightSupplierContactLicense.QlikviewVersionId = Convert.ToInt32(DropDownListQlikviewVersion.SelectedValue); insightSupplierContactLicense.ModifiedUser = Context.User.Identity.GetUserName(); insightSupplierContactLicense.Save(); InsightSupplierContactLicense.UpdateInsightSupplierContactLicenseInSparMapperByInsightSupplierContactId(this.insightSupplierContactId, (TextBoxInSparMapperUsername.Text.Length > 0) ? TextBoxInSparMapperUsername.Text : "", (TextBoxInSparMapperPassword.Text.Length > 0) ? TextBoxInSparMapperPassword.Text : "", Context.User.Identity.GetUserName()); PanelLicenseAllocatedGrid.Visible = false; GridViewLicenseAllocated.DataSource = null; GridViewLicenseAllocated.DataBind(); BindLicense(); BindLicenseAllocated(); BindQlikviewVersion(); BindLicenseGridView(this.insightSupplierContactId); BindLicense(); BindInsightSupplierContactGridView(); }