Ejemplo n.º 1
0
    protected void gridRecipesList_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            SRL_Recipe receipe = (SRL_Recipe)e.Row.DataItem;

            //Label lnkReceipe = (Label)e.Row.FindControl("lnkReceipe");
            //lnkReceipe.Text = receipe.RecipeName;

            e.Row.Attributes["onmouseover"] = "this.style.backgroundColor='#dddddd'";
            e.Row.Attributes["onmouseout"]  = "this.style.backgroundColor='Transparent'";

            //string script = Page.ClientScript.GetPostBackEventReference(this, receipe.RecipeId.ToString(), false);
            //lnkReceipe.Attributes["onclick"] = script;
            //lnkReceipe.Style.Add("cursor", "pointer");

            Label lbl = (Label)e.Row.FindControl("lblUser");
            //lbl.Text = @"נוסף על ידי " + (BusinessFacade.Instance.GetRecipe(receipe.RecipeId)).User.DisplayName;
            //Recipe recipe = BusinessFacade.Instance.GetRecipe(((SRL_Recipe)e.Row.DataItem).RecipeId);
            //string name = string.Empty;

            //if (!string.IsNullOrEmpty(recipe.User.DisplayName))
            //{
            //    name = recipe.User.DisplayName;
            //}
            //else
            //{
            //    name = recipe.User.Name;
            //}
            lbl.Text = @"נוסף על ידי " + ((SRL_Recipe)e.Row.DataItem).Name;
        }
    }
Ejemplo n.º 2
0
    protected void gridRecipesList_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            SRL_Recipe recipe = (SRL_Recipe)e.Row.DataItem;

            HyperLink hl = (HyperLink)e.Row.FindControl("btnViewRecipe");
            hl.NavigateUrl = string.Format("~/RecipeDetails.aspx?recipeId={0}&view={1}", recipe.RecipeId,
                                           (this.viewOption == 1 ? (int)PersonalAreaViewEnum.MyRecipesSearch : (int)PersonalAreaViewEnum.MyFavoritesRecipesSearch));

            Label lbl = (Label)e.Row.FindControl("lblUser");
            lbl.Text = @"נוסף על ידי " + ((SRL_Recipe)e.Row.DataItem).Name;
        }
    }