private void updateLugarHechos(Int32 LugarHechosId) { BPLugarHechos oBPLugarHechos = new BPLugarHechos(); ENTLugarHechos oENTLugarHechos = new ENTLugarHechos(); ENTResponse oENTResponse = new ENTResponse(); try { // Formulario oENTLugarHechos.LugarHechosId = LugarHechosId; oENTLugarHechos.Nombre = this.txtActionNombre.Text.Trim(); oENTLugarHechos.Descripcion = this.txtActionDescripcion.Text.Trim(); // Transacción oENTResponse = oBPLugarHechos.updateLugarHechos(oENTLugarHechos); // Validaciones if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); } if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); } // Transacción exitosa ClearActionPanel(); // Actualizar grid selectcatLugarHechos(); // 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 selectcatLugarHechos() { BPLugarHechos oBPLugarHechos = new BPLugarHechos(); ENTLugarHechos oENTLugarHechos = new ENTLugarHechos(); ENTResponse oENTResponse = new ENTResponse(); String sMessage = ""; try { // Formulario oENTLugarHechos.Nombre = this.txtNombre.Text.Trim(); // Transacción oENTResponse = oBPLugarHechos.SelectcatLugarHechos(oENTLugarHechos); // Validaciones if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); } if (oENTResponse.sMessage != "") { sMessage = "alert('" + oENTResponse.sMessage + "');"; } // Llenado de controles this.gvLugarHechos.DataSource = oENTResponse.dsResponse.Tables[1]; this.gvLugarHechos.DataBind(); // Mensaje al usuario ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), sMessage, true); } catch (Exception ex) { throw (ex); } }
private void selectcatLugarHechos_ForEdit(Int32 LugarHechosId) { BPLugarHechos oBPLugarHechos = new BPLugarHechos(); ENTLugarHechos oENTLugarHechos = new ENTLugarHechos(); ENTResponse oENTResponse = new ENTResponse(); try { // Formulario oENTLugarHechos.LugarHechosId = LugarHechosId; oENTLugarHechos.Nombre = this.txtActionNombre.Text.Trim(); // Transacción oENTResponse = oBPLugarHechos.SelectcatLugarHechos(oENTLugarHechos); // 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); } }
void SelectLugarHechos() { BPLugarHechos oBPLugarHechos = new BPLugarHechos(); try { // Transacción oBPLugarHechos.SelectLugarHechos(); // Validación if (oBPLugarHechos.ErrorId != 0) { throw(new Exception(oBPLugarHechos.ErrorDescription)); } // Llenado de combo ddlLugarHechos.DataValueField = "LugarHechosId"; ddlLugarHechos.DataTextField = "Nombre"; ddlLugarHechos.DataSource = oBPLugarHechos.LugarEntity.ResultData.Tables[0]; ddlLugarHechos.DataBind(); // Opción seleccione ddlLugarHechos.Items.Insert(0, new ListItem("[Seleccione]", "0")); }catch (Exception ex){ throw (ex); } }