public static Dictionary <int, HeroBonus> GetAllHeroBonuses() { Dictionary <int, HeroBonus> lclsHeroBonuss = new Dictionary <int, HeroBonus>(); DataTable dtHeroBonuss = MDatabaseUtilities.CreateDataTable("Select * from THeroBonuses", Hidden.ExternalConnection); foreach (DataRow drRow in dtHeroBonuss.Rows) { HeroBonus clsNewHeroBonus = new HeroBonus { intID = (int)drRow["intHeroBonusID"], strName = (string)drRow["strName"], strEffects = (string)drRow["strEffects"], strDescription = (string)drRow["strDescription"], strGameID = (string)drRow["strGameID"], strNotes = (string)drRow["strNotes"], strScreenshotLocation = (string)drRow["strScreenshotLocation"], intSubmitterID = (int)drRow["intSubmitterID"] }; lclsHeroBonuss.Add(clsNewHeroBonus.intID, clsNewHeroBonus); } return(lclsHeroBonuss); }
public static void Update() { try { if (IsDirty) { EffectTypes = EffectType.GetAllEffectTypes(); HeroBonuses = HeroBonus.GetAllHeroBonuses(); Traits = Trait.GetAllTraits(); TraitEffect.AddAllTraitEffectsToTraits(); AmmoTypes = AmmoType.GetAllAmmoTypes(); GunTypes = GunType.GetAllGunTypes(); Guns = Gun.GetAllGuns(); Items = Item.GetAllItems(); Maps = Map.GetAllMaps(); Sizes = Size.GetAllSizes(); Bases = Base.GetAllBases(); Facilities = Facility.GetAllFacilities(); MeleeTypes = MeleeType.GetAllMeleeTypes(); Melees = Melee.GetAllMelees(); PrebuiltFacilities = PrebuiltFacility.GetAllPrebuiltFacilities(); Mods = Mod.GetAllMods(); ModFiles = ModFile.GetAllModFiles(); AttachPrebuiltsToBases(); AttachFilesToMods(); IsDirty = false; } } catch (Exception ex) { NLog.LogManager.GetCurrentClassLogger().Error(ex, ex.Message + '\n' + ex.StackTrace); } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["ID"] != "-1") { clsHeroBonus = Classes.AllData.HeroBonuses[int.Parse(Request.QueryString["ID"])]; } else { clsHeroBonus = new Classes.HeroBonus(); btnFlag.Visible = false; } if (IsPostBack == false) { if (clsHeroBonus.strName != "") { Page.Title = clsHeroBonus.strName; } else { Page.Title = "New Hero Bonus"; } txtName.Text = clsHeroBonus.strName; txtDescription.Text = clsHeroBonus.strDescription; txtNotes.Text = clsHeroBonus.strNotes; txtEffects.Text = clsHeroBonus.strEffects; txtGameID.Text = clsHeroBonus.strGameID; hlScreenshot.NavigateUrl = clsHeroBonus.strScreenshotLocation; txtScreenshot.Text = clsHeroBonus.strScreenshotLocation; if (clsHeroBonus.strScreenshotLocation == "") { hlScreenshot.Visible = false; } else if (clsHeroBonus.strScreenshotLocation.ToLower().Contains(".jpg") || clsHeroBonus.strScreenshotLocation.ToLower().Contains(".png") || clsHeroBonus.strScreenshotLocation.ToLower().Contains(".gif") || clsHeroBonus.strScreenshotLocation.ToLower().Contains(".bmp")) { hlScreenshot.NavigateUrl = "ViewScreenshot.aspx?Page=ModifyHeroBonus&ID=" + clsHeroBonus.intID + "&Target=" + clsHeroBonus.strScreenshotLocation; } } if (Session["Submitter"] == null) { btnSave.Visible = false; btnFlag.Visible = false; } }