1104 lines
44 KiB
C#
1104 lines
44 KiB
C#
|
|
/*===========================================================================================================================
|
|||
|
|
* Instituto Costarricense de Acueductos y Alcantarillados. - 2015
|
|||
|
|
* Formularios para Proyectos de Inversión
|
|||
|
|
* Nombre de la Pantalla: frwProyecto.aspx
|
|||
|
|
*
|
|||
|
|
* Explicación de los contenidos del archivo
|
|||
|
|
*===========================================================================================================================
|
|||
|
|
* HISTORIAL
|
|||
|
|
*
|
|||
|
|
* PERSONA DIA – MES - AÑO DESCRIPCIÓN
|
|||
|
|
* Esteban Gutierrez Rapso 09 – 11 - 2016 Se inicia con el diseño de la pagina
|
|||
|
|
* …………………………………………………………
|
|||
|
|
* …………………………………………………………
|
|||
|
|
*===========================================================================================================================
|
|||
|
|
* Derechos Reservados (C) 2016 AyA.
|
|||
|
|
* ESTE CÓDIGO ES PROVEÍDO “TAL CUAL ES” SIN GARANTÍA ALGUNA
|
|||
|
|
* DE NINGÚN TIPO, SEA IMPLICITA O EXPLICITA.
|
|||
|
|
* NO SE PERMITE SU REPRODUCCIÓN PARCIAL O TOTAL, NI SU COMERCIALIZACIÓN
|
|||
|
|
*===========================================================================================================================
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
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 AyAEL.ADM;
|
|||
|
|
|
|||
|
|
using AyADAL;
|
|||
|
|
using AyABL.RCS;
|
|||
|
|
using AyABL.ADM;
|
|||
|
|
using AyABL.AGP;
|
|||
|
|
using System.Web.Script.Serialization;
|
|||
|
|
using System.Web.Services;
|
|||
|
|
|
|||
|
|
public partial class webforms_AGP_wfrProyecto : System.Web.UI.Page
|
|||
|
|
{
|
|||
|
|
#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);
|
|||
|
|
|
|||
|
|
Javascript.CheckAllGridViewItems(Page);
|
|||
|
|
|
|||
|
|
construirgrvObjetivos();
|
|||
|
|
construirgrvResultados();
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R0M1", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Variables (R1)
|
|||
|
|
|
|||
|
|
GridView grvObjetivosTemp, grvResultadosTemp;
|
|||
|
|
|
|||
|
|
DependenciaBL objDependenciaBL;
|
|||
|
|
CatalogoBL objCatalogoBL;
|
|||
|
|
UbicacionBL objUbicacionBL;
|
|||
|
|
RegionBL objRegionBL;
|
|||
|
|
|
|||
|
|
ObjetivoEspecificoBL objObjetivoEspecificoBL;
|
|||
|
|
ProyectoBL objProyectoBL;
|
|||
|
|
ResultadoBL objResultadoBL;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Eventos Formulario (R2)
|
|||
|
|
|
|||
|
|
protected void Page_Load(object sender, EventArgs e) //M0
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if ((!IsPostBack) && (Session.Count > 0))
|
|||
|
|
{
|
|||
|
|
llenarDDLProyecto();
|
|||
|
|
ComandosxMenu();
|
|||
|
|
|
|||
|
|
if (Session["PKPROYECTO"] != null)
|
|||
|
|
{
|
|||
|
|
ddlProyecto.SelectedValue = Session["PKPROYECTO"].ToString();
|
|||
|
|
|
|||
|
|
ddlProyecto_SelectedIndexChanged(null, null);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
mostrarDatos();
|
|||
|
|
|
|||
|
|
llenarDDLPrioridad();
|
|||
|
|
llenarDDLCategoria();
|
|||
|
|
llenarDDLDependencia();
|
|||
|
|
llenarDDLProvincia();
|
|||
|
|
llenarDDLRegion();
|
|||
|
|
llenarDDLAreaTematica();
|
|||
|
|
llenarDDLInfluencia();
|
|||
|
|
llenarDDLSector();
|
|||
|
|
|
|||
|
|
llenarGridObjetivos();
|
|||
|
|
llenarGridResultados();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R2M0", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Eventos Controles Web (R3)
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Activa el evento del boton Nuevo
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
|
|||
|
|
protected void btnNuevo_Click(object sender, EventArgs e) //M0
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R3M0", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Activa el evento del boton guardar.1
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="sender"></param>
|
|||
|
|
/// <param name="e"></param>
|
|||
|
|
|
|||
|
|
protected void btnGuardar_Click(object sender, EventArgs e) //M1
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (GuardarDatos())
|
|||
|
|
{
|
|||
|
|
//MensajeInformativo("El registro fue almacenado exitosamente");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
////MensajeError("El registro no fue almacenado, verifique", null);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R3M1", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected void ddlProyecto_SelectedIndexChanged(object sender, EventArgs e) //M2
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
mostrarDatos();
|
|||
|
|
|
|||
|
|
//Para interactura en la pantalla
|
|||
|
|
ViewState["PkProyecto"] = ddlProyecto.SelectedValue;
|
|||
|
|
|
|||
|
|
//Para trabajar en la aplicación
|
|||
|
|
Session["PKPROYECTO"] = ddlProyecto.SelectedValue;
|
|||
|
|
|
|||
|
|
if (ddlProyecto.SelectedValue == "-1")
|
|||
|
|
{
|
|||
|
|
btnGuardar.Visible = true;
|
|||
|
|
btnModificar.Visible = false;
|
|||
|
|
}
|
|||
|
|
//else if (ddlProyecto.SelectedValue != "-1" && bool.Parse(ViewState["PUEDEMODIFICAR"].ToString()) == true)
|
|||
|
|
//{
|
|||
|
|
// btnGuardar.Visible = false;
|
|||
|
|
// btnModificar.Visible = true;
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R3M2", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected void btnEliminar_Click(object sender, EventArgs e) //M3
|
|||
|
|
{
|
|||
|
|
EliminarDatos();
|
|||
|
|
llenarDDLProyecto();
|
|||
|
|
limpiarCampos();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected void btnAgregarObj_Click(object sender, EventArgs e) //M4
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (grvObjetivos.Rows.Count < 5)
|
|||
|
|
{
|
|||
|
|
GuardaObjetivos();
|
|||
|
|
|
|||
|
|
txtNumeroObjetivo.Text = string.Empty;
|
|||
|
|
txtObjetivoEspecifico.Text = string.Empty;
|
|||
|
|
txtNumeroObjetivo.Focus();
|
|||
|
|
}
|
|||
|
|
//else
|
|||
|
|
//MensajeInformativo("No es permitido mas de 5 objetivos específicos");
|
|||
|
|
}
|
|||
|
|
catch(Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R3M4", ex); //captura error
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected void btnQuitarObj_Click(object sender, EventArgs e) //M5
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
// recorro el grid
|
|||
|
|
foreach (GridViewRow row in grvObjetivos.Rows)
|
|||
|
|
{
|
|||
|
|
HtmlInputCheckBox chkTemp = (HtmlInputCheckBox)row.Controls[0].Controls[1];
|
|||
|
|
if (chkTemp != null)
|
|||
|
|
{
|
|||
|
|
// si el registro esta marcado
|
|||
|
|
if (chkTemp.Checked)
|
|||
|
|
{
|
|||
|
|
int intPkObjetivo = Convert.ToInt32(row.Cells[1].Text);
|
|||
|
|
EliminarObjetivo(intPkObjetivo);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
llenarGridObjetivos();
|
|||
|
|
|
|||
|
|
txtNumeroObjetivo.Text = string.Empty;
|
|||
|
|
txtObjetivoEspecifico.Text = string.Empty;
|
|||
|
|
txtNumeroObjetivo.Focus();
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R3M5", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected void btnAgregarRes_Click(object sender, EventArgs e) //M6
|
|||
|
|
{
|
|||
|
|
DataTable dt = (DataTable)ViewState["RESULTADOS"];
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (grvResultados.Rows.Count < 5)
|
|||
|
|
{
|
|||
|
|
GuardaResultados();
|
|||
|
|
|
|||
|
|
txtNumeroResultado.Text = string.Empty;
|
|||
|
|
txtResultado.Text = string.Empty;
|
|||
|
|
txtNumeroResultado.Focus();
|
|||
|
|
}
|
|||
|
|
//else
|
|||
|
|
//MensajeInformativo("No es permitido mas de 5 resultados");
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R3M6", ex); //captura error
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected void btnQuitarRes_Click(object sender, EventArgs e) //M7
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
// recorro el grid
|
|||
|
|
foreach (GridViewRow row in grvResultados.Rows)
|
|||
|
|
{
|
|||
|
|
HtmlInputCheckBox chkTemp = (HtmlInputCheckBox)row.Controls[0].Controls[1];
|
|||
|
|
if (chkTemp != null)
|
|||
|
|
{
|
|||
|
|
// si el registro esta marcado
|
|||
|
|
if (chkTemp.Checked)
|
|||
|
|
{
|
|||
|
|
int intPkResultado = Convert.ToInt32(row.Cells[1].Text);
|
|||
|
|
EliminarResultado(intPkResultado);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
llenarGridResultados();
|
|||
|
|
|
|||
|
|
txtNumeroResultado.Text = string.Empty;
|
|||
|
|
txtResultado.Text = string.Empty;
|
|||
|
|
txtNumeroResultado.Focus();
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R3M7", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected void btnModificar_Click(object sender, EventArgs e) //M8
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (ModificarDatos())
|
|||
|
|
{
|
|||
|
|
//MensajeInformativo("El registro fue modificado exitosamente");
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
////MensajeError("El registro no fue modificado, verifique", null);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R3M1", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Metodos Personalizados (R4)
|
|||
|
|
|
|||
|
|
private void ComandosxMenu() //M0
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//DataSet dsComandos = getComandos();
|
|||
|
|
|
|||
|
|
//if (dsComandos != null)
|
|||
|
|
//{
|
|||
|
|
// foreach (DataRow drTemp in dsComandos.Tables[0].Rows)
|
|||
|
|
// {
|
|||
|
|
// switch (drTemp["NOMBRECOMANDO"].ToString().ToUpper())
|
|||
|
|
// {
|
|||
|
|
// case "NUEVO":
|
|||
|
|
// btnGuardar.Visible = true;
|
|||
|
|
// break;
|
|||
|
|
// case "ELIMINAR":
|
|||
|
|
// btnEliminar.Visible = true;
|
|||
|
|
// //btnEliminarObj.Visible = true;
|
|||
|
|
// //btnEliminarRes.Visible = true;
|
|||
|
|
// break;
|
|||
|
|
// case "MODIFICA":
|
|||
|
|
// //Inicio de variable tipo VIEWSTATE
|
|||
|
|
// ViewState["PUEDEMODIFICAR"] = true;
|
|||
|
|
// btnAgregarObj.Visible = true;
|
|||
|
|
// btnAgregarRes.Visible = true;
|
|||
|
|
// break;
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R4M0", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void construirgrvObjetivos() //M1
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
grvObjetivosTemp = (GridView)divDatosInferiores.FindControl("grvObjetivos");
|
|||
|
|
|
|||
|
|
GridViewBoundField bdfPkObjetivo = new GridViewBoundField("PKOBJETIVOESPECIFICO", "PK", false, false, false);
|
|||
|
|
GridViewBoundField bdfNumero = new GridViewBoundField("NUMEROOBJETIVOESPECIFICO", "#", false, false, true);
|
|||
|
|
GridViewBoundField bdfDescripcion = new GridViewBoundField("DESCRIPCIONOBJETIVOESPECIFICO", "OBJETIVO", false, false, true);
|
|||
|
|
GridViewBoundField bdfCumplido = new GridViewBoundField("CUMPLIDOOBJETIVOESPECIFICO", "CUMPLIDO", false, "Si", "No", true);
|
|||
|
|
|
|||
|
|
grvObjetivosTemp.Columns.Add(bdfPkObjetivo);
|
|||
|
|
grvObjetivosTemp.Columns.Add(bdfNumero);
|
|||
|
|
grvObjetivosTemp.Columns.Add(bdfDescripcion);
|
|||
|
|
grvObjetivosTemp.Columns.Add(bdfCumplido);
|
|||
|
|
|
|||
|
|
grvObjetivosTemp.Columns[0].ItemStyle.Width = 25;
|
|||
|
|
grvObjetivosTemp.Columns[1].ItemStyle.Width = 25;
|
|||
|
|
grvObjetivosTemp.Columns[2].ItemStyle.Width = 25;
|
|||
|
|
grvObjetivosTemp.Columns[4].ItemStyle.Width = 75;
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R4M1", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void construirgrvResultados() //M2
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
grvResultadosTemp = (GridView)divDatosInferiores.FindControl("grvResultados");
|
|||
|
|
|
|||
|
|
GridViewBoundField bdfPkResultado = new GridViewBoundField("PKRESULTADO", "PK", false, false, false);
|
|||
|
|
GridViewBoundField bdfNumero = new GridViewBoundField("NUMERORESULTADO", "#", false, false, true);
|
|||
|
|
GridViewBoundField bdfDescripcion = new GridViewBoundField("DESCRIPCIONRESULTADO", "RESULTADO", false, false, true);
|
|||
|
|
|
|||
|
|
grvResultadosTemp.Columns.Add(bdfPkResultado);
|
|||
|
|
grvResultadosTemp.Columns.Add(bdfNumero);
|
|||
|
|
grvResultadosTemp.Columns.Add(bdfDescripcion);
|
|||
|
|
|
|||
|
|
grvResultadosTemp.Columns[0].ItemStyle.Width = 25;
|
|||
|
|
grvResultadosTemp.Columns[1].ItemStyle.Width = 25;
|
|||
|
|
grvResultadosTemp.Columns[2].ItemStyle.Width = 25;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R4M2", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void limpiarCampos() //M3
|
|||
|
|
{
|
|||
|
|
txtProyecto.Text = string.Empty;
|
|||
|
|
txtNumeroBPIP.Text = string.Empty;
|
|||
|
|
txtCanton.Text = string.Empty;
|
|||
|
|
txtDistrito.Text = string.Empty;
|
|||
|
|
txtNumeroAccion.Text = string.Empty;
|
|||
|
|
txtMetaAccion.Text = string.Empty;
|
|||
|
|
txtMetaInstitucional.Text = string.Empty;
|
|||
|
|
txtDescripcion.Text = string.Empty;
|
|||
|
|
txtBeneficioDir.Text = string.Empty;
|
|||
|
|
txtBeneficioIndir.Text = string.Empty;
|
|||
|
|
txtObjetivo.Text = string.Empty;
|
|||
|
|
|
|||
|
|
grvObjetivos.DataBind();
|
|||
|
|
grvResultados.DataBind();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Metodos Controles a Datos (R5)
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// guarda y modifica registros en la tabla.
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
private bool GuardarDatos() //M0
|
|||
|
|
{
|
|||
|
|
bool blnEjecutado = false;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
objProyectoBL = new ProyectoBL();
|
|||
|
|
|
|||
|
|
objProyectoBL.objProyectoEL.Nombre = txtProyecto.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.NumeroBPIP = txtNumeroBPIP.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.Dependencia = Int32.Parse(ddlDependencia.SelectedValue);
|
|||
|
|
objProyectoBL.objProyectoEL.Sector = Int32.Parse(ddlSector.SelectedValue);
|
|||
|
|
objProyectoBL.objProyectoEL.AreaTematica = Int32.Parse(ddlAreaTematica.SelectedValue);
|
|||
|
|
objProyectoBL.objProyectoEL.AreaInfluencia = Int32.Parse(ddlInfluencia.SelectedValue);
|
|||
|
|
objProyectoBL.objProyectoEL.Region = Int32.Parse(ddlRegion.SelectedValue);
|
|||
|
|
objProyectoBL.objProyectoEL.Provincia = Int32.Parse(ddlProvincia.SelectedValue);
|
|||
|
|
objProyectoBL.objProyectoEL.Canton = txtCanton.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.Distrito = txtDistrito.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.NumeroAccionEstrategica = txtNumeroAccion.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.MetaAccionEstrategica = txtMetaAccion.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.MetaInstitucional = txtMetaInstitucional.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.Prioridad = Int32.Parse(ddlPrioridad.SelectedValue);
|
|||
|
|
objProyectoBL.objProyectoEL.Descripcion = txtDescripcion.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.ObjetivoGeneral = txtObjetivo.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.BeneficiarioDirecto = txtBeneficioDir.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.BeneficiarioIndirecto = txtBeneficioIndir.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.CodigoAcceso = Session["CODIGOACCESO"].ToString();
|
|||
|
|
objProyectoBL.objProyectoEL.Categoria = Int32.Parse(ddlCategoria.SelectedValue);
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (objProyectoBL.verificaProyecto())
|
|||
|
|
{
|
|||
|
|
ViewState["PkProyecto"] = objProyectoBL.insertarProyecto();
|
|||
|
|
|
|||
|
|
blnEjecutado = true;
|
|||
|
|
|
|||
|
|
//GuardarEventoBitacora(
|
|||
|
|
//Session["LOGIN"].ToString(),
|
|||
|
|
//AccionBitacora.INSERT.ToString(),
|
|||
|
|
//MensajesBitacora.IngresarRegistro + ": Se ha ingresado el registro: Proyecto: " + txtProyecto.Text + ", Dependencia: " + ddlDependencia.SelectedItem.Text + ", Sector: " +
|
|||
|
|
// ddlSector.SelectedItem.Text + ", " + "Area Tematica: " + ddlAreaTematica.SelectedItem.Text + ", Area Influencia: " +
|
|||
|
|
// ddlInfluencia.SelectedItem.Text + ", Región: " + ddlRegion.SelectedItem.Text + ", Provincia: " + ", " +
|
|||
|
|
// "Cantón: " + txtCanton.Text + ", Distrito: " + txtDistrito.Text + ", " + "Numero Acción Estratégica: " + txtNumeroAccion.Text +
|
|||
|
|
// ", Meta Acción Estratégica: " + txtMetaAccion.Text + ", Meta Institucional: " + txtMetaInstitucional.Text + ", Prioridad: " +
|
|||
|
|
// ddlPrioridad.SelectedItem.Text + ", Descripción: " + txtDescripcion.Text + ", Objetivo General: " + txtObjetivo.Text +
|
|||
|
|
// ", Beneficiarios Directos: " + txtBeneficioDir.Text + ", Benerficiario Indirecto: " + txtBeneficioIndir.Text +
|
|||
|
|
// ", Categoría del Proyecto: " + ddlCategoria.SelectedItem.Text + ", Código Acceso: " + Session["CODIGOACCESO"].ToString(),
|
|||
|
|
//"frwProyecto.aspx");
|
|||
|
|
|
|||
|
|
llenarDDLProyecto();
|
|||
|
|
}
|
|||
|
|
//else
|
|||
|
|
// MensajeAdvertencia("No se incluyó el proyecto debido a que ya se ha incluido otro con el mismo nombre o numero BPIP");
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R5M0", ex);
|
|||
|
|
blnEjecutado = false;
|
|||
|
|
General.ReportarError(ex, Session["LOGIN"].ToString());
|
|||
|
|
}
|
|||
|
|
return blnEjecutado;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private bool ModificarDatos() //M1
|
|||
|
|
{
|
|||
|
|
bool blnEjecutado = false;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
objProyectoBL = new ProyectoBL();
|
|||
|
|
|
|||
|
|
objProyectoBL.objProyectoEL.Nombre = txtProyecto.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.NumeroBPIP = txtNumeroBPIP.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.Dependencia = Int32.Parse(ddlDependencia.SelectedValue);
|
|||
|
|
objProyectoBL.objProyectoEL.Sector = Int32.Parse(ddlSector.SelectedValue);
|
|||
|
|
objProyectoBL.objProyectoEL.AreaTematica = Int32.Parse(ddlAreaTematica.SelectedValue);
|
|||
|
|
objProyectoBL.objProyectoEL.AreaInfluencia = Int32.Parse(ddlInfluencia.SelectedValue);
|
|||
|
|
objProyectoBL.objProyectoEL.Region = Int32.Parse(ddlRegion.SelectedValue);
|
|||
|
|
//objProyectoBL.objProyectoEL.Provincia = Int32.Parse(ddlProvincia.SelectedValue);
|
|||
|
|
objProyectoBL.objProyectoEL.Canton = txtCanton.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.Distrito = txtDistrito.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.NumeroAccionEstrategica = txtNumeroAccion.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.MetaAccionEstrategica = txtMetaAccion.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.MetaInstitucional = txtMetaInstitucional.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.Prioridad = Int32.Parse(ddlPrioridad.SelectedValue);
|
|||
|
|
objProyectoBL.objProyectoEL.Descripcion = txtDescripcion.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.ObjetivoGeneral = txtObjetivo.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.BeneficiarioDirecto = txtBeneficioDir.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.BeneficiarioIndirecto = txtBeneficioIndir.Text.Trim();
|
|||
|
|
objProyectoBL.objProyectoEL.Categoria = Int32.Parse(ddlCategoria.SelectedValue);
|
|||
|
|
|
|||
|
|
|
|||
|
|
objProyectoBL.objProyectoEL.PK = Int32.Parse(ddlProyecto.SelectedValue);
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (objProyectoBL.actualizarProyecto())
|
|||
|
|
{
|
|||
|
|
blnEjecutado = true;
|
|||
|
|
|
|||
|
|
//GuardarEventoBitacora(
|
|||
|
|
//Session["LOGIN"].ToString(),
|
|||
|
|
//AccionBitacora.UPDATE.ToString(),
|
|||
|
|
//MensajesBitacora.ModificarRegistro + ": Proyecto: " + txtProyecto.Text + ", Dependencia: " + ddlDependencia.SelectedItem.Text + ", Sector: " + ddlSector.SelectedItem.Text + ", Area Tematica: " +
|
|||
|
|
// ddlAreaTematica.SelectedItem.Text + ", Area Influencia: " + ddlInfluencia.SelectedItem.Text + ", Región: " + ddlRegion.SelectedItem.Text + ", Provincia: " + ", Cantón: " + txtCanton.Text + ", Distrito: " + txtDistrito.Text + ", Numero Acción Estratégica: " + txtNumeroAccion.Text + ", Meta Acción Estratégica: " + txtMetaAccion.Text + ", Meta Institucional: " + txtMetaInstitucional.Text + ", Prioridad: " +
|
|||
|
|
// ddlPrioridad.SelectedItem.Text + ", Descripción: " + txtDescripcion.Text + ", Objetivo General: " + txtObjetivo.Text + ", Beneficiarios Directos: " + txtBeneficioDir.Text
|
|||
|
|
// + ", Benerficiario Indirecto: " + txtBeneficioIndir.Text + ", Categoría del Proyecto: " + ddlCategoria.SelectedItem.Text,
|
|||
|
|
//"frwProyecto.aspx");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R5M1", ex);
|
|||
|
|
blnEjecutado = false;
|
|||
|
|
General.ReportarError(ex, Session["LOGIN"].ToString());
|
|||
|
|
}
|
|||
|
|
return blnEjecutado;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void EliminarDatos() //M2
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (ddlProyecto.SelectedValue != "-1")
|
|||
|
|
{
|
|||
|
|
objProyectoBL = new ProyectoBL();
|
|||
|
|
objProyectoBL.objProyectoEL.PK = Int32.Parse(ddlProyecto.SelectedValue);
|
|||
|
|
if (objProyectoBL.actualizaEstadoProyecto())
|
|||
|
|
{
|
|||
|
|
//MensajeInformativo("El Proyecto se eliminó correctamente");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R5M2", ex);
|
|||
|
|
General.ReportarError(ex, Session["LOGIN"].ToString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void GuardaObjetivos() //M3
|
|||
|
|
{
|
|||
|
|
//Indicar a los usuarios que para modificar la información se debe seleccionar el Proyecto al inicio de la pantalla
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (txtObjetivoEspecifico.Text != string.Empty && txtNumeroObjetivo.Text != string.Empty)
|
|||
|
|
{
|
|||
|
|
objObjetivoEspecificoBL = new ObjetivoEspecificoBL();
|
|||
|
|
objObjetivoEspecificoBL.objObjetivoEspecificoEL.Numero = Int32.Parse(txtNumeroObjetivo.Text);
|
|||
|
|
objObjetivoEspecificoBL.objObjetivoEspecificoEL.Descripcion = txtObjetivoEspecifico.Text;
|
|||
|
|
objObjetivoEspecificoBL.objObjetivoEspecificoEL.Proyecto = Int32.Parse(ViewState["PkProyecto"].ToString());
|
|||
|
|
|
|||
|
|
if (ddlProyecto.SelectedValue != "-1")
|
|||
|
|
{
|
|||
|
|
if (objObjetivoEspecificoBL.insertarObjetivo())
|
|||
|
|
{
|
|||
|
|
//MensajeInformativo("Se guardó el Objetivo Especifico");
|
|||
|
|
|
|||
|
|
llenarGridObjetivos();
|
|||
|
|
|
|||
|
|
//GuardarEventoBitacora(
|
|||
|
|
// Session["LOGIN"].ToString(),
|
|||
|
|
// AccionBitacora.INSERT.ToString(),
|
|||
|
|
// MensajesBitacora.ModificarRegistro + ": " + txtNumeroObjetivo.Text + "." + txtObjetivoEspecifico.Text + " del Proyecto " + ddlProyecto.SelectedItem.Text,
|
|||
|
|
// "frwProyecto.aspx");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
//else
|
|||
|
|
//MensajeInformativo("Debe seleccionar un proyecto");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch(Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R5M3", ex);
|
|||
|
|
General.ReportarError(ex, Session["LOGIN"].ToString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void EliminarObjetivo(int p_intPkObjetivo) //M4
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
objObjetivoEspecificoBL = new ObjetivoEspecificoBL();
|
|||
|
|
objObjetivoEspecificoBL.objObjetivoEspecificoEL.PK = p_intPkObjetivo;
|
|||
|
|
objObjetivoEspecificoBL.actualizaEstadoObjetivo();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R5M4", ex);
|
|||
|
|
General.ReportarError(ex, Session["LOGIN"].ToString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void GuardaResultados() //M5
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (ViewState["PkProyecto"].ToString() != "-1")
|
|||
|
|
{
|
|||
|
|
objResultadoBL = new ResultadoBL();
|
|||
|
|
objResultadoBL.objResultadoEL.Numero = Int32.Parse(txtNumeroResultado.Text);
|
|||
|
|
objResultadoBL.objResultadoEL.Descripcion = txtResultado.Text;
|
|||
|
|
objResultadoBL.objResultadoEL.Proyecto = Int32.Parse(ViewState["PkProyecto"].ToString());
|
|||
|
|
|
|||
|
|
if (objResultadoBL.insertarResultado())
|
|||
|
|
//MensajeInformativo("Se guardó el Resultado");
|
|||
|
|
|
|||
|
|
llenarGridResultados();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R5M5", ex);
|
|||
|
|
General.ReportarError(ex, Session["LOGIN"].ToString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void EliminarResultado(int p_intPkResultado) //M6
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
objResultadoBL = new ResultadoBL();
|
|||
|
|
objResultadoBL.objResultadoEL.PK = p_intPkResultado;
|
|||
|
|
objResultadoBL.actualizaEstadoResultado();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R5M6", ex);
|
|||
|
|
General.ReportarError(ex, Session["LOGIN"].ToString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region Metodos Datos a Controles (R6)
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Muestra los datos del registro
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="p_intPkConsultar"></param>
|
|||
|
|
private void mostrarDatos() //M0
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
if (ddlProyecto.SelectedValue != "-1")
|
|||
|
|
{
|
|||
|
|
objProyectoBL = new ProyectoBL();
|
|||
|
|
objProyectoBL.objProyectoEL.PK = Int32.Parse(ddlProyecto.SelectedValue);
|
|||
|
|
DataSet dsProyecto = objProyectoBL.getProyectos();
|
|||
|
|
|
|||
|
|
if (dsProyecto.Tables[0].Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
txtProyecto.Text = dsProyecto.Tables[0].Rows[0]["NOMBREPROYECTO"].ToString();
|
|||
|
|
txtNumeroBPIP.Text = dsProyecto.Tables[0].Rows[0]["NUMEROBPIPPROYECTO"].ToString();
|
|||
|
|
txtNumeroAccion.Text = dsProyecto.Tables[0].Rows[0]["NUMEROACCIONESTRATEGICAPROYECTO"].ToString();
|
|||
|
|
txtMetaAccion.Text = dsProyecto.Tables[0].Rows[0]["METAACCIONESTRATEGICAPROYECTO"].ToString();
|
|||
|
|
txtMetaInstitucional.Text = dsProyecto.Tables[0].Rows[0]["METAINSTITUCIONALPROYECTO"].ToString();
|
|||
|
|
ddlPrioridad.SelectedValue = dsProyecto.Tables[0].Rows[0]["FKPRIORIDAD"].ToString();
|
|||
|
|
txtDescripcion.Text = dsProyecto.Tables[0].Rows[0]["DESCRIPCIONPROYECTO"].ToString();
|
|||
|
|
ddlAreaTematica.SelectedValue = dsProyecto.Tables[0].Rows[0]["FKAREATEMATICA"].ToString();
|
|||
|
|
ddlInfluencia.SelectedValue = dsProyecto.Tables[0].Rows[0]["FKAREAINFLUENCIA"].ToString();
|
|||
|
|
txtObjetivo.Text = dsProyecto.Tables[0].Rows[0]["OBJETIVOGENERALPROYECTO"].ToString();
|
|||
|
|
txtBeneficioDir.Text = dsProyecto.Tables[0].Rows[0]["BENEFICIARIODIRECTOPROYECTO"].ToString();
|
|||
|
|
txtBeneficioIndir.Text = dsProyecto.Tables[0].Rows[0]["BENEFICIARIOINDIRECTOPROYECTO"].ToString();
|
|||
|
|
ddlDependencia.SelectedValue = dsProyecto.Tables[0].Rows[0]["FKDEPENDENCIA"].ToString();
|
|||
|
|
ddlCategoria.SelectedValue = dsProyecto.Tables[0].Rows[0]["FKCATEGORIA"].ToString();
|
|||
|
|
ddlProvincia.SelectedValue = dsProyecto.Tables[0].Rows[0]["FKPROVINCIA"].ToString();
|
|||
|
|
ddlSector.SelectedValue = dsProyecto.Tables[0].Rows[0]["FKSECTOR"].ToString();
|
|||
|
|
txtCanton.Text = dsProyecto.Tables[0].Rows[0]["CANTONPROYECTO"].ToString();
|
|||
|
|
txtDistrito.Text = dsProyecto.Tables[0].Rows[0]["DISTRITOPROYECTO"].ToString();
|
|||
|
|
ddlRegion.SelectedValue = dsProyecto.Tables[0].Rows[0]["FKREGION"].ToString();
|
|||
|
|
//MOSTRAR OBJETIVOS Y RESULTADOS
|
|||
|
|
llenarGridObjetivos();
|
|||
|
|
|
|||
|
|
llenarGridResultados();
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//MensajeInformativo("No se encontró el registro solicitado");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else if (ddlProyecto.SelectedValue == "-1")
|
|||
|
|
limpiarCampos();
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R6M0", ex);
|
|||
|
|
General.ReportarError(ex, Session["LOGIN"].ToString());
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void llenarDDLProyecto() //M1
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//Instancia el objeto
|
|||
|
|
objProyectoBL = new ProyectoBL();
|
|||
|
|
|
|||
|
|
objProyectoBL.objProyectoEL.PK = 0;
|
|||
|
|
objProyectoBL.objProyectoEL.ASTATE = true;
|
|||
|
|
objProyectoBL.objProyectoEL.CodigoAcceso = Session["CODIGOACCESO"].ToString();
|
|||
|
|
|
|||
|
|
//Carga la información en un dataset
|
|||
|
|
DataSet dsProyecto = objProyectoBL.getProyectos();
|
|||
|
|
|
|||
|
|
General.ddlListaProyectos(dsProyecto, ddlProyecto);
|
|||
|
|
ddlProyecto.Attributes["style"] = "width: 90%; max-width: 90%";
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R6M1", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// LLena del dropdownlist con las prioridades del proyecto
|
|||
|
|
/// </summary>
|
|||
|
|
|
|||
|
|
private void llenarDDLPrioridad() //M2
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//Limpia el control
|
|||
|
|
ddlPrioridad.Items.Clear();
|
|||
|
|
//Instancia el objeto
|
|||
|
|
objCatalogoBL = new CatalogoBL();
|
|||
|
|
|
|||
|
|
objCatalogoBL.objCatalogoEL.PK = 0;
|
|||
|
|
objCatalogoBL.objCatalogoEL.Padre = 7;
|
|||
|
|
objCatalogoBL.objCatalogoEL.ASTATE = true;
|
|||
|
|
//Carga la información en un dataset
|
|||
|
|
DataSet dsPrioridad = objCatalogoBL.getCatalogo();
|
|||
|
|
if (dsPrioridad.Tables[0].Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
ddlPrioridad.DataSource = dsPrioridad;
|
|||
|
|
ddlPrioridad.DataTextField = dsPrioridad.Tables[0].Columns["NOMBRECATALOGO"].ColumnName;
|
|||
|
|
ddlPrioridad.DataValueField = dsPrioridad.Tables[0].Columns["PKCATALOGO"].ColumnName;
|
|||
|
|
ddlPrioridad.DataBind();
|
|||
|
|
|
|||
|
|
ddlPrioridad.Items.Insert(0, new ListItem("Seleccione una Prioridad", "-1"));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R6M2", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Llena el dropdownlist con las dependencias del proyecto
|
|||
|
|
/// </summary>
|
|||
|
|
///
|
|||
|
|
private void llenarDDLDependencia() //M3
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//Limpia el control
|
|||
|
|
ddlDependencia.Items.Clear();
|
|||
|
|
//Instancia el objeto
|
|||
|
|
objDependenciaBL = new DependenciaBL();
|
|||
|
|
|
|||
|
|
objDependenciaBL.objDependenciaEL.PK = 0;
|
|||
|
|
objDependenciaBL.objDependenciaEL.Padre = 0;
|
|||
|
|
objDependenciaBL.objDependenciaEL.ASTATE = true;
|
|||
|
|
//Carga la información en un dataset
|
|||
|
|
DataSet dsDependencia = objDependenciaBL.getDependencia(null);
|
|||
|
|
if (dsDependencia.Tables[0].Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
ddlDependencia.DataSource = dsDependencia;
|
|||
|
|
ddlDependencia.DataTextField = dsDependencia.Tables[0].Columns["NOMBREDEPENDENCIA"].ColumnName;
|
|||
|
|
ddlDependencia.DataValueField = dsDependencia.Tables[0].Columns["PKDEPENDENCIA"].ColumnName;
|
|||
|
|
ddlDependencia.DataBind();
|
|||
|
|
|
|||
|
|
ddlDependencia.Items.Insert(0, new ListItem("Seleccione una Dependencia", "-1"));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R6M3", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Llena el dropdownlist con las categorias del proyecto
|
|||
|
|
/// </summary>
|
|||
|
|
private void llenarDDLCategoria() //M4
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//Limpia el control
|
|||
|
|
ddlCategoria.Items.Clear();
|
|||
|
|
|
|||
|
|
objCatalogoBL = new CatalogoBL();
|
|||
|
|
objCatalogoBL.objCatalogoEL.PK = 0;
|
|||
|
|
objCatalogoBL.objCatalogoEL.Padre = 11;
|
|||
|
|
objCatalogoBL.objCatalogoEL.ASTATE = true;
|
|||
|
|
DataSet dsCategoria = objCatalogoBL.getCatalogo();
|
|||
|
|
if (dsCategoria.Tables[0].Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
ddlCategoria.DataSource = dsCategoria;
|
|||
|
|
ddlCategoria.DataTextField = dsCategoria.Tables[0].Columns["NOMBRECATALOGO"].ColumnName;
|
|||
|
|
ddlCategoria.DataValueField = dsCategoria.Tables[0].Columns["PKCATALOGO"].ColumnName;
|
|||
|
|
ddlCategoria.DataBind();
|
|||
|
|
|
|||
|
|
ddlCategoria.Items.Insert(0, new ListItem("Seleccione un Categoria", "-1"));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//MensajeError("Error en R6M4", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
private void llenarDDLProvincia() //M5
|
|||
|
|
{
|
|||
|
|
List<UbicacionEL> lstInfoProvincias = new List<UbicacionEL>();
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//Limpia el control
|
|||
|
|
ddlProvincia.Items.Clear();
|
|||
|
|
//Instancia el objeto
|
|||
|
|
objUbicacionBL = new UbicacionBL();
|
|||
|
|
objUbicacionBL.objUbicacionEL.PK = 0;
|
|||
|
|
objUbicacionBL.objUbicacionEL.Padre = -1;
|
|||
|
|
objUbicacionBL.objUbicacionEL.ASTATE = true;
|
|||
|
|
DataSet dsProvincia = objUbicacionBL.getUbicacion();
|
|||
|
|
|
|||
|
|
ddlProvincia.Items.Insert(0, new ListItem("Seleccione un Provincia", "-1"));
|
|||
|
|
foreach (DataRow drProvincia in dsProvincia.Tables[0].Rows)
|
|||
|
|
{
|
|||
|
|
var infoProvincia = new UbicacionEL { PK = int.Parse(drProvincia["PKUBICACION"].ToString()), Nombre = drProvincia["NOMBREUBICACION"].ToString() };
|
|||
|
|
|
|||
|
|
lstInfoProvincias.Add(infoProvincia);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//if (dsProvincia.Tables[0].Rows.Count != 0)
|
|||
|
|
//{
|
|||
|
|
// ddlProvincia.DataSource = dsProvincia;
|
|||
|
|
// ddlProvincia.DataTextField = dsProvincia.Tables[0].Columns["NOMBREUBICACION"].ColumnName;
|
|||
|
|
// ddlProvincia.DataValueField = dsProvincia.Tables[0].Columns["PKUBICACION"].ColumnName;
|
|||
|
|
// ddlProvincia.DataBind();
|
|||
|
|
|
|||
|
|
|
|||
|
|
//}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R6M5", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[WebMethod]
|
|||
|
|
public static string llenarDDLProvincias() //M
|
|||
|
|
{
|
|||
|
|
List<UbicacionEL> lstInfoProvincias = new List<UbicacionEL>();
|
|||
|
|
JavaScriptSerializer _Json = new JavaScriptSerializer();
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//Instancia el objeto
|
|||
|
|
AyABL.ADM.UbicacionBL objUbicacionBL = new AyABL.ADM.UbicacionBL();
|
|||
|
|
objUbicacionBL.objUbicacionEL.PK = 0;
|
|||
|
|
objUbicacionBL.objUbicacionEL.Padre = -1;
|
|||
|
|
objUbicacionBL.objUbicacionEL.ASTATE = true;
|
|||
|
|
DataSet dsProvincia = objUbicacionBL.getUbicacion();
|
|||
|
|
|
|||
|
|
foreach (DataRow drProvincia in dsProvincia.Tables[0].Rows)
|
|||
|
|
{
|
|||
|
|
var infoProvincia = new UbicacionEL { PK = int.Parse(drProvincia["PKUBICACION"].ToString()), Nombre = drProvincia["NOMBREUBICACION"].ToString() };
|
|||
|
|
|
|||
|
|
lstInfoProvincias.Add(infoProvincia);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
//////MensajeError("Error en R6M", ex);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return _Json.Serialize(lstInfoProvincias);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void llenarGridObjetivos() //M6
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
objObjetivoEspecificoBL = new ObjetivoEspecificoBL();
|
|||
|
|
objObjetivoEspecificoBL.objObjetivoEspecificoEL.PK = 0;
|
|||
|
|
objObjetivoEspecificoBL.objObjetivoEspecificoEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
|||
|
|
DataSet dsObjetivos = objObjetivoEspecificoBL.getObjetivoEspecifico();
|
|||
|
|
|
|||
|
|
//detalleGRVDatos(dsObjetivos, grvObjetivosTemp);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R6M6", ex);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void llenarGridResultados() //M7
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
objResultadoBL = new ResultadoBL();
|
|||
|
|
objResultadoBL.objResultadoEL.PK = 0;
|
|||
|
|
objResultadoBL.objResultadoEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
|||
|
|
DataSet dsResultados = objResultadoBL.getResultados();
|
|||
|
|
|
|||
|
|
//detalleGRVDatos(dsResultados, grvResultadosTemp);
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R6M7", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
private void llenarDDLRegion() //M8
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//Limpia el control
|
|||
|
|
ddlRegion.Items.Clear();
|
|||
|
|
//Instancia el objeto
|
|||
|
|
objRegionBL = new RegionBL();
|
|||
|
|
objRegionBL.objRegionEL.PK = 0;
|
|||
|
|
objRegionBL.objRegionEL.Padre = 2;
|
|||
|
|
objRegionBL.objRegionEL.ASTATE = true;
|
|||
|
|
DataSet dsRegion = objRegionBL.getRegion();
|
|||
|
|
if (dsRegion.Tables[0].Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
ddlRegion.DataSource = dsRegion;
|
|||
|
|
ddlRegion.DataTextField = dsRegion.Tables[0].Columns["NOMBREREGION"].ColumnName;
|
|||
|
|
ddlRegion.DataValueField = dsRegion.Tables[0].Columns["PKREGION"].ColumnName;
|
|||
|
|
ddlRegion.DataBind();
|
|||
|
|
|
|||
|
|
ddlRegion.Items.Insert(0, new ListItem("Seleccione una Región", "-1"));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R6M8", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void llenarDDLAreaTematica() //M9
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//Limpia el control
|
|||
|
|
ddlAreaTematica.Items.Clear();
|
|||
|
|
//Instancia el objeto
|
|||
|
|
objCatalogoBL = new CatalogoBL();
|
|||
|
|
objCatalogoBL.objCatalogoEL.PK = 0;
|
|||
|
|
objCatalogoBL.objCatalogoEL.Padre = 4;
|
|||
|
|
objCatalogoBL.objCatalogoEL.ASTATE = true;
|
|||
|
|
DataSet dsAreaTematica = objCatalogoBL.getCatalogo();
|
|||
|
|
if (dsAreaTematica.Tables[0].Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
ddlAreaTematica.DataSource = dsAreaTematica;
|
|||
|
|
ddlAreaTematica.DataTextField = dsAreaTematica.Tables[0].Columns["NOMBRECATALOGO"].ColumnName;
|
|||
|
|
ddlAreaTematica.DataValueField = dsAreaTematica.Tables[0].Columns["PKCATALOGO"].ColumnName;
|
|||
|
|
ddlAreaTematica.DataBind();
|
|||
|
|
|
|||
|
|
ddlAreaTematica.Items.Insert(0, new ListItem("Seleccione un AreaTematica", "-1"));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R6M9", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
private void llenarDDLSector() //M10
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//Limpia el control
|
|||
|
|
ddlSector.Items.Clear();
|
|||
|
|
|
|||
|
|
objCatalogoBL = new CatalogoBL();
|
|||
|
|
objCatalogoBL.objCatalogoEL.PK = 0;
|
|||
|
|
objCatalogoBL.objCatalogoEL.Padre = 1;
|
|||
|
|
objCatalogoBL.objCatalogoEL.ASTATE = true;
|
|||
|
|
DataSet dsSector = objCatalogoBL.getCatalogo();
|
|||
|
|
if (dsSector.Tables[0].Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
ddlSector.DataSource = dsSector;
|
|||
|
|
ddlSector.DataTextField = dsSector.Tables[0].Columns["NOMBRECATALOGO"].ColumnName;
|
|||
|
|
ddlSector.DataValueField = dsSector.Tables[0].Columns["PKCATALOGO"].ColumnName;
|
|||
|
|
ddlSector.DataBind();
|
|||
|
|
|
|||
|
|
ddlSector.Items.Insert(0, new ListItem("Seleccione un Sector", "-1"));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R6M10", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void llenarDDLInfluencia() //M11
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
//Limpia el control
|
|||
|
|
ddlInfluencia.Items.Clear();
|
|||
|
|
|
|||
|
|
objCatalogoBL = new CatalogoBL();
|
|||
|
|
objCatalogoBL.objCatalogoEL.PK = 0;
|
|||
|
|
objCatalogoBL.objCatalogoEL.Padre = 43;
|
|||
|
|
objCatalogoBL.objCatalogoEL.ASTATE = true;
|
|||
|
|
DataSet dsInfluencia = objCatalogoBL.getCatalogo();
|
|||
|
|
if (dsInfluencia.Tables[0].Rows.Count != 0)
|
|||
|
|
{
|
|||
|
|
ddlInfluencia.DataSource = dsInfluencia;
|
|||
|
|
ddlInfluencia.DataTextField = dsInfluencia.Tables[0].Columns["NOMBRECATALOGO"].ColumnName;
|
|||
|
|
ddlInfluencia.DataValueField = dsInfluencia.Tables[0].Columns["PKCATALOGO"].ColumnName;
|
|||
|
|
ddlInfluencia.DataBind();
|
|||
|
|
|
|||
|
|
//ddlInfluencia.Items.Insert(0, new ListItem("Seleccione la Influencia del Proyecto", "-1"));
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
////MensajeError("Error en R6M11", ex);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
#endregion
|
|||
|
|
}
|