insertcatPais() public method

Metodo para insertar catPais del sistema
BPcatPaisinsertcatPais 27/ene/2014 Generador
public insertcatPais ( ENTPais entPais ) : ENTResponse
entPais SIAQ.Entity.Object.ENTPais
return SIAQ.Entity.Object.ENTResponse
Example #1
0
        private void InsertPais()
        {
            BPPais oBPPais = new BPPais();
            ENTPais oENTPais = new ENTPais();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTPais.Nombre = this.txtActionNombre.Text.Trim();
                oENTPais.Descripcion = this.txtActionDescripcion.Text.Trim();
                oENTPais.Activo = Int16.Parse(this.ddlActionStatus.SelectedItem.Value);

                // Transacción
                oENTResponse = oBPPais.insertcatPais(oENTPais);

                // Validaciones
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }

                // Transacción exitosa
                ClearActionPanel();

                // Actualizar grid
                selectPais();

                // Mensaje de usuario
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('País creado con éxito!'); focusControl('" + this.txtNombre.ClientID + "');", true);

            }
            catch (Exception ex) { throw (ex); }
        }