コード例 #1
0
 public void Listar()
 {
     List<Area> ar = new AreaBL().List();
     if (ar.ToList().Count() > 0)
     {
         GridView1.DataSource = ar.ToList();
         GridView1.DataBind();
     }
     else
     {
         GridView1.DataSource = null;
         GridView1.DataBind();
     }
 }
コード例 #2
0
 public void ListarArea()
 {
     List<Area> ar = new AreaBL().List();
     if (ar.ToList().Count() > 0)
     {
         foreach (Area a in ar)
         {
             CboArea.Items.Add(a.Nom_area);
         }
     }
     else
     {
         CboArea.DataSource = null;
     }
 }
コード例 #3
0
 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     try
     {
         int i;
         AreaBL a = new AreaBL();
         int index = Convert.ToInt32(e.RowIndex);
         i = a.Eliminar(GridView1.Rows[index].Cells[2].Text.ToString());
         if (i > 0) {
             Listar();
         }
     }
     catch (Exception)
     {
     }
 }
コード例 #4
0
 protected void Registrar_Click(object sender, EventArgs e)
 {
     try
     {
         int i;
         AreaBL a = new AreaBL();
         i = a.Registrar(Txt_Area.Text.Trim(),Txt_Sigla.Text.Trim());
         if (i > 0) {
             LblResult.CssClass = "text-success";
             LblResult.Text = "La operación se realizó exitosamente.";
         }
         else {
             LblResult.CssClass = "text-error";
             LblResult.Text = "Ocurrio un error, Comuníquese con soporte tecnico.";
         }
     }
     catch(Exception) { }
 }