예제 #1
0
    protected void btnEliminar_Click(object sender, EventArgs e)
    {
        LinkButton btnEliminarDepar = (LinkButton)sender;
        int        ID_SUCURSAL      = Convert.ToInt32(btnEliminarDepar.CommandArgument);

        SUCURSAL_BLL.Borrar(ID_SUCURSAL);
        GridView1.DataBind();
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        int    idSucursal    = Convert.ToInt32(txtCodSucursal.Text);
        string nombrSucursal = txtNomSucursal.Text;
        int    idCiudad      = int.Parse(DropDownList1.SelectedItem.Value);

        try
        {
            SUCURSAL_BLL.Actualizar(idSucursal, nombrSucursal, idCiudad);
            Response.Redirect("~/webformsADM/UBICACION/IndexSucursal.aspx");
        }
        catch (Exception ex) { }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string idPprod = Request.QueryString["ID_SUCURSAL"];

        if (!IsPostBack)
        {
            if (idPprod != null)
            {
                SUCURSAL_DTO objPermisos = SUCURSAL_BLL.MostrarID(Convert.ToInt32(idPprod));
                if (objPermisos != null)
                {
                    txtCodSucursal.Text = "" + objPermisos.ID_SUCURSAL;
                    txtNomSucursal.Text = "" + objPermisos.NOMBRE_SUCURSAL;
                    DropDownList1.Text  = "" + objPermisos.ID_CIUDAD;
                }
            }
        }
    }