Example #1
0
    public void toggleFavorite(object sender, CommandEventArgs e)
    {
        DataAbstract DA        = new DataAbstract();
        DataRow      DR        = DA.returnOneBudget(Convert.ToInt32(e.CommandArgument)).Tables[0].Rows[0];
        bool         pastFavor = Convert.ToBoolean(DR.Field <object>("Favorite"));

        DA.updateBudgetFavorite(Convert.ToInt32(e.CommandArgument), !pastFavor);
    }
Example #2
0
    public void imageChoose(object sender, EventArgs e)
    {
        Image        x   = (Image)sender;
        int          id  = Convert.ToInt32(x.Attributes["Text"]);
        DataAbstract DA  = new DataAbstract();
        DataRow      DR  = DA.returnOneBudget(id).Tables[0].Rows[0];
        bool         fav = Convert.ToBoolean(DR.Field <object>("favorite"));

        if (fav)
        {
            x.Attributes["src"] = "images/faveTrue.png";
        }
        else
        {
            x.Attributes["src"] = "images/faveFalse.png";
        }
        sender = x;
    }