예제 #1
0
    public void ListViewUpdate(object sender, ListViewUpdateEventArgs e)
    {
        ListViewItem item       = ((ListView)sender).Items[Convert.ToInt32(e.ItemIndex)];
        DropDownList Accounts   = (DropDownList)item.FindControl("EditAccountList");
        DropDownList Categories = (DropDownList)item.FindControl("EditCategorySelect");

        DataAbstract DA = new DataAbstract();

        int      id         = Convert.ToInt32(e.Keys["BudgetID"]);
        int      catID      = Convert.ToInt32(Categories.SelectedValue);
        long     account    = Convert.ToInt64(Accounts.SelectedValue);
        double   max        = Convert.ToDouble(e.NewValues["MaxAmt"]);
        string   dateString = Convert.ToString(e.NewValues["EndDate"]);
        DateTime endDate    = Convert.ToDateTime(dateString);


        DA.updateBudget(id, Convert.ToInt64(Session["Account"]), catID, endDate, max);
        Response.Redirect("~/Budget.aspx");
    }