//Metodo registrar Material public int mtdRegistrarMaterial(clMaterialE objDatos) { clMaterial objMaterialD = new clMaterial(); int regi = objMaterialD.mtdRegistrarMaterial(objDatos); return(regi); }
protected void btnGuardar_Click(object sender, EventArgs e) { clMaterialE objMaterialE = new clMaterialE(); objMaterialE.Codigo = txtCodigo.Text; objMaterialE.Nombre = txtNombre.Text; objMaterialE.Descripcion = txtDescripcion.Text; objMaterialE.Unidad = txtUnidadM.Text; clMaterial objMaterial = new clMaterial(); int resultsql = objMaterial.mtdRegistrarMaterial(objMaterialE); if (resultsql > 0) { //enviar mensaje Response.Write("<script>alert('Se registro un nuevo Material correctamente!');window.location.href='Material.aspx'</script>"); //Limpiar Campos de texto txtCodigo.Text = ""; txtNombre.Text = ""; txtDescripcion.Text = ""; txtUnidadM.Text = ""; } }