Beispiel #1
0
        protected void btnregistrar_Click(object sender, EventArgs e)
        {
            TheGym k = new TheGym
            {
                NombreProducto      = tbnombre.Text,
                FKproveedor         = ddlproveedor.SelectedValue,
                DescripcionProducto = tbdescripcion.Text,
                PrecioCompra        = tbprecio.Text,
                PrecioVenta         = tbprecio0.Text
            };

            try
            {
                k.AddProducto();
                Label1.Text    = "Producto Registrado";
                Label1.Visible = true;
                tbnombre.Text  = String.Empty;
                ddlproveedor.ClearSelection();
                tbdescripcion.Text = string.Empty;
                tbprecio.Text      = string.Empty;
                tbprecio0.Text     = string.Empty;
            }
            catch (Exception ex)
            {
                Label1.Text    = ex.Message.ToString();
                Label1.Visible = true;
            }
        }