Ejemplo n.º 1
0
        protected void btnEliminar_Click(object sender, ImageClickEventArgs e)
        {
            string strId = ((ImageButton)sender).CommandArgument;

            ALCSA.Negocio.Juicios.Riesgo objRiesgo = new ALCSA.Negocio.Juicios.Riesgo();
            objRiesgo.ID = Convert.ToInt32(strId);
            objRiesgo.Eliminar();
            CargarGrilla(gvRiesgos.PageIndex);
            lblMensaje.Text = "Riesgo Eliminado correctamente.";
        }
Ejemplo n.º 2
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtNombreRiesgo.Text))
            {
                lblMensaje.Text = "Ingrese el nombre del riesgo.";
                return;
            }

            ALCSA.Negocio.Juicios.Riesgo objRiesgo = new ALCSA.Negocio.Juicios.Riesgo();
            objRiesgo.ID     = Convert.ToInt32(lblIdRiesgo.Text);
            objRiesgo.Nombre = txtNombreRiesgo.Text.Trim();
            objRiesgo.Guardar();
            Response.Redirect("Listar.aspx?mensaje=1", true);
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                return;
            }
            int intId = 0;

            if (int.TryParse(Request.QueryString["id"], out intId) && intId > 0)
            {
                ALCSA.Negocio.Juicios.Riesgo objRiesgo = new ALCSA.Negocio.Juicios.Riesgo(intId);
                if (objRiesgo != null && objRiesgo.ID > 0)
                {
                    lblIdRiesgo.Text     = objRiesgo.ID.ToString();
                    txtNombreRiesgo.Text = objRiesgo.Nombre.Trim();
                }
            }
        }