SIAQ.BusinessProcess.Object.BPPais.updatecatPais C# (CSharp) Method

updatecatPais() public method

Metodo que actualiza catPais del sistema
BPcatPaisupdatecatPais 27/ene/2014 Generador
public updatecatPais ( ENTPais entPais ) : ENTResponse
entPais SIAQ.Entity.Object.ENTPais
return SIAQ.Entity.Object.ENTResponse
        public ENTResponse updatecatPais(ENTPais entPais)
        {
            ENTResponse oENTResponse = new ENTResponse();
            try
            {
                // Consulta a base de datos
                DAPais datacatPais = new DAPais();
                oENTResponse = datacatPais.updatecatPais(entPais);
                // Validación de error en consulta
                if (oENTResponse.GeneratesException) { return oENTResponse; }
                // Validación de mensajes de la BD
                oENTResponse.sMessage = oENTResponse.dsResponse.Tables[0].Rows[0]["sResponse"].ToString();
                if (oENTResponse.sMessage != "") { return oENTResponse; }
            }
            catch (Exception ex)
            {
                oENTResponse.ExceptionRaised(ex.Message);
            }
            // Resultado
            return oENTResponse;
        }

Usage Example

Example #1
0
        private void UpdatePais(Int32 PaisId)
        {
            BPPais oBPPais = new BPPais();
            ENTPais oENTPais = new ENTPais();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

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

                // Transacción
                oENTResponse = oBPPais.updatecatPais(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('Información actualizada con éxito!'); focusControl('" + this.txtNombre.ClientID + "');", true);

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