Example #1
0
        private void selectLugarDiligencia_ForEdit(Int32 LugarDiligenciaId)
        {
            BPLugarDiligencia oBPLugarDiligencia = new BPLugarDiligencia();
            ENTLugarDiligencia oENTLugarDiligencia = new ENTLugarDiligencia();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTLugarDiligencia.LugarDiligenciaId = LugarDiligenciaId;
                oENTLugarDiligencia.Nombre = this.txtActionNombre.Text.Trim();

                // Transacción
                oENTResponse = oBPLugarDiligencia.SelectLugarDiligencia(oENTLugarDiligencia);

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

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

            }
            catch (Exception ex) { throw (ex); }
        }
Example #2
0
        private void updateLugarDiligencia(Int32 LugarDiligenciaId)
        {
            BPLugarDiligencia oBPLugarDiligencia = new BPLugarDiligencia();
            ENTLugarDiligencia oENTLugarDiligencia = new ENTLugarDiligencia();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTLugarDiligencia.LugarDiligenciaId = LugarDiligenciaId;
                oENTLugarDiligencia.Nombre = this.txtActionNombre.Text.Trim();
                oENTLugarDiligencia.Descripcion = this.txtActionDescripcion.Text.Trim();

                // Transacción
                oENTResponse = oBPLugarDiligencia.updateLugarDiligencia(oENTLugarDiligencia);

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

                // Transacción exitosa
                ClearActionPanel();

                // Actualizar grid
                selectLugarDiligencia();

                // 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 #3
0
        private void selectLugarDiligencia()
        {
            BPLugarDiligencia oBPLugarDiligencia = new BPLugarDiligencia();
            ENTLugarDiligencia oENTLugarDiligencia = new ENTLugarDiligencia();
            ENTResponse oENTResponse = new ENTResponse();

            String sMessage = "";

            try
            {

                // Formulario
                oENTLugarDiligencia.Nombre = this.txtNombre.Text.Trim();

                // Transacción
                oENTResponse = oBPLugarDiligencia.SelectLugarDiligencia(oENTLugarDiligencia);

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

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

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

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