void SelectMotivo() { BPMotivo BPMotivo = new BPMotivo(); ddlMotivo.DataValueField = "MotivoId"; ddlMotivo.DataTextField = "Nombre"; ddlMotivo.DataSource = BPMotivo.SelectMotivo().Tables[1]; ddlMotivo.DataBind(); ddlMotivo.Items.Insert(0, new ListItem("[Seleccione]", "0")); }
private void selectMotivo_ForEdit(Int32 MotivoId) { BPMotivo oBPMotivo = new BPMotivo(); ENTMotivo oENTMotivo = new ENTMotivo(); ENTResponse oENTResponse = new ENTResponse(); try { // Formulario oENTMotivo.MotivoId = MotivoId; oENTMotivo.Nombre = this.txtActionNombre.Text.Trim(); // Transacción oENTResponse = oBPMotivo.searchcatMotivo(oENTMotivo); // 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); } }
private void updateMotivo(Int32 MotivoId) { BPMotivo oBPMotivo = new BPMotivo(); ENTMotivo oENTMotivo = new ENTMotivo(); ENTResponse oENTResponse = new ENTResponse(); try { // Formulario oENTMotivo.MotivoId = MotivoId; oENTMotivo.Nombre = this.txtActionNombre.Text.Trim(); oENTMotivo.Descripcion = this.txtActionDescripcion.Text.Trim(); // Transacción oENTResponse = oBPMotivo.updateMotivo(oENTMotivo); // Validaciones if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); } if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); } // Transacción exitosa ClearActionPanel(); // Actualizar grid selectMotivo(); // 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); } }
private void selectMotivo() { BPMotivo oBPMotivo = new BPMotivo(); ENTMotivo oENTMotivo = new ENTMotivo(); ENTResponse oENTResponse = new ENTResponse(); String sMessage = ""; try { // Formulario oENTMotivo.Nombre = this.txtNombre.Text.Trim(); // Transacción oENTResponse = oBPMotivo.searchcatMotivo(oENTMotivo); // Validaciones if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); } if (oENTResponse.sMessage != "") { sMessage = "alert('" + oENTResponse.sMessage + "');"; } // Llenado de controles this.gvMotivo.DataSource = oENTResponse.dsResponse.Tables[1]; this.gvMotivo.DataBind(); // Mensaje al usuario ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), sMessage, true); } catch (Exception ex) { throw (ex); } }