Agrega mantenimiento de programa
git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C495
This commit is contained in:
parent
d907501341
commit
b182d47b7c
3 changed files with 714 additions and 4 deletions
|
|
@ -46,10 +46,6 @@ namespace AyABL.ADM
|
|||
|
||||
cargarCondicionBusqueda(arlCondiciones, p_arlCondicionesBuscador);
|
||||
|
||||
if (objProgramaEL.Padre != 0)
|
||||
{
|
||||
arlCondiciones.Add(buscarPorPadre(objProgramaEL.Padre, Tablas.programa, operadorLogico.AND, operadorGeneral.EQUAL));
|
||||
}
|
||||
|
||||
if (objProgramaEL.PK != 0)
|
||||
{
|
||||
|
|
|
|||
116
AYA.FROPI/FOPI/webforms/ADM/wfrPrograma.aspx
Normal file
116
AYA.FROPI/FOPI/webforms/ADM/wfrPrograma.aspx
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeFile="wfrPrograma.aspx.cs" Inherits="webforms_ADM_wfrPrograma" %>
|
||||
|
||||
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<script src="../../Scripts/jquery-1.10.2.js"></script>
|
||||
<script src="../../Scripts/toastr.js" type="text/javascript"></script>
|
||||
<link href="../../Content/toastr.css" rel="stylesheet" />
|
||||
<script src="../../Scripts/bootstrap.js"></script>
|
||||
<link href="../../Content/bootstrap.css" rel="stylesheet" />
|
||||
|
||||
<asp:ScriptManager ID="ScripManager1" runat="server">
|
||||
</asp:ScriptManager>
|
||||
<asp:UpdatePanel ID="updPanel" runat="server">
|
||||
<ContentTemplate>
|
||||
<!-- SEPARADOR -->
|
||||
<div id="divSeparador1" class="Separador">
|
||||
</div>
|
||||
<%-- ************************************************************************** Buscador ************************************************************************************* --%>
|
||||
<div id="divDatosSuperiores" runat="server">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 jumbotron">
|
||||
<div class="form-group">
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
||||
<label for="ddlTipo" class="control-label">Tipo de Región</label>
|
||||
</div>
|
||||
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
|
||||
<asp:DropDownList ID="ddlTipoRegion" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlTipoRegion_SelectedIndexChanged" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- SEPARADOR -->
|
||||
<div id="divSeparador2" class="Separador">
|
||||
</div>
|
||||
<legend>Gestión de Regiones</legend>
|
||||
<%-- ********************************************************************** Grid ********************************************************************************* --%>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<asp:GridView ID="grvListaDatos" runat="server" CellPadding="2" GridLines="None" AutoGenerateColumns="false" AllowPaging="True" PageSize="10" OnRowCommand="grvListaDatos_RowCommand"
|
||||
OnPageIndexChanging="grvListaDatos_PageIndexChanging" class="gridView" >
|
||||
<RowStyle BackColor="#EFF3FB" VerticalAlign="Middle" />
|
||||
<AlternatingRowStyle BackColor="White" VerticalAlign="Middle" />
|
||||
<PagerStyle CssClass="pagination-sm" HorizontalAlign="Center" />
|
||||
<HeaderStyle Font-Bold="True" ForeColor="white" CssClass="gridViewHeader" />
|
||||
<PagerSettings PageButtonCount="25" />
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<input id="chkHeader" onclick="CheckAllGridViewItems(this);" type="checkbox" name="chkHeader" runat="server"/>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<input id="chkItem" type="checkbox" name="chkItem" runat="server"/>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:ButtonField ImageUrl="~/Images/MiniBotones/btnEditar.png" ButtonType="Image" CommandName="editar"/>
|
||||
</Columns>
|
||||
<EmptyDataTemplate>
|
||||
<div class="gridViewVacio">
|
||||
<div class="gridViewCheck">
|
||||
</div>
|
||||
<div class="gridFilaVacia">
|
||||
<div class="textoGrid">
|
||||
<asp:Label id="lblGridView" Text="No se obtuvieron resultados de su búsqueda" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</EmptyDataTemplate>
|
||||
</asp:GridView>
|
||||
<div class="detalleGridView">
|
||||
<div class="Izquierda">
|
||||
<asp:Label id="lblTotalDatos" runat="server" Text="Registros: " class="textoDetalleGridView" />
|
||||
</div>
|
||||
<div class="Derecha">
|
||||
<asp:ImageButton id="btnRefrescar" ImageUrl="~/Images/MiniBotones/btnRefrescar.png" CausesValidation="false" runat="server" OnClick="btnRefrescar_Click" Width="20px" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%--Botones Superiores--%>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="text-align:right">
|
||||
<asp:Button ID="btnNuevo" runat="server" Text="Nuevo" class="btn btn-primary btn-xs" OnClick="btnNuevo_Click" Visible="true" />
|
||||
<asp:Button ID="btnEliminar" runat="server" Text="Eliminar" class="btn btn-primary btn-xs" OnClick="btnEliminar_Click" Visible="true" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- ********************************************************************** Datos del Registro *********************************************************************************** --%>
|
||||
<div id="divDatosInferiores" runat="server">
|
||||
<div class="row">
|
||||
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
|
||||
</div>
|
||||
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
|
||||
<div class="form-group row">
|
||||
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
|
||||
<label class="control-label">Nombre Programa</label>
|
||||
</div>
|
||||
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">
|
||||
<asp:TextBox ID="txtNombre" runat="server" class="form-control" ></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div style="text-align:right">
|
||||
<asp:Button ID="btnGuardar" runat="server" Text="Guardar" class="btn btn-primary btn-xs" OnClick="btnGuardar_Click" Visible="true"/>
|
||||
<asp:Button ID="btnAnterior" runat="server" Text="Anterior" class="btn btn-primary btn-xs" OnClick="btnAnterior_Click" Visible="true"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
598
AYA.FROPI/FOPI/webforms/ADM/wfrPrograma.aspx.cs
Normal file
598
AYA.FROPI/FOPI/webforms/ADM/wfrPrograma.aspx.cs
Normal file
|
|
@ -0,0 +1,598 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.HtmlControls;
|
||||
|
||||
using AyABL;
|
||||
using AyABL.ADM;
|
||||
using AyABL.RCS;
|
||||
using AyADAL;
|
||||
|
||||
public partial class webforms_ADM_wfrPrograma : General
|
||||
{
|
||||
#region Inicializar Formulario (R0)
|
||||
|
||||
override protected void OnInit(EventArgs e) //M0
|
||||
{
|
||||
try
|
||||
{
|
||||
base.OnInit(e);
|
||||
|
||||
InicializarFormulario();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R0M0", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void InicializarFormulario() //M1
|
||||
{
|
||||
try
|
||||
{
|
||||
Response.Cache.SetCacheability(HttpCacheability.NoCache);
|
||||
construirGridView();
|
||||
Javascript.CheckAllGridViewItems(Page);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R0M1", ex);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Variables (R1)
|
||||
|
||||
GridView grvListaDatosTemp;
|
||||
ArrayList arlCondicionesFiltroBusqueda = new ArrayList();
|
||||
|
||||
ProgramaBL objProgramaBL;
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Eventos Formulario (R2)
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e) //M0
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
llenarGridView(true);
|
||||
ComandosxMenu();
|
||||
mostrarFilaTabla(1);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R2M0", ex);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Eventos Controles Web (R3)
|
||||
|
||||
/// <summary>
|
||||
/// Metodo que se utiliza para extraer información del registro de la base de datos y ser mostrado en el div de Controles
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
|
||||
protected void grvListaDatos_RowCommand(object sender, GridViewCommandEventArgs e) //M0
|
||||
{
|
||||
try
|
||||
{
|
||||
if (e.CommandName == "editar")
|
||||
{
|
||||
int i = Convert.ToInt32(e.CommandArgument);
|
||||
GridViewRow selectedRow = grvListaDatos.Rows[i];
|
||||
int intPkRegion = Convert.ToInt32(selectedRow.Cells[2].Text);
|
||||
ViewState["PkPrograma"] = intPkRegion;
|
||||
ViewState["MODO"] = "Modifica";
|
||||
|
||||
mostrarFilaTabla(2);
|
||||
|
||||
mostrarDatos(intPkRegion);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R3M0", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo que se utiliza para la paginación del Grid en caso de que el Rol desee ver mas registros
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
|
||||
protected void grvListaDatos_PageIndexChanging(object sender, GridViewPageEventArgs e) //M1
|
||||
{
|
||||
try
|
||||
{
|
||||
grvListaDatos.PageIndex = e.NewPageIndex;
|
||||
llenarGridView(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error R3M1", ex);
|
||||
}
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Activar el botón de Refrescar
|
||||
///</summary>
|
||||
///<param name="sender"></param>
|
||||
///<param name="e"></param>
|
||||
|
||||
protected void btnRefrescar_Click(object sender, System.Web.UI.ImageClickEventArgs e) //M2
|
||||
{
|
||||
try
|
||||
{
|
||||
llenarGridView(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R3M2", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Activa el evento del botón Buscar (binoculares)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnBuscar_Click(object sender, System.Web.UI.ImageClickEventArgs e) //M3
|
||||
{
|
||||
try
|
||||
{
|
||||
llenarGridView(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R3M3", ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Activa el evento del boton Nuevo
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
|
||||
protected void btnNuevo_Click(object sender, EventArgs e) //M4
|
||||
{
|
||||
try
|
||||
{
|
||||
ViewState["MODO"] = "Nuevo";
|
||||
mostrarFilaTabla(2);
|
||||
//MensajeError("Error en R3M4", null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R3M4", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo que activa el botón de Eliminar
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEliminar_Click(object sender, EventArgs e) //M5
|
||||
{
|
||||
try
|
||||
{
|
||||
//********** Instanciar objeto ******
|
||||
|
||||
// recorro el grid
|
||||
foreach (GridViewRow row in grvListaDatos.Rows)
|
||||
{
|
||||
|
||||
HtmlInputCheckBox chkTemp = (HtmlInputCheckBox)row.Controls[0].Controls[1];
|
||||
if (chkTemp != null)
|
||||
{
|
||||
// si el registro esta marcado
|
||||
if (chkTemp.Checked)
|
||||
{
|
||||
//Iguala la variable al valor en la celda seleccionada
|
||||
int intPkEliminar = Convert.ToInt32(row.Cells[2].Text);
|
||||
string registro = row.Cells[3].Text;
|
||||
//Obtiene el valor del objeto y lo iguala a la variable
|
||||
//**********aqui******** = intPkEliminar;
|
||||
|
||||
//Ejecuta el eliminar con el valor de la variable
|
||||
eliminarDatos(intPkEliminar, registro);
|
||||
}
|
||||
}
|
||||
}
|
||||
llenarGridView(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R3M5", ex);
|
||||
}
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Activa el metodo del boton Anterior, regresa a mostrar el listado
|
||||
///</summary>
|
||||
///<param name="sender"></param>
|
||||
///<param name="e"></param>
|
||||
|
||||
protected void btnAnterior_Click(object sender, EventArgs e) //M6
|
||||
{
|
||||
try
|
||||
{
|
||||
llenarGridView(true);
|
||||
divDatosSuperiores.Visible = true;
|
||||
divDatosInferiores.Visible = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R3M6", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Activa el evento del boton guardar.
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
|
||||
protected void btnGuardar_Click(object sender, EventArgs e) //M7
|
||||
{
|
||||
try
|
||||
{
|
||||
string strMensaje = string.Empty;
|
||||
|
||||
//******Reparar, aqui no van los llenarGridView(true);
|
||||
if (GuardarDatos())
|
||||
llenarGridView(true);
|
||||
else
|
||||
llenarGridView(true);
|
||||
|
||||
mostrarFilaTabla(1);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R3M7", ex);
|
||||
}
|
||||
}
|
||||
|
||||
protected void ddlTipoRegion_SelectedIndexChanged(object sender, EventArgs e) //M8
|
||||
{
|
||||
llenarGridView(true);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Metodos Personalizados (R4)
|
||||
|
||||
/// <summary>
|
||||
/// Oculta los divs según la necesidad
|
||||
/// </summary>
|
||||
/// <param name="p_intFila"></param>
|
||||
private void mostrarFilaTabla(int p_intFila) //M0
|
||||
{
|
||||
try
|
||||
{
|
||||
divDatosSuperiores.Visible = false;
|
||||
divDatosInferiores.Visible = false;
|
||||
|
||||
switch (p_intFila)
|
||||
{
|
||||
case 1:
|
||||
llenarGridView(true);
|
||||
divDatosSuperiores.Visible = true;
|
||||
break;
|
||||
case 2:
|
||||
llenarGridView(true);
|
||||
divDatosInferiores.Visible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R4M0", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo que se utiliza para contruir el Grid al inicio de la pantalla
|
||||
/// </summary>
|
||||
private void construirGridView() //M1
|
||||
{
|
||||
try
|
||||
{
|
||||
//Se Instancia la variable con el control
|
||||
grvListaDatosTemp = (GridView)divDatosSuperiores.FindControl("grvListaDatos");
|
||||
|
||||
//Se crean las columnas del grid
|
||||
GridViewBoundField bdfPkRegion = new GridViewBoundField("PKPROGRAMA", "PK", false, false, false);
|
||||
GridViewBoundField bdfNombreRegion = new GridViewBoundField("NOMBREPROGRAMA", "NOMBRE PROGRAMA", true, false, true);
|
||||
|
||||
////Asigna las columnas a los campos a la hora de hacer la consulta
|
||||
grvListaDatosTemp.Columns.Add(bdfPkRegion);
|
||||
grvListaDatosTemp.Columns.Add(bdfNombreRegion);
|
||||
|
||||
////Le damos estilo a las filas (opcional)
|
||||
grvListaDatosTemp.Columns[0].ItemStyle.Width = 25;
|
||||
grvListaDatosTemp.Columns[1].ItemStyle.Width = 25;
|
||||
grvListaDatosTemp.Columns[2].ItemStyle.Width = 25;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R4M1", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo que se utiliza para limpiar los campos en la pantalla
|
||||
/// </summary>
|
||||
private void limpiarCampos() //M2
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R4M2", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo que se utiliza con el buscador de la parte superior de la pantalla, y hace que se despliegue la información de acuerdo
|
||||
/// a lo solicitado
|
||||
/// </summary>
|
||||
private void Buscar() //M3
|
||||
{
|
||||
try
|
||||
{
|
||||
llenarGridView(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R4M3", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo que se utiliza para el despliegue de los botones segun el rol del usuario
|
||||
/// </summary>
|
||||
private void ComandosxMenu() //M4
|
||||
{
|
||||
try
|
||||
{
|
||||
//General general = null;
|
||||
|
||||
DataSet dsComandos = getComandos();
|
||||
|
||||
if (dsComandos != null)
|
||||
{
|
||||
foreach (DataRow drTemp in dsComandos.Tables[0].Rows)
|
||||
{
|
||||
switch (drTemp["NOMBRECOMANDO"].ToString().ToUpper())
|
||||
{
|
||||
case "NUEVO":
|
||||
btnNuevo.Visible = true;
|
||||
break;
|
||||
case "ELIMINAR":
|
||||
btnEliminar.Visible = true;
|
||||
break;
|
||||
case "MODIFICA":
|
||||
//Inicio de variable tipo VIEWSTATE
|
||||
ViewState["PUEDEMODIFICAR"] = true;
|
||||
btnGuardar.Visible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R4M4", ex);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Metodos Controles a Datos (R5)
|
||||
|
||||
/// <summary>
|
||||
/// guarda y modifica registros en la tabla.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
private bool GuardarDatos() //M0
|
||||
{
|
||||
bool blnValorRetornado = false; //Se utiliza para verificar si se ejecuto el proceso tanto de guardar como el de eliminar
|
||||
|
||||
try
|
||||
{
|
||||
string strModo = ViewState["MODO"].ToString();
|
||||
ViewState["PUEDEMODIFICAR"] = true;
|
||||
|
||||
//Igualar los valores de los controles a las propiedades del objeto a utilizar
|
||||
//Ejemplo
|
||||
objProgramaBL = new ProgramaBL();
|
||||
objProgramaBL.objProgramaEL.Nombre = txtNombre.Text;
|
||||
|
||||
|
||||
if (strModo == "Nuevo")
|
||||
{
|
||||
//Si es un nuevo registro se llama al metodo respectivo del objeto para hacer la inserción
|
||||
//***** Para este caso se obtiene el pk al utilizar el metodo del objeto para insertar información *******
|
||||
//Ejemplo
|
||||
if (objProgramaBL.insertarPrograma())
|
||||
{
|
||||
|
||||
blnValorRetornado = true;
|
||||
|
||||
GuardarEventoBitacora(
|
||||
Session["LOGIN"].ToString(), //Usuario
|
||||
AccionBitacora.INSERT.ToString(), //Accion que se va a ejecutar
|
||||
MensajesBitacora.IngresarRegistro + ": " + txtNombre.Text, //Mensaje de la bitacora
|
||||
"wfrPrograma.aspx"
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (strModo == "Modifica")
|
||||
{
|
||||
//Si se va a modificar el registro y si tiene el permiso de modificar
|
||||
if (Convert.ToBoolean(ViewState["PUEDEMODIFICAR"]) != false)
|
||||
{
|
||||
// Para hacer la modificación del registro se debe proporsionar la PK del registro a modificar
|
||||
//Ejemplo
|
||||
objProgramaBL.objProgramaEL.PK = Convert.ToInt32(ViewState["PkPrograma"]);
|
||||
if (objProgramaBL.actualizarPrograma())
|
||||
{
|
||||
|
||||
blnValorRetornado = true;
|
||||
|
||||
//Se ingresa a bitacora la transacción
|
||||
GuardarEventoBitacora(
|
||||
Session["LOGIN"].ToString(),
|
||||
AccionBitacora.UPDATE.ToString(),
|
||||
MensajesBitacora.ModificarRegistro + ": " + ViewState["PkPrograma"].ToString() + ", " + txtNombre.Text,
|
||||
"wfrPrograma.aspx"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R5M0", ex);
|
||||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||||
}
|
||||
return blnValorRetornado;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo que se utiliza para eliminar registros de la base de datos
|
||||
/// </summary>
|
||||
/// <param name="p_intPksAEliminar"></param>
|
||||
|
||||
private void eliminarDatos(int p_intPkPrograma, string registro) //M1
|
||||
{
|
||||
try
|
||||
{
|
||||
//Para eliminar datos inicialmente se instancia el objeto
|
||||
//Ejemplo
|
||||
objProgramaBL = new ProgramaBL();
|
||||
|
||||
//Se asignan los valores a las propiedades el objeto
|
||||
//Ejemplo
|
||||
objProgramaBL.objProgramaEL.PK = p_intPkPrograma;
|
||||
|
||||
if (objProgramaBL.borradoLogicoPrograma())
|
||||
{
|
||||
|
||||
//Se ingresa a bitacora la transacción
|
||||
GuardarEventoBitacora(
|
||||
Session["LOGIN"].ToString(),
|
||||
AccionBitacora.DELETE.ToString(),
|
||||
MensajesBitacora.EliminarRegistro + ": " + registro,
|
||||
"wfrPrograma.aspx"
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R5M1", ex);
|
||||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Metodos Datos a Controles (R6)
|
||||
|
||||
/// <summary>
|
||||
/// Carga el grid principal
|
||||
/// </summary>
|
||||
/// <param name="p_Llenar"></param>
|
||||
private void llenarGridView(bool p_Llenar) //M0
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!IsPostBack || p_Llenar)
|
||||
{
|
||||
//Se llena el dataset con la información
|
||||
//Ejemplo
|
||||
arlCondicionesFiltroBusqueda = new ArrayList();
|
||||
objProgramaBL = new ProgramaBL();
|
||||
objProgramaBL.objProgramaEL.PK = 0;
|
||||
DataSet dsListaDatos = objProgramaBL.getPrograma(arlCondicionesFiltroBusqueda);
|
||||
|
||||
//Hago el llamado del metodo que carga el grid o listado
|
||||
//Ejemplo
|
||||
General.detalleGridView(dsListaDatos, grvListaDatosTemp, lblTotalDatos);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R6M0", ex);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Muestra los datos del registro
|
||||
|
||||
/// </summary>
|
||||
/// <param name="p_intPkConsultar"></param>
|
||||
private void mostrarDatos(int p_intPkConsultar) //M1
|
||||
{
|
||||
try
|
||||
{
|
||||
//Se instancia el objeto
|
||||
//Ejemplo
|
||||
objProgramaBL = new ProgramaBL();
|
||||
|
||||
//Se obtiene la PK del registro por medio el parametro
|
||||
//Ejemplo
|
||||
objProgramaBL.objProgramaEL.PK = p_intPkConsultar;
|
||||
|
||||
|
||||
//Se llena un dataset con la inforación suministrada.
|
||||
//Ejemplo
|
||||
DataSet dsPrograma = objProgramaBL.getPrograma(null);
|
||||
|
||||
//Se llenan los campos
|
||||
//Ejemplo
|
||||
if (dsPrograma.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
|
||||
txtNombre.Text = dsPrograma.Tables[0].Rows[0]["NOMBREPROGRAMA"].ToString();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MensajeError("Error en R6M1", ex);
|
||||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue