private void UpdateAgreementText() { LicenseAgreement licenseAgreement = LicenseAgreementDataSource.Load(_LicenseAgreementIds[this.DisplayIndex]); if (licenseAgreement != null) { Page.Title = licenseAgreement.DisplayName; AgreementText.Text = licenseAgreement.AgreementText; } }
private void BindAgreements() { IList <LicenseAgreement> agreements = LicenseAgreementDataSource.LoadAll("DisplayName"); int index = agreements.IndexOf(_AgreementId); if (index > -1) { agreements.RemoveAt(index); } AgreementList.DataSource = agreements; AgreementList.DataBind(); }
protected void Page_Init(object sender, System.EventArgs e) { _AgreementId = AlwaysConvert.ToInt(Request.QueryString["AgreementId"]); _Agreement = LicenseAgreementDataSource.Load(_AgreementId); if (_Agreement == null) { Response.Redirect("Default.aspx"); } Caption.Text = string.Format(Caption.Text, _Agreement.DisplayName); InstructionText.Text = string.Format(InstructionText.Text, _Agreement.DisplayName); BindAgreements(); ProductsGrid.DataSource = _Agreement.DigitalGoods; ProductsGrid.DataBind(); }
protected void Page_Load(object sender, System.EventArgs e) { _AgreementId = AlwaysConvert.ToInt(Request.QueryString["AgreementId"]); _Agreement = LicenseAgreementDataSource.Load(_AgreementId); if (_Agreement == null) { Response.Redirect("Agreements.aspx"); } if (!Page.IsPostBack) { DisplayName.Text = _Agreement.DisplayName; IsHtml.Checked = _Agreement.IsHTML; AgreementText.Text = _Agreement.AgreementText; } DigitalGoodsGrid.DataSource = _Agreement.DigitalGoods; DigitalGoodsGrid.DataBind(); Caption.Text = string.Format(Caption.Text, _Agreement.DisplayName); AbleCommerce.Code.PageHelper.SetHtmlEditor(AgreementText, HtmlButton); }
protected void Page_Load(object sender, EventArgs e) { int licenseAgreementId = AlwaysConvert.ToInt(Request.QueryString["id"]); LicenseAgreement licenseAgreement = LicenseAgreementDataSource.Load(licenseAgreementId); if (licenseAgreement == null) { Response.Redirect(AcceptUrl); } Page.Title = licenseAgreement.DisplayName; AgreementText.Text = licenseAgreement.AgreementText; if (HasReturnUrl) { OKLink.NavigateUrl = ReturnUrl; AcceptLink.Visible = false; DeclineLink.Visible = false; } else { OKLink.Visible = false; AcceptLink.NavigateUrl = AcceptUrl; DeclineLink.NavigateUrl = DeclineUrl; } }
private void InitializeForm(bool forceRefresh) { int digitalGoodId = AlwaysConvert.ToInt(Request.QueryString["DigitalGoodId"]); _DigitalGood = DigitalGoodDataSource.Load(digitalGoodId); if (_DigitalGood == null) { Response.Redirect(CancelButton.NavigateUrl); } RenameFileExtensions.Text = AbleContext.Current.Store.Settings.FileExt_DigitalGoods; if (!Page.IsPostBack || forceRefresh) { Name.Text = _DigitalGood.Name; FileName.Text = _DigitalGood.FileName; MediaKey.Text = _DigitalGood.MediaKey; ListItem item = ActivationMode.Items.FindByValue(_DigitalGood.ActivationModeId.ToString()); if (item != null) { item.Selected = true; } if (_DigitalGood.MaxDownloads > 0) { MaxDownloads.Text = _DigitalGood.MaxDownloads.ToString(); } int days, hours, minutes; DigitalGood.ParseTimeout(_DigitalGood.ActivationTimeout, out days, out hours, out minutes); if (days > 0) { ActivationTimeoutDays.Text = days.ToString(); } if (hours > 0) { ActivationTimeoutHours.Text = hours.ToString(); } if (minutes > 0) { ActivationTimeoutMinutes.Text = minutes.ToString(); } DigitalGood.ParseTimeout(_DigitalGood.DownloadTimeout, out days, out hours, out minutes); if (days > 0) { DownloadTimeoutDays.Text = days.ToString(); } if (hours > 0) { DownloadTimeoutHours.Text = hours.ToString(); } if (minutes > 0) { DownloadTimeoutMinutes.Text = minutes.ToString(); } //bind license agreements LicenseAgreement.DataSource = LicenseAgreementDataSource.LoadAll(); LicenseAgreement.DataBind(); item = LicenseAgreement.Items.FindByValue(_DigitalGood.LicenseAgreementId.ToString()); if (item != null) { LicenseAgreement.SelectedIndex = LicenseAgreement.Items.IndexOf(item); } item = LicenseAgreementMode.Items.FindByValue(_DigitalGood.LicenseAgreementModeId.ToString()); if (item != null) { LicenseAgreementMode.SelectedIndex = LicenseAgreementMode.Items.IndexOf(item); } // BIND GROUPs Groups.DataBind(); Groups.ClearSelection(); foreach (DigitalGoodGroup dgg in _DigitalGood.DigitalGoodGroups) { item = Groups.Items.FindByValue(dgg.Group.Id.ToString()); if (item != null) { item.Selected = true; } } //bind readmes Readme.DataSource = ReadmeDataSource.LoadAll(); Readme.DataBind(); item = Readme.Items.FindByValue(_DigitalGood.ReadmeId.ToString()); if (item != null) { Readme.SelectedIndex = Readme.Items.IndexOf(item); } EnableSerialKeys.Checked = _DigitalGood.EnableSerialKeys; // INITIALIZE SERIAL KEY PROVIDERS KeySource.Items.Clear(); KeySource.Items.Add(new ListItem("Manual Entry", "0")); // ADD PROVIDERS IList <ISerialKeyProvider> providers = SerialKeyProviderDataSource.GetSerialKeyProviders(); foreach (ISerialKeyProvider provider in providers) { string classId = Misc.GetClassId(provider.GetType()); ListItem providerItem; // (BUG # 8347) ABLECOMMERCE DEFAULT KEY PROVIDER SHOULD BE NAMED AS "Managed List of Keys" if (provider.GetType() == typeof(DefaultSerialKeyProvider)) { providerItem = new ListItem("Managed List of Keys", classId); } else { providerItem = new ListItem(provider.Name, classId); } KeySource.Items.Add(providerItem); } //SELECT CORRECT PROVIDER if (_DigitalGood.SerialKeyProviderId != null) { ListItem providerItem = KeySource.Items.FindByValue(_DigitalGood.SerialKeyProviderId); if (providerItem != null) { KeySource.SelectedIndex = KeySource.Items.IndexOf(providerItem); } } IList <EmailTemplate> templates = EmailTemplateDataSource.LoadAll(); foreach (EmailTemplate template in templates) { ListItem activationItem = new ListItem(template.Name, template.Id.ToString()); ListItem fulfillItem = new ListItem(template.Name, template.Id.ToString()); if (_DigitalGood.ActivationEmailId == template.Id) { activationItem.Selected = true; } if (_DigitalGood.FulfillmentEmailId == template.Id) { fulfillItem.Selected = true; } ActivationEmailTemplateList.Items.Add(activationItem); FulfillmentEmailTemplateList.Items.Add(fulfillItem); } if (_DigitalGood.FulfillmentMode == CommerceBuilder.DigitalDelivery.FulfillmentMode.Manual) { FulfillmentMode.SelectedIndex = 0; } else if (_DigitalGood.FulfillmentMode == CommerceBuilder.DigitalDelivery.FulfillmentMode.OnOrder) { FulfillmentMode.SelectedIndex = 1; } else { FulfillmentMode.SelectedIndex = 2; } ToggleConfigureProvider(); } }