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

InsertPais_FastCatalog() public method

Crea un nuevo Pais desde el wucFastCatalog
BPEstado.InsertPais_FastCatalog 17-Julio-2014 Ruben.Cobos
public InsertPais_FastCatalog ( ENTPais oENTPais ) : ENTResponse
oENTPais SIAQ.Entity.Object.ENTPais Entidad de Pais con los parámetros necesarios para crear el registro
return SIAQ.Entity.Object.ENTResponse
        public ENTResponse InsertPais_FastCatalog(ENTPais oENTPais)
        {
            DAPais oDAPais = new DAPais();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Transacción en base de datos
                oENTResponse = oDAPais.InsertPais_FastCatalog(oENTPais, this.sConnectionApplication, 0);

                // 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 InsertPais()
        {
            BPPais oBPPais = new BPPais();
            ENTPais oENTPais = new ENTPais();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTPais.Nombre = this.txtNombre.Text.Trim();
                oENTPais.Descripcion = this.txtNombre.Text.Trim();
                oENTPais.Activo = 1;

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

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

                // Id Generado
                this.hddItemCreatedID.Value = oENTResponse.dsResponse.Tables[1].Rows[0]["NewIdentity"].ToString();

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