SelectPais() public method

Consulta el catálogo de Paises
BPPais.SelectPais 17-Marzo-2014 Ruben.Cobos
public SelectPais ( ENTPais oENTPais ) : ENTResponse
oENTPais SIAQ.Entity.Object.ENTPais Entidad de Pais con los filtros necesarios para la consulta
return SIAQ.Entity.Object.ENTResponse
Example #1
0
        private void selectPais_ForEdit(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.Activo = Int16.Parse(this.ddlActionStatus.SelectedItem.Value);

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

                // Validaciones
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }

                // Mensaje de la BD
                this.lblActionMessage.Text = oENTResponse.sMessage;

                // Llenado de formulario
                this.txtActionNombre.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Nombre"].ToString();
                this.txtActionDescripcion.Text = oENTResponse.dsResponse.Tables[1].Rows[0]["Descripcion"].ToString();
                this.ddlActionStatus.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["tiActivo"].ToString();

            }
            catch (Exception ex) { throw (ex); }
        }
Example #2
0
        private void selectPais()
        {
            BPPais oBPPais = new BPPais();
            ENTPais oENTPais = new ENTPais();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTPais.Activo = 1;

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

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

                // Llenado de controles
                this.ddlActionPais.DataTextField = "Nombre";
                this.ddlActionPais.DataValueField = "PaisId";
                this.ddlActionPais.DataSource = oENTResponse.dsResponse.Tables[1];
                this.ddlActionPais.DataBind();

                // Item extra
                this.ddlActionPais.Items.Insert(0, new ListItem("[Seleccionar]","0"));

            }
            catch (Exception ex) { throw (ex); }
        }
Example #3
0
        private void selectPais()
        {
            BPPais oBPPais = new BPPais();
            ENTPais oENTPais = new ENTPais();
            ENTResponse oENTResponse = new ENTResponse();

            String sMessage = "";

            try
            {

                // Formulario
                oENTPais.Nombre = this.txtNombre.Text.Trim();
                oENTPais.Activo = Int16.Parse(this.ddlStatus.SelectedItem.Value);

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

                // Validaciones
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }

                // Mensaje de la BD
                if (oENTResponse.sMessage != "") { sMessage = "alert('" + oENTResponse.sMessage + "');"; }

                // Llenado de controles
                this.gvPais.DataSource = oENTResponse.dsResponse.Tables[1];
                this.gvPais.DataBind();

                // Mensaje al usuario
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), sMessage, true);

            }
            catch (Exception ex) { throw (ex); }
        }
        void SelectPais()
        {
            ENTPais oENTPais = new ENTPais();
            ENTResponse oENTResponse = new ENTResponse();

            BPPais oBPPais = new BPPais();

            try
            {

                // Formulario
                oENTPais.PaisId = 0;
                oENTPais.Nombre = "";
                oENTPais.Activo = 1;

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

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

                // Llenado de combo
                this.BuscadorListaPais.DataTextField = "Nombre";
                this.BuscadorListaPais.DataValueField = "PaisId";
                this.BuscadorListaPais.DataSource = oENTResponse.dsResponse.Tables[1];
                this.BuscadorListaPais.DataBind();

                BuscadorListaPais.Items.Insert(0, new ListItem("[Todos]", "0"));

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