protected void cargarEps()
    {
        LEps lEps = new LEps();

        foreach (DataRow fila in lEps.obtenerEps().Rows)
        {
            ListItem listItem = new ListItem(fila["nombre"].ToString(), fila["id"].ToString());
            DDL_Eps.Items.Add(listItem);
        }
    }
Esempio n. 2
0
 protected void BTN_EliminarEps_Click(object sender, EventArgs e)
 {
     try
     {
         Button btn  = (Button)sender;
         int    id   = int.Parse(btn.CommandName);
         LEps   lEps = new LEps();
         lEps.eliminarEps(id);
         LB_MensajeEps.Text = "Elimino correctamente!";
         GV_Eps.DataBind();
     }
     catch (Exception ex)
     {
         LB_MensajeEps.Text = "Hay usuarios registrados con esa eps!";
     }
     T_Eps.Enabled = true;
 }
Esempio n. 3
0
 protected void BTN_AgregarEps_Click(object sender, EventArgs e)
 {
     try
     {
         String eps  = TB_AgregarEps.Text.Trim();
         LEps   lEps = new LEps();
         lEps.agregarEps(TB_AgregarEps.Text.Trim(), Session.SessionID);
         TB_AgregarEps.Text = "";
         GV_Eps.DataBind();
         LB_MensajeEps.Text = "Agrego correctamente!";
     }
     catch (Exception ex)
     {
         LB_MensajeEps.Text = "Esta vacio!";
     }
     T_Eps.Enabled = true;
 }
Esempio n. 4
0
 protected void BTN_ActualizarEps_Click(object sender, EventArgs e)
 {
     try
     {
         Button  btn    = (Button)sender;
         TextBox tb     = (TextBox)btn.Parent.FindControl("TB_Eps");
         String  nombre = tb.Text.Trim();
         LEps    lEps   = new LEps();
         lEps.actualizarEps(int.Parse(btn.CommandName), tb.Text, Session.SessionID);
         LB_MensajeEps.Text = "Actualizo correctamente!";
         GV_Eps.DataBind();
     }
     catch (Exception ex)
     {
         LB_MensajeEps.Text = "El nombre que va a actualizar esta vacio!";
     }
     T_Eps.Enabled = true;
 }