cdiego

WebForm3.aspx.cs

Jul 13th, 2013
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.97 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using DAO;
  8. using ENTIDADES;
  9.  
  10. namespace AppWeb
  11. {
  12.     public partial class WebForm3 : System.Web.UI.Page
  13.     {
  14.         protected void Page_Load(object sender, EventArgs e)
  15.         {
  16.            
  17.         }
  18.  
  19.         protected void Button1_Click(object sender, EventArgs e)
  20.         {
  21.             DAOProducto p = new DAOProducto();
  22.             eProducto epro = new eProducto();
  23.             epro.Nombre = TextBox3.Text;
  24.             epro.Precio = Convert.ToDecimal(TextBox4.Text);
  25.             epro.IdCategoria = Convert.ToInt32(DropDownList2.SelectedValue);
  26.             bool exito = p.Grabar(epro);
  27.             if (exito)
  28.             {
  29.                 GridView1.DataBind();
  30.                 TextBox3.Text = "";
  31.                 TextBox4.Text = "";
  32.             }
  33.             else
  34.             {
  35.             }
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment