Example #1
0
        protected void ExcluirE(object sender, EventArgs e)
        {
            Button button = sender as Button;

            if (button.ID == "Button7")
            {
                DAL.DALEndereco aDALEndereco = new DAL.DALEndereco();
                Modelo.Endereco aE           = new Modelo.Endereco(Convert.ToInt32(Session["EditE"]), "", "", "", "", "", "", 0);
                aDALEndereco.Delete(aE);
                Response.Redirect(Request.Url.ToString());
            }
            else
            {
                if (button.ID == "Button8")
                {
                    Response.Redirect(Request.Url.ToString());
                }
                else
                {
                    int id = Convert.ToInt32(button.ID);
                    Label8.Text      = "Você tem certeza em excluir esse Endereço?";
                    Session["EditE"] = id;
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "myFunction1()", true);
                }
            }
        }