protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == false) { if (Request.QueryString["ID"] != "-1") { clsTrait = Classes.AllData.Traits[int.Parse(Request.QueryString["ID"])]; } else { clsTrait = new Classes.Trait(); btnFlag.Visible = false; btnDelete.Visible = false; } if (clsTrait.strName != "") { Page.Title = clsTrait.strName; } else { Page.Title = "New Trait"; } lblMainHeader.InnerText = clsTrait.strName; txtName.Text = clsTrait.strName; txtDescription.Text = clsTrait.strDescription; txtNotes.Text = clsTrait.strNotes; rptEffects.DataSource = clsTrait.Effects.Values; rptEffects.DataBind(); hlScreenshot.NavigateUrl = clsTrait.strScreenshotLocation; txtScreenshot.Text = clsTrait.strScreenshotLocation; cmbLinkedHeroBonus.DataSource = Classes.AllData.HeroBonuses; cmbLinkedHeroBonus.DataValueField = "Key"; cmbLinkedHeroBonus.DataTextField = "Value"; cmbLinkedHeroBonus.DataBind(); if (clsTrait.clsHeroBonus != null) { cmbLinkedHeroBonus.SelectedValue = clsTrait.clsHeroBonus.intID.ToString(); } if (clsTrait.strScreenshotLocation == "") { hlScreenshot.Visible = false; } else if (clsTrait.strScreenshotLocation.ToLower().Contains(".jpg") || clsTrait.strScreenshotLocation.ToLower().Contains(".png") || clsTrait.strScreenshotLocation.ToLower().Contains(".gif") || clsTrait.strScreenshotLocation.ToLower().Contains(".bmp")) { hlScreenshot.NavigateUrl = "ViewScreenshot.aspx?Page=ModifyTraits&ID=" + clsTrait.intID + "&Target=" + clsTrait.strScreenshotLocation; } } if (Session["Submitter"] == null) { btnSave.Visible = false; btnFlag.Visible = false; btnDelete.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == false) { clsTrait = Classes.AllData.Traits[int.Parse(Request.QueryString["TID"])]; if (Request.QueryString["EID"] != "-1") { clsTraitEffect = clsTrait.Effects[int.Parse(Request.QueryString["EID"])]; } else { clsTraitEffect = new Classes.TraitEffect(); btnFlag.Visible = false; }; cmbEffectType.DataSource = Classes.AllData.EffectTypes; cmbEffectType.DataValueField = "Key"; cmbEffectType.DataTextField = "Value"; cmbEffectType.DataBind(); if (clsTraitEffect.clsType != null) { cmbEffectType.SelectedValue = clsTraitEffect.clsType.intID.ToString(); } txtValue.Text = clsTraitEffect.strValue; chkIsGlobal.Checked = clsTraitEffect.blnIsGlobal; } if (Session["Submitter"] == null) { btnSave.Visible = false; btnFlag.Visible = false; btnDelete.Visible = false; } }