Inheritance: BPBase
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); }
        }
Example #2
0
        private void updatePais_Estatus(PaisActionTypes PaisActionTypes, Int32 PaisId)
        {
            BPPais oBPPais = new BPPais();
            ENTPais oENTPais = new ENTPais();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTPais.PaisId = PaisId;

                switch (PaisActionTypes)
                {
                    case PaisActionTypes.DeletePais:
                        oENTPais.Activo = 0;
                        break;
                    case PaisActionTypes.ReactivatePais:
                        oENTPais.Activo = 1;
                        break;

                }

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

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

                // Mensaje Base de Datos
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }

                // Actualizar datos
                selectPais();

            }
            catch (Exception ex) { throw (ex); }
        }
Example #3
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 #4
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); }
        }
Example #5
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 #6
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);
            }
        }
        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);
            }
        }