Ejemplo n.º 1
0
    public CraftingRecipeResult(Recipe_Results recipeResult)
    {
        ParentRecipe = new CraftingRecipe(recipeResult.recipeID);
        Count = recipeResult.count;
        Type = (ItemTypeEnum)recipeResult.type;
        MinimumGrade = (GradeEnum)recipeResult.grade;
        Group = recipeResult.groupID;
        Difficulty = (DifficultyEnum)recipeResult.level;

        switch (Type)
        {
            case ItemTypeEnum.Item:
                Result = new ItemBase(recipeResult.resultID);
                break;
            case ItemTypeEnum.Fitting:
                Result = new FittingBase(recipeResult.resultID);
                break;
            case ItemTypeEnum.Blueprint:
                Result = new BlueprintBase(recipeResult.resultID);
                break;
        } // switch (Type)

        Filters = new List<CraftingRecipeFilter>();
        Filters.Add(new CraftingRecipeFilter(ParentRecipe.ID, recipeResult.filter1ID, recipeResult.ingCount1, 1));
        Filters.Add(new CraftingRecipeFilter(ParentRecipe.ID, recipeResult.filter2ID, recipeResult.ingCount2, 2));
        Filters.Add(new CraftingRecipeFilter(ParentRecipe.ID, recipeResult.filter3ID, recipeResult.ingCount3, 3));
        Filters.Add(new CraftingRecipeFilter(ParentRecipe.ID, recipeResult.filter4ID, recipeResult.ingCount4, 4));
    } // constructor
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (String.IsNullOrEmpty(Request.QueryString.Get("FittingID")))
        {
            Response.Redirect("~/Fittings/Default.aspx");
        } // if (!String.IsNullOrEmpty(Request.QueryString.Get("ComponentID")))

        int currentID = Convert.ToInt32(Request.QueryString.Get("FittingID"));
        CurrentFitting = new FittingBase(currentID) ;
        if (CurrentFitting == null || CurrentFitting.Name.Equals("n/a")) { Response.Redirect("~/Fittings/Default.aspx"); }
        Title = CurrentFitting.Name;

    } // method Page_Load
Ejemplo n.º 3
0
    } // method rpt_Items_ItemDataBound

    protected void rpt_Fittings_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        switch (e.Item.ItemType)
        {
            case ListItemType.Item:
            case ListItemType.AlternatingItem:
                {
                    HyperLink recipeLink = (HyperLink)e.Item.FindControl("lnk_RecipeLink");
                    FittingBase currentItem = (FittingBase)e.Item.DataItem;
                    var singleRecipe = (from item in currentItem.Recipes
                                        where item.ParentSkill.ID == CurrentSkill.ID
                                        select item).FirstOrDefault();
                    recipeLink.Text = singleRecipe.Name;
                    recipeLink.NavigateUrl = singleRecipe.URL;
                    break;
                }
        } // switch
    } // method rpt_Fittings_ItemDataBound