示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (String.IsNullOrEmpty(Request.QueryString.Get("SpeciesID")))
        {
            Response.Redirect("Default.aspx");
        } // if (!String.IsNullOrEmpty(Request.QueryString.Get("RecipeID")))

        int itemID = Convert.ToInt32(Request.QueryString.Get("SpeciesID"));
        CurrentSpecies = SpeciesGateway.SpeciesInfoGetBySpeciesID(itemID);
        if (CurrentSpecies == null || CurrentSpecies.Name.Equals("n/a")) { Response.Redirect("Default.aspx"); }
        Title = CurrentSpecies.Name;

    } // method Page_Load
示例#2
0
    } // method GetAllBlueprintsCreatedByTradeskillID

    public static ItemGroupEnum DetermineItemGroupByItemID(long objectID)
    {
        string cacheKey = "ItemGroupByItemID_" + objectID;
        ItemGroupEnum returnObject;
        if (HttpContext.Current.Cache[cacheKey] == null)
        {
            returnObject = ItemGroupEnum.Unknown;
        }
        else
        {
            returnObject = (ItemGroupEnum)HttpContext.Current.Cache[cacheKey];
        }
        
        if (returnObject == ItemGroupEnum.Unknown)
            using (RepopdataEntities myEntities = new RepopdataEntities())
            {
                // There's no easy way to determine the item "group" (recipe book, crafting component, etc.)
                // This method definitely needs refactoring
               
                var recipeResult = RecipeGateway.RecipesGrantedByRecipeBookID(objectID);
                if (recipeResult.Count > 0)
                {
                    returnObject = ItemGroupEnum.RecipeBook;
                    AppCaching.AddToCache(cacheKey, returnObject);
                    return returnObject;
                }
                var rawMatResult = SpeciesGateway.AllSpeciesInfoForItem(objectID);
                if (rawMatResult.Count > 0)
                {
                    returnObject = ItemGroupEnum.RawMaterial;
                    AppCaching.AddToCache(cacheKey, returnObject);
                    return returnObject;
                }
                var componentResult = ComponentGateway.ComponentsGetByItemID(objectID);
                if (componentResult.Count > 0)
                    {
                    returnObject = ItemGroupEnum.CraftingComponent;
                    AppCaching.AddToCache(cacheKey, returnObject);
                    return returnObject;
                }
            } // using
        return returnObject;
    } // DetermineItemGroupByItemID
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     grd_Species.DataSource = SpeciesGateway.GetAllSpecies();
     grd_Species.DataBind();
 } // method Page_Load