SelectEstado() публичный Метод

Consulta el catálogo de Estados
BPEstado.SelectEstado 17-Marzo-2014 Ruben.Cobos
public SelectEstado ( ENTEstado oENTEstado ) : ENTResponse
oENTEstado SIAQ.Entity.Object.ENTEstado Entidad de Estado con los filtros necesarios para la consulta
Результат SIAQ.Entity.Object.ENTResponse
Пример #1
0
        private void selectEstado_ForEdit(Int32 EstadoId)
        {
            BPEstado oBPEstado = new BPEstado();
            ENTEstado oENTEstado = new ENTEstado();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTEstado.EstadoId = EstadoId;
                oENTEstado.Nombre = this.txtActionNombre.Text.Trim();
                oENTEstado.Activo = Int16.Parse(this.ddlStatus.SelectedItem.Value);

                // Transacción
                oENTResponse = oBPEstado.SelectEstado(oENTEstado);

                // Validaciones
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                this.lblActionMessage.Text = oENTResponse.sMessage;

                // Llenado de controles
                this.ddlActionPais.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["PaisId"].ToString();
                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]["Activo"].ToString();

            }
            catch (Exception ex) { throw (ex); }
        }
Пример #2
0
        void SelectEstado()
        {
            ENTEstado oENTEstado = new ENTEstado();
            ENTResponse oENTResponse = new ENTResponse();

            BPEstado oBPEstado = new BPEstado();

            Int32 PaisId;

            try
            {

                // Pais seleccionado
                PaisId = Int32.Parse(this.BuscadorListaPais.SelectedValue);

                // Formulario
                oENTEstado.EstadoId = 0;
                oENTEstado.PaisId = (PaisId == 0 ? -1 : PaisId);
                oENTEstado.Nombre = "";
                oENTEstado.Activo = 1;

                // Transacción
                oENTResponse = oBPEstado.SelectEstado(oENTEstado);

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

                // Llenado de combo
                this.BuscadorListaEstado.DataTextField = "Nombre";
                this.BuscadorListaEstado.DataValueField = "EstadoId";
                this.BuscadorListaEstado.DataSource = oENTResponse.dsResponse.Tables[1];
                this.BuscadorListaEstado.DataBind();
                BuscadorListaEstado.Items.Insert(0, new ListItem("[Todos]", "0"));

            }catch (Exception ex){
                throw (ex);
            }
        }
Пример #3
0
        private void selectEstado()
        {
            BPEstado oBPEstado = new BPEstado();
            ENTEstado oENTEstado = new ENTEstado();
            ENTResponse oENTResponse = new ENTResponse();

            String sMessage = "";

            try {

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

                // Transacción
                oENTResponse = oBPEstado.SelectEstado(oENTEstado);

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

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

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

            }
            catch (Exception ex) { throw (ex); }
        }
Пример #4
0
        private void selectEstado()
        {
            BPEstado oBPEstado = new BPEstado();
            ENTEstado oENTEstado = new ENTEstado();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTEstado.Activo = 1;

                // Transacción
                oENTResponse = oBPEstado.SelectEstado(oENTEstado);

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

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

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

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