//protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        //{
        //    int codigo = 0;
        //    switch (e.CommandName)
        //    {
        //        case "Alterar":
        //            codigo = Convert.ToInt32(e.CommandArgument);
        //            Session["ID"] = codigo;
        //            Response.Redirect("AlterarPedido.aspx");
        //            break;
        //        case "Excluir":
        //            codigo = Convert.ToInt32(e.CommandArgument);
        //            PedidoBD bd = new PedidoBD();
        //            bd.Delete(codigo);
        //            Carregar();
        //            break;
        //        default:
        //            break;
        //    }
        //}

        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int codigo = 0;

            switch (e.CommandName)
            {
            case "alterar":
                codigo        = Convert.ToInt32(e.CommandArgument);
                Session["ID"] = codigo;
                Response.Redirect("AlterarPedido.aspx");
                break;

            case "excluir":
                codigo = Convert.ToInt32(e.CommandArgument);
                PedidoBD bd = new PedidoBD();
                bd.Delete(codigo);
                Carregar();
                break;

            default:
                break;
            }
            //if (e.CommandName == "alterar")
            //{
            //    int codigo = 0;
            //    codigo = Convert.ToInt32(e.CommandArgument);
            //    Session["ID"] = codigo;
            //    Response.Redirect("AlterarPedido.aspx");
            //}
            //else if(e.CommandName == "excluir")
        }