예제 #1
0
    //handles the toggling of favorite goals
    //called when the favorite icon is clicked by the user
    public void toggleFavorite(object sender, CommandEventArgs e)
    {
        DataAbstract DA        = new DataAbstract();
        DataRow      DR        = DA.returnOneGoal(Convert.ToInt32(e.CommandArgument)).Tables[0].Rows[0];
        bool         pastFavor = Convert.ToBoolean(DR.Field <object>("Favorite"));

        DA.updateGoalFavorite(Convert.ToInt32(e.CommandArgument), !pastFavor);
    }