1743 lines
No EOL
70 KiB
C#
1743 lines
No EOL
70 KiB
C#
/*===========================================================================================================================
|
||
* Instituto Costarricense de Acueductos y Alcantarillados. - 2016
|
||
* Formularios para Proyectos de Inversión
|
||
* Nombre de la Pantalla: frwFicha.aspx
|
||
*
|
||
* Explicación de los contenidos del archivo
|
||
*===========================================================================================================================
|
||
* HISTORIAL
|
||
*
|
||
* PERSONA DIA – MES - AÑO DESCRIPCIÓN
|
||
* Esteban Gutierrez Rapso 17 – 02 - 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 AyADAL;
|
||
using AyABL.RCS;
|
||
using AyABL.ADM;
|
||
using AyABL.AGP;
|
||
using AyABL.CVP;
|
||
using AyABL.FNP;
|
||
using AyABL.PPP;
|
||
using AyABL.RHP;
|
||
using AyABL.EVP;
|
||
using AyABL.ICP;
|
||
using AyABL.IGP;
|
||
using AyABL.CIP;
|
||
|
||
public partial class webforms_AGP_wfrFicha : 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);
|
||
|
||
Javascript.CheckAllGridViewItems(Page);
|
||
|
||
//*******AGP************
|
||
construirgrvObjetivos();
|
||
construirgrvResultados();
|
||
|
||
//*******CVP************
|
||
construirgrvEtapas();
|
||
|
||
//*******FNP************
|
||
construirgrvPIRecursosI();
|
||
construirgrvPIRecursosE();
|
||
|
||
construirgrvEIRecursosI();
|
||
construirgrvEIRecursosE();
|
||
|
||
construirgrvEndeudamiento();
|
||
|
||
//*******PPP************
|
||
construirgrvPartidas();
|
||
|
||
//*******RHP************
|
||
|
||
|
||
//*******EVP************
|
||
|
||
|
||
//*******ICP************
|
||
construirgrvObservaciones();
|
||
|
||
//*******IGP************
|
||
construirgrvRelacionPE();
|
||
construirgrvCentroGestor();
|
||
construirgrvTipoCambio();
|
||
|
||
//*******CIP************
|
||
|
||
construirgrvObjCumplidos();
|
||
construirgrvObjNoCumplidos();
|
||
construirgrvLeccion();
|
||
construirgrvComentario();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R0M1", ex);
|
||
}
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Variables (R1)
|
||
|
||
DependenciaBL objDependenciaBL;
|
||
|
||
GridView grvObjetivosTemp, grvResultadosTemp, grvEtapasTemp, grvPIRecursosITemp, grvPIRecursosETemp, grvEIRecursosITemp, grvEIRecursosETemp, grvEndeudamientoTemp, grvPartidasTemp, grvObservacionesTemp,
|
||
grvRelacionPETemp, grvCentroGestorTemp, grvTipoCambioTemp, grvComentarioTemp, grvLeccionTemp, grvObjCumplidosTemp, grvObjNoCumplidosTemp;
|
||
|
||
//*****************AGP***********************
|
||
ProyectoBL objProyectoBL;
|
||
ObjetivoEspecificoBL objObjetivoEspecificoBL;
|
||
ResultadoBL objResultadoBL;
|
||
|
||
//*****************CVP***********************
|
||
CicloVidaBL objCicloVidaBL;
|
||
EtapaBL objEtapaBL;
|
||
|
||
//*****************FNP***********************
|
||
FinanciamientoBL objFinanciamientoBL;
|
||
EndeudamientoBL objEndeudamientoBL;
|
||
|
||
//*****************PPP***********************
|
||
DistribucionPartidaBL objDistribucionPartidaBL;
|
||
|
||
//*****************RHP***********************
|
||
|
||
RequerimientoRecursoBL objRequerimientoRecursoBL;
|
||
|
||
//*****************EVP***********************
|
||
AnalisisRiesgoBL objAnalisisRiesgoBL;
|
||
AnalisisAmbientalBL objAnalisisAmbientalBL;
|
||
EvaluacionFinancieraBL objEvaluacionFinancieraBL;
|
||
EvaluacionCostosBL objEvaluacionCostosBL;
|
||
EvaluacionSocialBL objEvaluacionSocialBL;
|
||
|
||
//*****************ICP***********************
|
||
InformacionBL objInformacionBL;
|
||
ObservacionBL objObservacionBL;
|
||
|
||
//*****************IGP***********************
|
||
|
||
InformacionGeneralBL objInformacionGeneralBL;
|
||
RelacionPlanEstrategicoBL objRelacionPlanEstrategicoBL;
|
||
CentroGestorBL objCentroGestorBL;
|
||
TipoCambioBL objTipoCambioBL;
|
||
|
||
//*****************CIP***********************
|
||
LeccionBL objLeccionBL;
|
||
ComentarioBL objComentarioBL;
|
||
CierreBL objCierreBL;
|
||
|
||
|
||
#endregion
|
||
|
||
#region Eventos Formulario (R2)
|
||
|
||
protected void Page_Load(object sender, EventArgs e) //M0
|
||
{
|
||
try
|
||
{
|
||
if ((!IsPostBack) && (Session.Count > 0))
|
||
{
|
||
|
||
llenarDDLProyecto();
|
||
|
||
if (Session["PKPROYECTO"] != null)
|
||
{
|
||
ddlProyecto.SelectedValue = Session["PKPROYECTO"].ToString();
|
||
|
||
ddlProyecto_SelectedIndexChanged(null, null);
|
||
}
|
||
|
||
mostrarDatos();
|
||
|
||
ComandosxMenu();
|
||
|
||
//Para que aparezca el listado de Dependencias para reasignar el proyecto
|
||
if (Session["ROL"].ToString() == "Administrador Formularios" || Session["ROL"].ToString() == "ADMINISTRADOR")
|
||
divDependencia.Visible = true;
|
||
|
||
|
||
llenarDDLDependenciaReasignar();
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R2M0", ex);
|
||
}
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Eventos Controles Web (R3)
|
||
|
||
protected void ddlProyecto_SelectedIndexChanged(object sender, EventArgs e) //M0
|
||
{
|
||
try
|
||
{
|
||
Session["PKPROYECTO"] = ddlProyecto.SelectedValue;
|
||
mostrarDatos();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M0", ex);
|
||
}
|
||
}
|
||
|
||
protected void btnAprobar_Click(object sender, EventArgs e) //M1
|
||
{
|
||
try
|
||
{
|
||
if (aprobarProyecto())
|
||
{
|
||
MensajeInformativo("El proyecto fue aprobado exitosamente por " + Session["NOMBRE"].ToString());
|
||
}
|
||
else
|
||
{
|
||
MensajeError("El proyecto no pudo ser aprobado de forma exitosa, verifique", null);
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M1", ex);
|
||
}
|
||
}
|
||
|
||
protected void btnImprimir_Click(object sender, EventArgs e) //M2
|
||
{
|
||
try
|
||
{
|
||
Reporte();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M2", ex);
|
||
}
|
||
}
|
||
|
||
protected void ddlDependencia_SelectedIndexChanged(object sender, EventArgs e) //M3
|
||
{
|
||
try
|
||
{
|
||
objProyectoBL = new ProyectoBL();
|
||
|
||
objProyectoBL.objProyectoEL.PK = Int32.Parse(ddlProyecto.SelectedValue);
|
||
objProyectoBL.objProyectoEL.CodigoAcceso = ddlDependencia.SelectedValue;
|
||
objProyectoBL.actualizaDependenciaProyecto();
|
||
|
||
MensajeInformativo("Ha reasignado el Proyecto " + txtProyecto.Text + " a la dependencia " + ddlDependencia.SelectedItem.Text);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M0", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
#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 "APROBAR OFICINA":
|
||
ViewState["Oficina"] = 1;
|
||
ViewState["SubGerencia"] = 0;
|
||
ViewState["Planificacion"] = 0;
|
||
btnAprobar.Visible = true;
|
||
break;
|
||
case "APROBAR SUBGERENCIA":
|
||
ViewState["Oficina"] = 0;
|
||
ViewState["SubGerencia"] = 1;
|
||
ViewState["Planificacion"] = 0;
|
||
btnAprobar.Visible = true;
|
||
break;
|
||
case "APROBAR PLANIFICACION":
|
||
ViewState["Oficina"] = 0;
|
||
ViewState["SubGerencia"] = 0;
|
||
ViewState["Planificacion"] = 1;
|
||
btnAprobar.Visible = true;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M0", ex);
|
||
}
|
||
}
|
||
|
||
//*****************AGP***********************
|
||
|
||
private void construirgrvObjetivos() //M1
|
||
{
|
||
try
|
||
{
|
||
grvObjetivosTemp = (GridView)Tab.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 = 15;
|
||
grvObjetivosTemp.Columns[2].ItemStyle.Width = 100;
|
||
grvObjetivosTemp.Columns[3].ItemStyle.Width = 20;
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M1", ex);
|
||
}
|
||
}
|
||
|
||
private void construirgrvResultados() //M2
|
||
{
|
||
try
|
||
{
|
||
grvResultadosTemp = (GridView)Tab.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 = 15;
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M2", ex);
|
||
}
|
||
}
|
||
|
||
//*****************CVP***********************
|
||
|
||
private void construirgrvEtapas() //M3
|
||
{
|
||
try
|
||
{
|
||
grvEtapasTemp = (GridView)Tab.FindControl("grvEtapas");
|
||
|
||
GridViewBoundField bdfPkEtapa = new GridViewBoundField("PKETAPA", "PK", false, false, false);
|
||
GridViewBoundField bdfEtapa = new GridViewBoundField("ETAPA", "ETAPA", false, false, true);
|
||
GridViewBoundField bdfInicio = new GridViewBoundField("FECHAINICIOETAPA", "INICIA", false, true, true);
|
||
GridViewBoundField bdfConclusion = new GridViewBoundField("FECHAFINETAPA", "CONCLUYE", false, true, true);
|
||
GridViewBoundField bdfSituacion = new GridViewBoundField("SITUACION", "SITUACION ACTUAL", false, false, true);
|
||
|
||
grvEtapasTemp.Columns.Add(bdfPkEtapa);
|
||
grvEtapasTemp.Columns.Add(bdfEtapa);
|
||
grvEtapasTemp.Columns.Add(bdfInicio);
|
||
grvEtapasTemp.Columns.Add(bdfConclusion);
|
||
grvEtapasTemp.Columns.Add(bdfSituacion);
|
||
|
||
grvEtapasTemp.Columns[0].ItemStyle.Width = 25;
|
||
grvEtapasTemp.Columns[1].ItemStyle.Width = 25;
|
||
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M1", ex);
|
||
}
|
||
}
|
||
|
||
//*****************FNP***********************
|
||
|
||
private void construirgrvPIRecursosI() //M4
|
||
{
|
||
try
|
||
{
|
||
grvPIRecursosITemp = (GridView)Tab.FindControl("grvPIRecursosRI");
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M4", ex);
|
||
}
|
||
}
|
||
|
||
private void construirgrvPIRecursosE() //M5
|
||
{
|
||
try
|
||
{
|
||
grvPIRecursosETemp = (GridView)Tab.FindControl("grvPIRecursosE");
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M5", ex);
|
||
}
|
||
}
|
||
|
||
private void construirgrvEIRecursosI() //M6
|
||
{
|
||
try
|
||
{
|
||
grvEIRecursosITemp = (GridView)Tab.FindControl("grvEIRecursosI");
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M5", ex);
|
||
}
|
||
}
|
||
|
||
private void construirgrvEIRecursosE() //M7
|
||
{
|
||
try
|
||
{
|
||
grvEIRecursosETemp = (GridView)Tab.FindControl("grvEIRecursosE");
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M7", ex);
|
||
}
|
||
}
|
||
|
||
private void construirgrvEndeudamiento() //M8
|
||
{
|
||
try
|
||
{
|
||
grvEndeudamientoTemp = (GridView)Tab.FindControl("grvEndeudamiento");
|
||
|
||
GridViewBoundField bdfPkEndeudamiento = new GridViewBoundField("PKENDEUDAMIENTO", "PK", false, false, false);
|
||
GridViewBoundField bdfFuenteFinanciamiento = new GridViewBoundField("NOMBREFUENTEFINANCIAMIENTO", "FUENTE", true, false, true);
|
||
GridViewBoundField bdfMonto = new GridViewBoundField("MONTOENDEUDAMIENTO", "MONTO", true, false, true);
|
||
GridViewBoundField bdfPeriodoGracia = new GridViewBoundField("PERIODOGRACIAENDEUDAMIENTO", "PERIODO GRACIA", true, false, true);
|
||
GridViewBoundField bdfPlazo = new GridViewBoundField("PLAZOENDEUDAMIENTO", "PLAZO", true, false, true);
|
||
GridViewBoundField bdfDesembolsoInicio = new GridViewBoundField("DESEMBOLSOINICIOENDEUDAMIENTO", "DESEMBOLSO INICIAL", true, false, true);
|
||
GridViewBoundField bdfDesembolsoFin = new GridViewBoundField("DESEMBOLSOFINENDEUDAMIENTO", "DESEMBOLSO FINAL", true, false, true);
|
||
GridViewBoundField bdfTipoCambio = new GridViewBoundField("TIPOCAMBIOCONTRATOENDEUDAMIENTO", "TIPO CAMBIO", true, false, true);
|
||
GridViewBoundField bdfFechaContrato = new GridViewBoundField("FECHACONTRATOENDEUDAMIENTO", "FECHA DE CONTRATO", true, true, true);
|
||
GridViewBoundField bdfSituacionActual = new GridViewBoundField("SITUACIONACTUALENDEUDAMIENTO", "SITUACION ACTUAL", true, false, true);
|
||
GridViewBoundField bdfTasa = new GridViewBoundField("TASAENDEUDAMIENTO", "TASA INTERES", true, false, true);
|
||
|
||
grvEndeudamientoTemp.Columns.Add(bdfPkEndeudamiento);
|
||
grvEndeudamientoTemp.Columns.Add(bdfFuenteFinanciamiento);
|
||
grvEndeudamientoTemp.Columns.Add(bdfMonto);
|
||
grvEndeudamientoTemp.Columns.Add(bdfPeriodoGracia);
|
||
grvEndeudamientoTemp.Columns.Add(bdfPlazo);
|
||
grvEndeudamientoTemp.Columns.Add(bdfDesembolsoInicio);
|
||
grvEndeudamientoTemp.Columns.Add(bdfDesembolsoFin);
|
||
grvEndeudamientoTemp.Columns.Add(bdfTipoCambio);
|
||
grvEndeudamientoTemp.Columns.Add(bdfFechaContrato);
|
||
grvEndeudamientoTemp.Columns.Add(bdfSituacionActual);
|
||
grvEndeudamientoTemp.Columns.Add(bdfTasa);
|
||
|
||
grvEndeudamientoTemp.Columns[0].ItemStyle.Width = 25;
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M8", ex);
|
||
}
|
||
}
|
||
|
||
//*****************PPP***********************
|
||
|
||
private void construirgrvPartidas() //M9
|
||
{
|
||
try
|
||
{
|
||
grvPartidasTemp = (GridView)Tab.FindControl("grvPartidas");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M9", ex);
|
||
}
|
||
}
|
||
|
||
//*****************RHP***********************
|
||
|
||
|
||
//*****************EVP***********************
|
||
|
||
|
||
//*****************ICP***********************
|
||
|
||
private void construirgrvObservaciones() //M10
|
||
{
|
||
try
|
||
{
|
||
grvObservacionesTemp = (GridView)Tab.FindControl("grvObservaciones");
|
||
|
||
GridViewBoundField bdfPkObservacion = new GridViewBoundField("PKOBSERVACION", "PK", false, false, false);
|
||
GridViewBoundField bdfFecha = new GridViewBoundField("FECHAINGRESOOBSERVACION", "FECHA", true, true, true);
|
||
GridViewBoundField bdfDescripcion = new GridViewBoundField("DESCRIPCIONOBSERVACION", "OBSERVACION", true, false, true);
|
||
|
||
grvObservacionesTemp.Columns.Add(bdfPkObservacion);
|
||
grvObservacionesTemp.Columns.Add(bdfFecha);
|
||
grvObservacionesTemp.Columns.Add(bdfDescripcion);
|
||
|
||
grvObservacionesTemp.Columns[1].ItemStyle.Width = 70;
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M10", ex);
|
||
}
|
||
}
|
||
|
||
//*****************IGP***********************
|
||
|
||
private void construirgrvRelacionPE() //M11
|
||
{
|
||
try
|
||
{
|
||
grvRelacionPETemp = (GridView)Tab.FindControl("grvRelacionPE");
|
||
|
||
GridViewBoundField bdfPkRelacionPE = new GridViewBoundField("PKRELACIONPLANESTRATEGICO", "PK", false, false, false);
|
||
GridViewBoundField bdfTemaEstrategico = new GridViewBoundField("NOMBRETEMAESTRATEGICO", "TEMA ESTRATEGICO", false, false, true);
|
||
GridViewBoundField bdfPerspectiva = new GridViewBoundField("NOMBREPERSPECTIVA", "PERSPECTIVA", true, false, true);
|
||
GridViewBoundField bdfCodigo = new GridViewBoundField("CODIGOPERSPECTIVA", "CODIGO", true, false, true);
|
||
GridViewBoundField bdfObjetivo = new GridViewBoundField("DESCRIPCIONOBJETIVO", "OBJETIVO", true, false, true);
|
||
GridViewBoundField bdfMeta = new GridViewBoundField("METAOBJETIVO", "META", true, false, true);
|
||
GridViewBoundField bdfContribucion = new GridViewBoundField("NOMBRECATALOGO", "CONTRIBUCION", false, false, true);
|
||
|
||
grvRelacionPETemp.Columns.Add(bdfPkRelacionPE);
|
||
grvRelacionPETemp.Columns.Add(bdfTemaEstrategico);
|
||
grvRelacionPETemp.Columns.Add(bdfPerspectiva);
|
||
grvRelacionPETemp.Columns.Add(bdfCodigo);
|
||
grvRelacionPETemp.Columns.Add(bdfObjetivo);
|
||
grvRelacionPETemp.Columns.Add(bdfMeta);
|
||
grvRelacionPETemp.Columns.Add(bdfContribucion);
|
||
|
||
grvRelacionPETemp.Columns[0].ItemStyle.Width = 25;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M10", ex);
|
||
}
|
||
}
|
||
|
||
private void construirgrvCentroGestor() //M12
|
||
{
|
||
try
|
||
{
|
||
grvCentroGestorTemp = (GridView)Tab.FindControl("grvCentroGestor");
|
||
|
||
GridViewBoundField bdfPkCentroGestor = new GridViewBoundField("PKCENTROGESTOR", "PK", false, false, false);
|
||
GridViewBoundField bdfProcedencia = new GridViewBoundField("NOMBREPROCEDENCIACENTROGESTOR", "", false, false, true);
|
||
GridViewBoundField bdfPreinversion = new GridViewBoundField("PREINVERSIONCENTROGESTOR", "PREINVERSION", true, false, true);
|
||
GridViewBoundField bdfEjecucion = new GridViewBoundField("EJECUCIONCENTROGESTOR", "EJECUCION", true, false, true);
|
||
|
||
grvCentroGestorTemp.Columns.Add(bdfPkCentroGestor);
|
||
grvCentroGestorTemp.Columns.Add(bdfProcedencia);
|
||
grvCentroGestorTemp.Columns.Add(bdfPreinversion);
|
||
grvCentroGestorTemp.Columns.Add(bdfEjecucion);
|
||
|
||
grvCentroGestorTemp.Columns[0].ItemStyle.Width = 25;
|
||
grvCentroGestorTemp.Columns[2].ItemStyle.HorizontalAlign = HorizontalAlign.Center;
|
||
grvCentroGestorTemp.Columns[3].ItemStyle.HorizontalAlign = HorizontalAlign.Center;
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M12", ex);
|
||
}
|
||
}
|
||
|
||
private void construirgrvTipoCambio() //M13
|
||
{
|
||
try
|
||
{
|
||
grvTipoCambioTemp = (GridView)Tab.FindControl("grvTipoCambio");
|
||
|
||
GridViewBoundField bdfPkTipoCambio = new GridViewBoundField("PKTIPOCAMBIO", "PK", false, false, false);
|
||
GridViewBoundField bdfMoneda = new GridViewBoundField("MONEDATIPOCAMBIO", "MONEDA", false, false, true);
|
||
GridViewBoundField bdfAnio = new GridViewBoundField("ANIOTIPOCAMBIO", "AÑO", true, false, true);
|
||
GridViewBoundField bdfMonto = new GridViewBoundField("MONTOTIPOCAMBIO", "MONTO", true, false, true);
|
||
|
||
grvTipoCambioTemp.Columns.Add(bdfPkTipoCambio);
|
||
grvTipoCambioTemp.Columns.Add(bdfMoneda);
|
||
grvTipoCambioTemp.Columns.Add(bdfAnio);
|
||
grvTipoCambioTemp.Columns.Add(bdfMonto);
|
||
|
||
grvTipoCambioTemp.Columns[0].ItemStyle.Width = 25;
|
||
grvTipoCambioTemp.Columns[2].ItemStyle.HorizontalAlign = HorizontalAlign.Center;
|
||
grvTipoCambioTemp.Columns[3].ItemStyle.HorizontalAlign = HorizontalAlign.Right;
|
||
|
||
bdfMonto.DataFormatString = "{0:N2}";
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M13", ex);
|
||
}
|
||
}
|
||
|
||
|
||
//*****************CIP***********************
|
||
|
||
private void construirgrvComentario() //M14
|
||
{
|
||
try
|
||
{
|
||
grvComentarioTemp = (GridView)Tab.FindControl("grvComentario");
|
||
|
||
GridViewBoundField bdfPkComentario = new GridViewBoundField("PKCOMENTARIO", "PK", false, false, false);
|
||
GridViewBoundField bdfEvento = new GridViewBoundField("FECHAINGRESOCOMENTARIO", "FECHA", true, true, true);
|
||
GridViewBoundField bdfDescripcion = new GridViewBoundField("COMENTARIO", "COMENTARIO", true, false, true);
|
||
|
||
grvComentarioTemp.Columns.Add(bdfPkComentario);
|
||
grvComentarioTemp.Columns.Add(bdfEvento);
|
||
grvComentarioTemp.Columns.Add(bdfDescripcion);
|
||
|
||
grvComentarioTemp.Columns[0].ItemStyle.Width = 25;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M14", ex);
|
||
}
|
||
}
|
||
|
||
private void construirgrvLeccion() //M15
|
||
{
|
||
try
|
||
{
|
||
grvLeccionTemp = (GridView)Tab.FindControl("grvLeccion");
|
||
|
||
GridViewBoundField bdfPkLeccion = new GridViewBoundField("PKLECCION", "PK", false, false, false);
|
||
GridViewBoundField bdfEvento = new GridViewBoundField("EVENTOLECCION", "EVENTO", true, false, true);
|
||
GridViewBoundField bdfDescripcion = new GridViewBoundField("DESCRIPCIONLECCION", "DESCRIPCION", true, false, true);
|
||
|
||
grvLeccionTemp.Columns.Add(bdfPkLeccion);
|
||
grvLeccionTemp.Columns.Add(bdfEvento);
|
||
grvLeccionTemp.Columns.Add(bdfDescripcion);
|
||
|
||
grvLeccionTemp.Columns[0].ItemStyle.Width = 25;
|
||
grvLeccionTemp.Columns[1].ItemStyle.Width = 25;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M15", ex);
|
||
}
|
||
}
|
||
|
||
private void construirgrvObjCumplidos() //M16
|
||
{
|
||
try
|
||
{
|
||
grvObjCumplidosTemp = (GridView)Tab.FindControl("grvObjCumplidos");
|
||
|
||
GridViewBoundField bdfPkObjetivo = new GridViewBoundField("PKOBJETIVOESPECIFICO", "PK", false, false, false);
|
||
GridViewBoundField bdfNumero = new GridViewBoundField("NUMEROOBJETIVOESPECIFICO", "#", true, false, true);
|
||
GridViewBoundField bdfDescripcion = new GridViewBoundField("DESCRIPCIONOBJETIVOESPECIFICO", "OBJETIVO", true, false, true);
|
||
|
||
grvObjCumplidosTemp.Columns.Add(bdfPkObjetivo);
|
||
grvObjCumplidosTemp.Columns.Add(bdfNumero);
|
||
grvObjCumplidosTemp.Columns.Add(bdfDescripcion);
|
||
|
||
grvObjCumplidosTemp.Columns[0].ItemStyle.Width = 25;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M16", ex);
|
||
}
|
||
}
|
||
|
||
private void construirgrvObjNoCumplidos() //M17
|
||
{
|
||
try
|
||
{
|
||
grvObjNoCumplidosTemp = (GridView)Tab.FindControl("grvObjNoCumplidos");
|
||
|
||
GridViewBoundField bdfPkObjetivo = new GridViewBoundField("PKOBJETIVOESPECIFICO", "PK", false, false, false);
|
||
GridViewBoundField bdfNumero = new GridViewBoundField("NUMEROOBJETIVOESPECIFICO", "#", true, false, true);
|
||
GridViewBoundField bdfDescripcion = new GridViewBoundField("DESCRIPCIONOBJETIVOESPECIFICO", "OBJETIVO", true, false, true);
|
||
|
||
grvObjNoCumplidosTemp.Columns.Add(bdfPkObjetivo);
|
||
grvObjNoCumplidosTemp.Columns.Add(bdfNumero);
|
||
grvObjNoCumplidosTemp.Columns.Add(bdfDescripcion);
|
||
|
||
grvObjNoCumplidosTemp.Columns[0].ItemStyle.Width = 25;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M17", ex);
|
||
}
|
||
}
|
||
|
||
//*******************************************
|
||
|
||
private void aprobacionProyecto(DataSet p_dsVistosBuenos) //M18
|
||
{
|
||
lblOficina.Visible = false;
|
||
lblSubGerencia.Visible = false;
|
||
lblPlanificacion.Visible = false;
|
||
lblMensaje.Visible = false;
|
||
|
||
//Dependenciendo del visto bueno
|
||
if (bool.Parse(p_dsVistosBuenos.Tables[0].Rows[0]["VISTOBUENOOFICINAPROYECTO"].ToString()) == true)
|
||
lblOficina.Visible = true;
|
||
else
|
||
lblOficina.Visible = false;
|
||
|
||
if (bool.Parse(p_dsVistosBuenos.Tables[0].Rows[0]["VISTOBUENOSUBGERENCIAPROYECTO"].ToString()) == true)
|
||
lblSubGerencia.Visible = true;
|
||
else
|
||
lblSubGerencia.Visible = false;
|
||
|
||
if (bool.Parse(p_dsVistosBuenos.Tables[0].Rows[0]["VISTOBUENOPLANIFICACIONPROYECTO"].ToString()) == true)
|
||
lblPlanificacion.Visible = true;
|
||
else
|
||
lblPlanificacion.Visible = false;
|
||
//Si no tiene vistos buenos
|
||
if (bool.Parse(p_dsVistosBuenos.Tables[0].Rows[0]["VISTOBUENOOFICINAPROYECTO"].ToString()) == false && bool.Parse(p_dsVistosBuenos.Tables[0].Rows[0]["VISTOBUENOSUBGERENCIAPROYECTO"].ToString()) == false &&
|
||
bool.Parse(p_dsVistosBuenos.Tables[0].Rows[0]["VISTOBUENOPLANIFICACIONPROYECTO"].ToString()) == false)
|
||
lblMensaje.Visible = true;
|
||
else
|
||
lblMensaje.Visible = false;
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Metodos Controles a Datos (R5)
|
||
|
||
private bool aprobarProyecto() //M0
|
||
{
|
||
bool blnAprobado = false;
|
||
|
||
try
|
||
{
|
||
objProyectoBL = new ProyectoBL();
|
||
objProyectoBL.objProyectoEL.PK = Int32.Parse(ddlProyecto.SelectedValue);
|
||
|
||
|
||
//objProyectoBL.objProyectoEL.VistoBuenoOficina = false;
|
||
//objProyectoBL.objProyectoEL.VistoBuenoSubGerencia = false;
|
||
//objProyectoBL.objProyectoEL.VistoBuenoPlanificacion = false;
|
||
|
||
if (Int32.Parse(ViewState["Oficina"].ToString()) == 1)
|
||
{
|
||
objProyectoBL.objProyectoEL.VistoBuenoOficina = true;
|
||
}
|
||
|
||
if (Int32.Parse(ViewState["SubGerencia"].ToString()) == 1)
|
||
{
|
||
objProyectoBL.objProyectoEL.VistoBuenoSubGerencia = true;
|
||
}
|
||
|
||
if (Int32.Parse(ViewState["Planificacion"].ToString()) == 1)
|
||
{
|
||
objProyectoBL.objProyectoEL.VistoBuenoPlanificacion = true;
|
||
}
|
||
|
||
//Se actualiza el registro
|
||
objProyectoBL.actualizarAprobacionProyecto();
|
||
|
||
//Se actualiza el cuadro de aprobaciones
|
||
DataSet dsProyecto = objProyectoBL.getFichaProyecto();
|
||
if (dsProyecto.Tables[0].Rows.Count > 0)
|
||
{
|
||
aprobacionProyecto(dsProyecto);
|
||
}
|
||
|
||
blnAprobado = true;
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R5M0", ex);
|
||
}
|
||
|
||
return blnAprobado;
|
||
}
|
||
|
||
private void Reporte() //M1
|
||
{
|
||
Session["PKPROYECTO"] = ddlProyecto.SelectedValue;
|
||
Response.Redirect("/webforms/AGP/wfrReporte.aspx");
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Metodos Datos a Controles (R6)
|
||
|
||
private void llenarDDLProyecto() //M0
|
||
{
|
||
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();
|
||
|
||
ddlListaProyectos(dsProyecto, ddlProyecto);
|
||
ddlProyecto.Attributes["style"] = "width: 90%; max-width: 90%";
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M0", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void mostrarDatos() //M1
|
||
{
|
||
try
|
||
{
|
||
hdfPKInformacion.Value = "-1";
|
||
|
||
mostrarAGP();
|
||
|
||
mostrarCVP();
|
||
|
||
llenarGRVPIRecursosI();
|
||
|
||
llenarGRVPIRecursosE();
|
||
|
||
llenarGRVEIRecursosI();
|
||
|
||
llenarGRVEIRecursosE();
|
||
|
||
llenarGRVEndeudamiento();
|
||
|
||
llenarGRVPartida();
|
||
|
||
mostrarRecurso();
|
||
|
||
mostrarEvaluacion();
|
||
|
||
mostrarInformacionComplementaria();
|
||
|
||
llenarGRVObservaciones();
|
||
|
||
mostrarInformacionGeneral();
|
||
|
||
llenarGRVRelacionPE();
|
||
|
||
llenarGRVCentrosGestor();
|
||
|
||
llenarGRVTipoCambio();
|
||
|
||
mostrarCierre();
|
||
|
||
llenarGRVObjCumplidos();
|
||
|
||
llenarGRVObjNoCumplidos();
|
||
|
||
llenarGRVLeccion();
|
||
|
||
llenarGRVComentario();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M1", ex);
|
||
}
|
||
}
|
||
|
||
//***************************************************** AGP ********************************************
|
||
|
||
private void mostrarAGP() //M2
|
||
{
|
||
try
|
||
{
|
||
objProyectoBL = new ProyectoBL();
|
||
objProyectoBL.objProyectoEL.PK = Int32.Parse(ddlProyecto.SelectedValue);
|
||
DataSet dsProyecto = objProyectoBL.getFichaProyecto();
|
||
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();
|
||
txtPrioridad.Text = dsProyecto.Tables[0].Rows[0]["PRIORIDAD"].ToString();
|
||
txtDescripcion.Text = dsProyecto.Tables[0].Rows[0]["DESCRIPCIONPROYECTO"].ToString();
|
||
txtAreaTematica.Text = dsProyecto.Tables[0].Rows[0]["AREATEMATICA"].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();
|
||
txtDependencia.Text = dsProyecto.Tables[0].Rows[0]["NOMBREDEPENDENCIA"].ToString();
|
||
txtCategoria.Text = dsProyecto.Tables[0].Rows[0]["CATEGORIA"].ToString();
|
||
txtProvincia.Text = dsProyecto.Tables[0].Rows[0]["NOMBREUBICACION"].ToString();
|
||
txtSector.Text = dsProyecto.Tables[0].Rows[0]["SECTOR"].ToString();
|
||
txtCanton.Text = dsProyecto.Tables[0].Rows[0]["CANTONPROYECTO"].ToString();
|
||
txtDistrito.Text = dsProyecto.Tables[0].Rows[0]["DISTRITOPROYECTO"].ToString();
|
||
txtRegion.Text = dsProyecto.Tables[0].Rows[0]["NOMBREREGION"].ToString();
|
||
ddlDependencia.SelectedValue = dsProyecto.Tables[0].Rows[0]["CODIGOACCESOPROYECTO"].ToString();
|
||
|
||
aprobacionProyecto(dsProyecto);
|
||
|
||
//MOSTRAR OBJETIVOS Y RESULTADOS
|
||
llenarGridObjetivos();
|
||
|
||
llenarGridResultados();
|
||
}
|
||
|
||
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
MensajeError("Error en R6M2", ex);
|
||
|
||
}
|
||
}
|
||
|
||
private void llenarGridObjetivos() //M3
|
||
{
|
||
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 R6M3", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
|
||
}
|
||
|
||
private void llenarGridResultados() //M4
|
||
{
|
||
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 R6M4", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
//***************************************************** CVP ********************************************
|
||
|
||
private int mostrarCVP() //M5
|
||
{
|
||
int intValorRetornado = 0;
|
||
|
||
try
|
||
{
|
||
objCicloVidaBL = new CicloVidaBL();
|
||
objCicloVidaBL.objCicloVidaEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
DataSet dsCicloVida = objCicloVidaBL.getFichaCicloVida();
|
||
if (dsCicloVida.Tables[0].Rows.Count > 0)
|
||
{
|
||
txtEtapaActual.Text = dsCicloVida.Tables[0].Rows[0]["ETAPAACTUAL"].ToString();
|
||
txtAvanceEtapa.Text = Decimal.Parse(dsCicloVida.Tables[0].Rows[0]["PORCENTAJECICLOVIDA"].ToString()).ToString("###.#0"); ;
|
||
txtMontoEtapa.Text = Decimal.Parse(dsCicloVida.Tables[0].Rows[0]["MONTOCICLOVIDA"].ToString()).ToString("###,###,###.#0");
|
||
//txtEtapaAnterior.Text = dsCicloVida.Tables[0].Rows[0]["ETAPAANTERIOR"].ToString();
|
||
//txtFechaAprobacionAnterior.Text = DateTime.Parse(dsCicloVida.Tables[0].Rows[0]["FECHAAPROBACIONCICLOVIDA"].ToString()).ToString("dd/MM/yyyy");
|
||
//txtFaseEjecucion1.Text = dsCicloVida.Tables[0].Rows[0]["FASEEJECUCION"].ToString();
|
||
//txtFaseEjecucion2.Text = dsCicloVida.Tables[0].Rows[0]["FASEEJECUCION"].ToString();
|
||
//txtEstudioFactibilidad.Text = dsCicloVida.Tables[0].Rows[0]["ESTUDIOFACTIBILIDAD"].ToString();
|
||
//txtFechaEstudioFactibilidad.Text = DateTime.Parse(dsCicloVida.Tables[0].Rows[0]["FECHAETAPAANTERIORCICLOVIDA"].ToString()).ToString("dd/MM/yyyy");
|
||
//txtEjecuta.Text = dsCicloVida.Tables[0].Rows[0]["EJECUTAPROYECTO"].ToString();
|
||
|
||
|
||
}
|
||
llenarGRVEtapa();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M0", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
|
||
return intValorRetornado;
|
||
}
|
||
|
||
private void llenarGRVEtapa() //M6
|
||
{
|
||
try
|
||
{
|
||
objEtapaBL = new EtapaBL();
|
||
objEtapaBL.objEtapaEL.Etapa = 0;
|
||
objEtapaBL.objEtapaEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
|
||
DataSet dsEtapas = objEtapaBL.getEtapa();
|
||
detalleGRVDatos(dsEtapas, grvEtapas);
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M6", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
|
||
//***************************************************** FNP ********************************************
|
||
|
||
private void llenarGRVPIRecursosI() //M7
|
||
{
|
||
string strTipoFinanciamiento = string.Empty;
|
||
string strTipoRecurso = string.Empty;
|
||
|
||
try
|
||
{
|
||
//Limpiar el datagrid
|
||
detalleGRVDatos(null, grvPIRecursosI);
|
||
|
||
objFinanciamientoBL = new FinanciamientoBL();
|
||
objFinanciamientoBL.objFinanciamientoEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
objFinanciamientoBL.objFinanciamientoEL.TipoFinanciamiento = "PI";
|
||
objFinanciamientoBL.objFinanciamientoEL.TipoRecurso = "RI";
|
||
|
||
DataSet dsRecursos = objFinanciamientoBL.getFinanciamiento();
|
||
|
||
if (dsRecursos.Tables.Count == 0)
|
||
dsRecursos.Tables.Add();
|
||
|
||
detalleGRVDatos(dsRecursos, grvPIRecursosI);
|
||
|
||
if (grvPIRecursosI.HeaderRow != null)
|
||
{
|
||
//Invisiviliza el titulo de la columna de la PK
|
||
grvPIRecursosI.HeaderRow.Cells[0].Visible = false;
|
||
|
||
for (int i = 0; i <= grvPIRecursosI.Rows.Count - 1; ++i)
|
||
{
|
||
grvPIRecursosI.Rows[i].Cells[0].Visible = false;
|
||
}
|
||
|
||
//Dar formato a las cifras por año
|
||
for (int i = 0; i <= grvPIRecursosI.Rows.Count - 1; ++i)
|
||
{
|
||
for (int j = 2; j <= grvPIRecursosI.Rows[i].Cells.Count - 1; ++j)
|
||
{
|
||
if (grvPIRecursosI.Rows[i].Cells[j].Text != "0.00")
|
||
grvPIRecursosI.Rows[i].Cells[j].Text = Decimal.Parse(grvPIRecursosI.Rows[i].Cells[j].Text).ToString("###,###,###,###.#0");
|
||
|
||
grvPIRecursosI.Rows[i].Cells[j].HorizontalAlign = HorizontalAlign.Right;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M7", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarGRVPIRecursosE() //M8
|
||
{
|
||
string strTipoFinanciamiento = string.Empty;
|
||
string strTipoRecurso = string.Empty;
|
||
|
||
try
|
||
{
|
||
//Limpiar el datagrid
|
||
//detalleGRVDatos(null, grvPIRecursosE);
|
||
|
||
objFinanciamientoBL = new FinanciamientoBL();
|
||
objFinanciamientoBL.objFinanciamientoEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
objFinanciamientoBL.objFinanciamientoEL.TipoFinanciamiento = "PI";
|
||
objFinanciamientoBL.objFinanciamientoEL.TipoRecurso = "RE";
|
||
|
||
DataSet dsRecursos = objFinanciamientoBL.getFinanciamiento();
|
||
|
||
if (dsRecursos.Tables.Count == 0)
|
||
dsRecursos.Tables.Add();
|
||
|
||
detalleGRVDatos(dsRecursos, grvPIRecursosE);
|
||
|
||
if (grvPIRecursosE.HeaderRow != null)
|
||
{
|
||
//Invisiviliza el titulo de la columna de la PK
|
||
grvPIRecursosE.HeaderRow.Cells[0].Visible = false;
|
||
|
||
//Invisibiliza la columna de PK
|
||
for (int i = 0; i <= grvPIRecursosE.Rows.Count - 1; ++i)
|
||
{
|
||
grvPIRecursosE.Rows[i].Cells[0].Visible = false;
|
||
}
|
||
|
||
//Dar formato a las cifras por año
|
||
for (int i = 0; i <= grvPIRecursosE.Rows.Count - 1; ++i)
|
||
{
|
||
for (int j = 2; j <= grvPIRecursosE.Rows[i].Cells.Count - 1; ++j)
|
||
{
|
||
if (grvPIRecursosE.Rows[i].Cells[j].Text != "0.00")
|
||
grvPIRecursosE.Rows[i].Cells[j].Text = Decimal.Parse(grvPIRecursosE.Rows[i].Cells[j].Text).ToString("###,###,###,###.#0");
|
||
grvPIRecursosE.Rows[i].Cells[j].HorizontalAlign = HorizontalAlign.Right;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M8", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarGRVEIRecursosI() //M9
|
||
{
|
||
string strTipoFinanciamiento = string.Empty;
|
||
string strTipoRecurso = string.Empty;
|
||
|
||
try
|
||
{
|
||
//Limpiar el datagrid
|
||
detalleGRVDatos(null, grvEIRecursosI);
|
||
|
||
objFinanciamientoBL = new FinanciamientoBL();
|
||
objFinanciamientoBL.objFinanciamientoEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
objFinanciamientoBL.objFinanciamientoEL.TipoFinanciamiento = "EI";
|
||
objFinanciamientoBL.objFinanciamientoEL.TipoRecurso = "RI";
|
||
|
||
DataSet dsRecursos = objFinanciamientoBL.getFinanciamiento();
|
||
|
||
if (dsRecursos.Tables.Count == 0)
|
||
dsRecursos.Tables.Add();
|
||
|
||
detalleGRVDatos(dsRecursos, grvEIRecursosI);
|
||
|
||
if (grvEIRecursosI.HeaderRow != null)
|
||
{
|
||
//Invisiviliza el titulo de la columna de la PK
|
||
grvEIRecursosI.HeaderRow.Cells[0].Visible = false;
|
||
|
||
//Invisibiliza la columna de PK
|
||
for (int i = 0; i <= grvEIRecursosI.Rows.Count - 1; ++i)
|
||
{
|
||
grvEIRecursosI.Rows[i].Cells[0].Visible = false;
|
||
}
|
||
|
||
//Dar formato a las cifras por año
|
||
for (int i = 0; i <= grvEIRecursosI.Rows.Count - 1; ++i)
|
||
{
|
||
for (int j = 2; j <= grvEIRecursosI.Rows[i].Cells.Count - 1; ++j)
|
||
{
|
||
if (grvEIRecursosI.Rows[i].Cells[j].Text != "0.00")
|
||
grvEIRecursosI.Rows[i].Cells[j].Text = Decimal.Parse(grvEIRecursosI.Rows[i].Cells[j].Text).ToString("###,###,###,###.#0");
|
||
grvEIRecursosI.Rows[i].Cells[j].HorizontalAlign = HorizontalAlign.Right;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M9", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarGRVEIRecursosE() //M10
|
||
{
|
||
string strTipoFinanciamiento = string.Empty;
|
||
string strTipoRecurso = string.Empty;
|
||
|
||
try
|
||
{
|
||
//Limpiar el datagrid
|
||
detalleGRVDatos(null, grvEIRecursosE);
|
||
|
||
objFinanciamientoBL = new FinanciamientoBL();
|
||
objFinanciamientoBL.objFinanciamientoEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
objFinanciamientoBL.objFinanciamientoEL.TipoFinanciamiento = "EI";
|
||
objFinanciamientoBL.objFinanciamientoEL.TipoRecurso = "RE";
|
||
|
||
DataSet dsRecursos = objFinanciamientoBL.getFinanciamiento();
|
||
|
||
if (dsRecursos.Tables.Count == 0)
|
||
dsRecursos.Tables.Add();
|
||
|
||
detalleGRVDatos(dsRecursos, grvEIRecursosE);
|
||
|
||
if (grvEIRecursosE.HeaderRow != null)
|
||
{
|
||
//Invisiviliza el titulo de la columna de la PK
|
||
grvEIRecursosE.HeaderRow.Cells[0].Visible = false;
|
||
|
||
//Invisibiliza la columna de PK
|
||
for (int i = 0; i <= grvEIRecursosE.Rows.Count - 1; ++i)
|
||
{
|
||
grvEIRecursosE.Rows[i].Cells[0].Visible = false;
|
||
}
|
||
|
||
//Dar formato a las cifras por año
|
||
for (int i = 0; i <= grvEIRecursosE.Rows.Count - 1; ++i)
|
||
{
|
||
for (int j = 2; j <= grvEIRecursosE.Rows[i].Cells.Count - 1; ++j)
|
||
{
|
||
if (grvEIRecursosE.Rows[i].Cells[j].Text != "0.00")
|
||
grvEIRecursosE.Rows[i].Cells[j].Text = Decimal.Parse(grvEIRecursosE.Rows[i].Cells[j].Text).ToString("###,###,###,###.#0");
|
||
grvEIRecursosE.Rows[i].Cells[j].HorizontalAlign = HorizontalAlign.Right;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M10", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarGRVEndeudamiento() //M11
|
||
{
|
||
try
|
||
{
|
||
objEndeudamientoBL = new EndeudamientoBL();
|
||
objEndeudamientoBL.objEndeudamientoEL.PK = 0;
|
||
objEndeudamientoBL.objEndeudamientoEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
|
||
DataSet dsEndeudamiento = objEndeudamientoBL.getEndeudamiento();
|
||
detalleGRVDatos(dsEndeudamiento, grvEndeudamientoTemp);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M11", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
//***************************************************** PPP ********************************************
|
||
|
||
private void llenarGRVPartida() //M12
|
||
{
|
||
string strTipoFinanciamiento = string.Empty;
|
||
string strTipoRecurso = string.Empty;
|
||
|
||
try
|
||
{
|
||
objDistribucionPartidaBL = new DistribucionPartidaBL();
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
|
||
DataSet dsPartidas = objDistribucionPartidaBL.getDistribucionPartida();
|
||
|
||
if (dsPartidas.Tables.Count == 0)
|
||
dsPartidas.Tables.Add();
|
||
|
||
detalleGRVDatos(dsPartidas, grvPartidas);
|
||
|
||
for (int i = 0; i <= grvPartidas.Rows.Count - 1; ++i)
|
||
{
|
||
for (int j = 2; j <= grvPartidas.Rows[i].Cells.Count - 1; ++j)
|
||
{
|
||
if (grvPartidas.Rows[i].Cells[j].Text != "0.00")
|
||
grvPartidas.Rows[i].Cells[j].Text = Decimal.Parse(grvPartidas.Rows[i].Cells[j].Text).ToString("###,###,###,###.#0");
|
||
grvPartidas.Rows[i].Cells[j].HorizontalAlign = HorizontalAlign.Right;
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M12", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
|
||
//***************************************************** RHP ********************************************
|
||
|
||
private void mostrarRecurso() //M13
|
||
{
|
||
try
|
||
{
|
||
objRequerimientoRecursoBL = new RequerimientoRecursoBL();
|
||
objRequerimientoRecursoBL.objRequerimientoRecursoEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
DataSet dsRequerimientoRecurso = new DataSet();
|
||
|
||
dsRequerimientoRecurso = objRequerimientoRecursoBL.getRequerimientoRecursoBL();
|
||
|
||
if (dsRequerimientoRecurso.Tables[0].Rows.Count > 0)
|
||
{
|
||
txtCantidadPAP.Value = dsRequerimientoRecurso.Tables[0].Rows[0]["CANTIDADAPREQUERIMIENTORECURSO"].ToString();
|
||
txtCantidadPE.Value = dsRequerimientoRecurso.Tables[0].Rows[0]["CANTIDADECPREQUERIMIENTORECURSO"].ToString();
|
||
txtCantidadPO.Value = dsRequerimientoRecurso.Tables[0].Rows[0]["CANTIDADPPPREQUERIMIENTORECURSO"].ToString();
|
||
|
||
txtCantidadCAP.Value = dsRequerimientoRecurso.Tables[0].Rows[1]["CANTIDADAPREQUERIMIENTORECURSO"].ToString();
|
||
txtCantidadCE.Value = dsRequerimientoRecurso.Tables[0].Rows[1]["CANTIDADECPREQUERIMIENTORECURSO"].ToString();
|
||
txtCantidadCO.Value = dsRequerimientoRecurso.Tables[0].Rows[1]["CANTIDADPPPREQUERIMIENTORECURSO"].ToString();
|
||
|
||
txtCantidadNAP.Value = dsRequerimientoRecurso.Tables[0].Rows[2]["CANTIDADAPREQUERIMIENTORECURSO"].ToString();
|
||
txtCantidadNE.Value = dsRequerimientoRecurso.Tables[0].Rows[2]["CANTIDADECPREQUERIMIENTORECURSO"].ToString();
|
||
txtCantidadNO.Value = dsRequerimientoRecurso.Tables[0].Rows[2]["CANTIDADPPPREQUERIMIENTORECURSO"].ToString();
|
||
}
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M13", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
//***************************************************** EVP ********************************************
|
||
|
||
private void mostrarEvaluacion() //M14
|
||
{
|
||
try
|
||
{
|
||
DataSet ds = new DataSet();
|
||
|
||
//Carga de Analisis Ambiental
|
||
objAnalisisAmbientalBL = new AnalisisAmbientalBL();
|
||
objAnalisisAmbientalBL.objAnalisisAmbientalEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
ds = objAnalisisAmbientalBL.getAnalisisAmbiental();
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
chkVAP.Checked = bool.Parse(ds.Tables[0].Rows[0]["VIABILIDADANALISISAMBIENTAL"].ToString());
|
||
txtFechaAprobacion.Text = DateTime.Parse(ds.Tables[0].Rows[0]["FECHAAPROBACIONANALISISAMBIENTAL"].ToString()).ToString("dd/MM/yyyy");
|
||
txtInicioVAP.Text = DateTime.Parse(ds.Tables[0].Rows[0]["VAPINICIOANALISISAMBIENTAL"].ToString()).ToString("dd/MM/yyyy");
|
||
txtFinVAP.Text = DateTime.Parse(ds.Tables[0].Rows[0]["VAPFINALANALISISAMBIENTAL"].ToString()).ToString("dd/MM/yyyy");
|
||
txtPorcentajeMitigacion.Text = ds.Tables[0].Rows[0]["PORCENTAJEMITIGACIONANALISISAMBIENTAL"].ToString();
|
||
}
|
||
|
||
//Carga de Analisis Riesgo
|
||
objAnalisisRiesgoBL = new AnalisisRiesgoBL();
|
||
objAnalisisRiesgoBL.objAnalisisRiesgoEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
ds = objAnalisisRiesgoBL.getAnalisisRiesgo();
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
chkAnalisisRiesgo.Checked = bool.Parse(ds.Tables[0].Rows[0]["ANALISISRIESGO"].ToString());
|
||
txtPorcentaje.Text = ds.Tables[0].Rows[0]["PORCENTAJEREDUCCIONANALISISRIESGO"].ToString();
|
||
txtNumeroPlano.Text = ds.Tables[0].Rows[0]["NUMEROPLANOANALISISRIESGO"].ToString();
|
||
}
|
||
|
||
//Carga de Evaluacion Financiera
|
||
objEvaluacionFinancieraBL = new EvaluacionFinancieraBL();
|
||
objEvaluacionFinancieraBL.objEvaluacionFinancieraEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
ds = objEvaluacionFinancieraBL.getEvaluacionFinanciera();
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
txtTREMA.Text = ds.Tables[0].Rows[0]["TREMAEVALUACIONFINANCIERA"].ToString();
|
||
txtVAN.Text = ds.Tables[0].Rows[0]["VANEEVALUACIONFINANCIERA"].ToString();
|
||
txtTIR.Text = ds.Tables[0].Rows[0]["TIREEVALUACIONFINANCIERA"].ToString();
|
||
txtRBC.Text = ds.Tables[0].Rows[0]["RBCEVALUACIONFINANCIERA"].ToString();
|
||
}
|
||
|
||
//Carga de Evaluacion Costos
|
||
objEvaluacionCostosBL = new EvaluacionCostosBL();
|
||
objEvaluacionCostosBL.objEvaluacionCostosEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
ds = objEvaluacionCostosBL.getEvaluacionCostos();
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
txtTSD.Text = ds.Tables[0].Rows[0]["TSDEVALUACIONCOSTOS"].ToString();
|
||
txtVAC.Text = ds.Tables[0].Rows[0]["VACEVALUACIONCOSTOS"].ToString();
|
||
txtCAE.Text = ds.Tables[0].Rows[0]["CAEEVALUACIONCOSTOS"].ToString();
|
||
}
|
||
|
||
|
||
//Carga de Evaluacion Social
|
||
objEvaluacionSocialBL = new EvaluacionSocialBL();
|
||
objEvaluacionSocialBL.objEvaluacionSocialEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
ds = objEvaluacionSocialBL.getEvaluacionSocial();
|
||
if (ds.Tables[0].Rows.Count > 0)
|
||
{
|
||
txtTSDE.Text = ds.Tables[0].Rows[0]["TSDEVALUACIONSOCIAL"].ToString();
|
||
txtVANE.Text = ds.Tables[0].Rows[0]["VANEEVALUACIONSOCIAL"].ToString();
|
||
txtTIRE.Text = ds.Tables[0].Rows[0]["TIREEVALUACIONSOCIAL"].ToString();
|
||
txtRBCE.Text = ds.Tables[0].Rows[0]["RBCEVALUACIONSOCIAL"].ToString();
|
||
txtRCE.Text = ds.Tables[0].Rows[0]["RCEEVALUACIONSOCIAL"].ToString();
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M0", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
//***************************************************** ICP ********************************************
|
||
|
||
private void mostrarInformacionComplementaria() //M15
|
||
{
|
||
try
|
||
{
|
||
objInformacionBL = new InformacionBL();
|
||
objInformacionBL.objInformacionEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
DataSet dsInformacion = new DataSet();
|
||
|
||
dsInformacion = objInformacionBL.getInformacion();
|
||
|
||
if (dsInformacion.Tables[0].Rows.Count > 0)
|
||
{
|
||
ViewState["PkInformacion"] = dsInformacion.Tables[0].Rows[0]["PKINFORMACION"].ToString();
|
||
txtImportancia.Text = dsInformacion.Tables[0].Rows[0]["IMPORTANCIAINFORMACION"].ToString();
|
||
txtProblema.Text = dsInformacion.Tables[0].Rows[0]["PROBLEMAINFORMACION"].ToString();
|
||
txtMedidas.Text = dsInformacion.Tables[0].Rows[0]["MEDIDAINFORMACION"].ToString();
|
||
txtProyectosVinculados.Text = dsInformacion.Tables[0].Rows[0]["PROYECTOVINCULADOINFORMACION"].ToString();
|
||
txtEntidades.Text = dsInformacion.Tables[0].Rows[0]["OTRASENTIDADESINFORMACION"].ToString();
|
||
|
||
}
|
||
else
|
||
ViewState["PkInformacion"] = -1;
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M13", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarGRVObservaciones() //M16
|
||
{
|
||
try
|
||
{
|
||
objObservacionBL = new ObservacionBL();
|
||
objObservacionBL.objObservacionEL.Informacion = Int32.Parse(ViewState["PkInformacion"].ToString());
|
||
|
||
DataSet dsObservacion = objObservacionBL.getObservacion();
|
||
detalleGRVDatos(dsObservacion, grvObservacionesTemp);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M16", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
//***************************************************** IGP ********************************************
|
||
|
||
private void mostrarInformacionGeneral() //M17
|
||
{
|
||
try
|
||
{
|
||
objInformacionGeneralBL = new InformacionGeneralBL();
|
||
objInformacionGeneralBL.objInformacionGeneralEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
|
||
DataSet dsInformacion = objInformacionGeneralBL.getInformacionGeneral();
|
||
|
||
if (dsInformacion.Tables[0].Rows.Count != 0)
|
||
{
|
||
txtEncargado.Text = dsInformacion.Tables[0].Rows[0]["ENCARGADOINFORMACIONGENERAL"].ToString();
|
||
txtProvinciaICP.Text = dsInformacion.Tables[0].Rows[0]["NOMBREUBICACION"].ToString();
|
||
txtRegionAyA.Text = dsInformacion.Tables[0].Rows[0]["NOMBREREGION"].ToString();
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M17", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarGRVRelacionPE() //M18
|
||
{
|
||
try
|
||
{
|
||
objRelacionPlanEstrategicoBL = new RelacionPlanEstrategicoBL();
|
||
objRelacionPlanEstrategicoBL.objRelacionPlanEstrategicoEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
objRelacionPlanEstrategicoBL.objRelacionPlanEstrategicoEL.PK = 0;
|
||
|
||
DataSet dsRelacionPE = objRelacionPlanEstrategicoBL.getRelacionPlanEstrategico();
|
||
|
||
detalleGRVDatos(dsRelacionPE, grvRelacionPE);
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M18", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarGRVCentrosGestor() //M19
|
||
{
|
||
try
|
||
{
|
||
objCentroGestorBL = new CentroGestorBL();
|
||
objCentroGestorBL.objCentroGestorEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
objCentroGestorBL.objCentroGestorEL.PK = 0;
|
||
|
||
DataSet dsCentroCostos = objCentroGestorBL.getCentroGestor();
|
||
|
||
detalleGRVDatos(dsCentroCostos, grvCentroGestor);
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M19", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarGRVTipoCambio() //M20
|
||
{
|
||
|
||
try
|
||
{
|
||
objTipoCambioBL = new TipoCambioBL();
|
||
objTipoCambioBL.objTipoCambioEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
objTipoCambioBL.objTipoCambioEL.PK = 0;
|
||
|
||
DataSet dsTipoCambio = objTipoCambioBL.getTipoCambio();
|
||
|
||
detalleGRVDatos(dsTipoCambio, grvTipoCambio);
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M20", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
//***************************************************** CIP ********************************************
|
||
|
||
private void mostrarCierre() //M21
|
||
{
|
||
try
|
||
{
|
||
objCierreBL = new CierreBL();
|
||
objCierreBL.objCierreEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
|
||
DataSet dsCierre = objCierreBL.getCierre();
|
||
|
||
llenarOtrosDatos();
|
||
|
||
if (dsCierre.Tables[0].Rows.Count != 0)
|
||
{
|
||
ViewState["PkCierre"] = Convert.ToInt32(dsCierre.Tables[0].Rows[0]["PKCIERRE"].ToString());
|
||
|
||
//Datos de Cierre
|
||
txtPreInversion.Text = dsCierre.Tables[0].Rows[0]["DOCUMENTOPREINVERSIONCIERRE"].ToString();
|
||
txtFinanciamiento.Text = dsCierre.Tables[0].Rows[0]["DOCUMENTOFINANCIAMIENTOCIERRE"].ToString();
|
||
txtInversion.Text = dsCierre.Tables[0].Rows[0]["DOCUMENTOINVERSIONCIERRE"].ToString();
|
||
txtFechaCapitalizacion.Text = Convert.ToDateTime(dsCierre.Tables[0].Rows[0]["FECHACAPITALIZACIONCIERRE"].ToString()).Date.ToString("dd/MM/yyyy");
|
||
txtMontoCapitalizacion.Text = Decimal.Parse(dsCierre.Tables[0].Rows[0]["MONTOCAPITALIZACIONCIERRE"].ToString()).ToString("###,###,###,###.#0");
|
||
//Fechas del proyecto
|
||
DataSet dsFechas = objCierreBL.getOtrosDatos();
|
||
|
||
if (dsFechas.Tables[0].Rows.Count != 0)
|
||
{
|
||
if (dsFechas.Tables[0].Rows[0]["ENCARGADOINFORMACIONGENERAL"].ToString() != "")
|
||
txtEncargadoProyecto.Text = dsFechas.Tables[0].Rows[0]["ENCARGADOINFORMACIONGENERAL"].ToString();
|
||
if (dsFechas.Tables[0].Rows[0]["FECHAINICIO"].ToString() != "")
|
||
txtFechaInicio.Text = Convert.ToDateTime(dsFechas.Tables[0].Rows[0]["FECHAINICIO"].ToString()).Date.ToString("dd/MM/yyyy");
|
||
if (dsFechas.Tables[0].Rows[0]["MONTOFINANCIAMIENTO"].ToString() != "")
|
||
txtCostoTotal.Text = Decimal.Parse(dsFechas.Tables[0].Rows[0]["MONTOFINANCIAMIENTO"].ToString()).ToString("###,###,###,###.#0");
|
||
if (dsFechas.Tables[0].Rows[0]["FECHAFIN"].ToString() != "")
|
||
{
|
||
txtFechaFinalizacion.Text = Convert.ToDateTime(dsFechas.Tables[0].Rows[0]["FECHAFIN"].ToString()).Date.ToString("dd/MM/yyyy");
|
||
txtFechaEntrega.Text = Convert.ToDateTime(dsFechas.Tables[0].Rows[0]["FECHAFIN"].ToString()).Date.ToString("dd/MM/yyyy");
|
||
|
||
}
|
||
|
||
}
|
||
txtMontoCapitalizacion.Text = Decimal.Parse(dsCierre.Tables[0].Rows[0]["MONTOCAPITALIZACIONCIERRE"].ToString()).ToString("###,###,###.#0");
|
||
}
|
||
else
|
||
ViewState["PkCierre"] = -1;
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M21", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarGRVLeccion() //M22
|
||
{
|
||
try
|
||
{
|
||
objLeccionBL = new LeccionBL();
|
||
objLeccionBL.objLeccionEL.Cierre = Int32.Parse(ViewState["PkCierre"].ToString());
|
||
|
||
DataSet dsLeccion = objLeccionBL.getLeccion();
|
||
|
||
detalleGRVDatos(dsLeccion, grvLeccionTemp);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M22", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarGRVComentario() //M23
|
||
{
|
||
try
|
||
{
|
||
objComentarioBL = new ComentarioBL();
|
||
objComentarioBL.objComentarioEL.Cierre = Int32.Parse(ViewState["PkCierre"].ToString());
|
||
|
||
DataSet dsComentario = objComentarioBL.getComentario();
|
||
|
||
detalleGRVDatos(dsComentario, grvComentarioTemp);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M23", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarGRVObjCumplidos() //M24
|
||
{
|
||
try
|
||
{
|
||
objObjetivoEspecificoBL = new ObjetivoEspecificoBL();
|
||
objObjetivoEspecificoBL.objObjetivoEspecificoEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
objObjetivoEspecificoBL.objObjetivoEspecificoEL.Cumplido = true;
|
||
|
||
DataSet dsObjetivos = objObjetivoEspecificoBL.getObjetivoEspecificoFicha();
|
||
|
||
detalleGRVDatos(dsObjetivos, grvObjCumplidos);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M24", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarGRVObjNoCumplidos() //M25
|
||
{
|
||
try
|
||
{
|
||
objObjetivoEspecificoBL = new ObjetivoEspecificoBL();
|
||
objObjetivoEspecificoBL.objObjetivoEspecificoEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
objObjetivoEspecificoBL.objObjetivoEspecificoEL.Cumplido = false;
|
||
|
||
DataSet dsObjetivos = objObjetivoEspecificoBL.getObjetivoEspecificoFicha();
|
||
|
||
detalleGRVDatos(dsObjetivos, grvObjNoCumplidos);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M25", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarOtrosDatos() //M26
|
||
{
|
||
try
|
||
{
|
||
objCierreBL = new CierreBL();
|
||
objCierreBL.objCierreEL.Proyecto = Convert.ToInt32(ddlProyecto.SelectedValue);
|
||
|
||
DataSet dsCierre = objCierreBL.getOtrosDatos();
|
||
|
||
if (dsCierre.Tables[0].Rows.Count != 0)
|
||
{
|
||
if (dsCierre.Tables[0].Rows[0]["ENCARGADOINFORMACIONGENERAL"].ToString() != "")
|
||
txtEncargadoProyecto.Text = dsCierre.Tables[0].Rows[0]["ENCARGADOINFORMACIONGENERAL"].ToString();
|
||
if (dsCierre.Tables[0].Rows[0]["FECHAINICIO"].ToString() != "")
|
||
txtFechaInicio.Text = Convert.ToDateTime(dsCierre.Tables[0].Rows[0]["FECHAINICIO"].ToString()).Date.ToString("dd/MM/yyyy");
|
||
if (dsCierre.Tables[0].Rows[0]["MONTOFINANCIAMIENTO"].ToString() != "")
|
||
txtCostoTotal.Text = Decimal.Parse(dsCierre.Tables[0].Rows[0]["MONTOFINANCIAMIENTO"].ToString()).ToString("###,###,###,###.#0");
|
||
if (dsCierre.Tables[0].Rows[0]["FECHAFIN"].ToString() != "")
|
||
{
|
||
txtFechaFinalizacion.Text = Convert.ToDateTime(dsCierre.Tables[0].Rows[0]["FECHAFIN"].ToString()).Date.ToString("dd/MM/yyyy");
|
||
txtFechaEntrega.Text = Convert.ToDateTime(dsCierre.Tables[0].Rows[0]["FECHAFIN"].ToString()).Date.ToString("dd/MM/yyyy");
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M26", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
|
||
private void llenarDDLDependenciaReasignar() //M27
|
||
{
|
||
try
|
||
{
|
||
//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);
|
||
|
||
ddlDependencia.DataSource = dsDependencia;
|
||
ddlDependencia.DataTextField = dsDependencia.Tables[0].Columns["NOMBREDEPENDENCIA"].ColumnName;
|
||
ddlDependencia.DataValueField = dsDependencia.Tables[0].Columns["CODIGOACCESODEPENDENCIA"].ColumnName;
|
||
ddlDependencia.DataBind();
|
||
|
||
ddlDependencia.Items.Insert(0, new ListItem("Seleccione una Dependencia", "-1"));
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M27", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
#endregion
|
||
|
||
} |