+
+
+
+
+
diff --git a/AYA.FROPI/FOPI/webforms/FOR/wfrAprobacion.aspx.cs b/AYA.FROPI/FOPI/webforms/FOR/wfrAprobacion.aspx.cs
index b7ad71873..8ca786142 100644
--- a/AYA.FROPI/FOPI/webforms/FOR/wfrAprobacion.aspx.cs
+++ b/AYA.FROPI/FOPI/webforms/FOR/wfrAprobacion.aspx.cs
@@ -25,7 +25,7 @@ using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
-
+using System.Web.UI.HtmlControls;
using AyADAL;
using AyABL.ADM;
@@ -121,7 +121,7 @@ public partial class webforms_FOR_wfrAprobacion : General
#region Variables (R1)
- GridView grvListaDatosTemp;
+ GridView grvListaDatosTemp, grvUbicacionesTemp;
ArrayList arlCondicionesFiltroBusqueda = new ArrayList();
//Variables para realizar la busqueda
@@ -138,7 +138,7 @@ public partial class webforms_FOR_wfrAprobacion : General
ProyectoBL objProyectoBL;
ObjetivoEspecificoBL objObjetivoEspecificoBL;
ResultadoBL objResultadoBL;
-
+ UbicacionBL objUbicacionBL;
//*****************CVP***********************
CicloVidaBL objCicloVidaBL;
EtapaBL objEtapaBL;
@@ -190,6 +190,8 @@ public partial class webforms_FOR_wfrAprobacion : General
llenarGridView();
mostrarFilaTabla(1);
}
+
+ ScriptManager.RegisterStartupScript(Page, typeof(Page), "Check", "validarEstado()", true);
}
catch (Exception ex)
{
@@ -286,6 +288,26 @@ public partial class webforms_FOR_wfrAprobacion : General
}
}
+ protected void grvEtapas_RowDataBound(object sender, GridViewRowEventArgs e) //M6
+ {
+ try
+ {
+ GridViewRow selectedRow = e.Row;
+
+
+ if (e.Row.RowType == DataControlRowType.DataRow)
+ {
+ HtmlInputCheckBox cb = (HtmlInputCheckBox)selectedRow.FindControl("chkItem");
+
+ if (e.Row.Cells[6].Text.Trim() == "1")
+ cb.Checked = true;
+ }
+ }
+ catch (Exception ex)
+ {
+ MensajeError("Error en R3M6", ex);
+ }
+ }
#endregion
@@ -349,6 +371,20 @@ public partial class webforms_FOR_wfrAprobacion : General
//Carga el buscador con las columnas del grid
LlenarDDLBusqueda(grvListaDatosTemp);
+ grvUbicacionesTemp = (GridView)divDatosInferiores.FindControl("grvUbicaciones");
+
+ GridViewBoundField bdFkUbicacion = new GridViewBoundField("FKPROYECTO", "FK", false, false, false);
+ GridViewBoundField bdProvincia = new GridViewBoundField("PROVINCIA", "PROVINCIA", false, false, true);
+ GridViewBoundField bdCanton = new GridViewBoundField("CANTON", "CANTÓN", false, false, true);
+ GridViewBoundField bdDistrito = new GridViewBoundField("DISTRITO", "DISTRITO", false, false, true);
+ GridViewBoundField bdBarrios = new GridViewBoundField("LISTABARRIOS", "COMUNIDADES", false, false, true);
+
+ grvUbicacionesTemp.Columns.Add(bdFkUbicacion);
+ grvUbicacionesTemp.Columns.Add(bdProvincia);
+ grvUbicacionesTemp.Columns.Add(bdCanton);
+ grvUbicacionesTemp.Columns.Add(bdDistrito);
+ grvUbicacionesTemp.Columns.Add(bdBarrios);
+
}
catch (Exception ex)
{
@@ -485,19 +521,21 @@ public partial class webforms_FOR_wfrAprobacion : General
{
try
{
- grvEtapasTemp = (GridView)divDatosInferiores.FindControl("grvEtapas");
+ 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);
+ GridViewBoundField bdfEtapaActual = new GridViewBoundField("ETAPAACTUAL", "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.Add(bdfEtapaActual);
grvEtapasTemp.Columns[0].ItemStyle.Width = 25;
grvEtapasTemp.Columns[1].ItemStyle.Width = 25;
@@ -509,7 +547,6 @@ public partial class webforms_FOR_wfrAprobacion : General
MensajeError("Error en R4M7", ex);
}
}
-
//*****************FNP***********************
private void construirgrvPIRecursosI() //M8
@@ -1001,6 +1038,7 @@ public partial class webforms_FOR_wfrAprobacion : General
private void mostrarAGP() //M2
{
+
try
{
objProyectoBL = new ProyectoBL();
@@ -1010,10 +1048,19 @@ public partial class webforms_FOR_wfrAprobacion : General
{
txtProyecto.Text = dsProyecto.Tables[0].Rows[0]["NOMBREPROYECTO"].ToString();
txtNumeroBPIP.Text = dsProyecto.Tables[0].Rows[0]["NUMEROBPIPPROYECTO"].ToString();
+ txtEstadoProyecto.Text = string.IsNullOrEmpty(dsProyecto.Tables[0].Rows[0]["NOMBREESTADO"].ToString()) ? "Sin Asignar" : dsProyecto.Tables[0].Rows[0]["NOMBREESTADO"].ToString();
+
+ //RELACION PND
txtNumeroAccion.Text = dsProyecto.Tables[0].Rows[0]["NUMEROACCIONESTRATEGICAPROYECTO"].ToString();
+ txtNumeroAccion.ToolTip = txtNumeroAccion.Text;
txtMetaAccion.Text = dsProyecto.Tables[0].Rows[0]["METAACCIONESTRATEGICAPROYECTO"].ToString();
+ txtMetaAccion.ToolTip = txtMetaAccion.Text;
txtMetaInstitucional.Text = dsProyecto.Tables[0].Rows[0]["METAINSTITUCIONALPROYECTO"].ToString();
+ txtMetaInstitucional.ToolTip = txtMetaInstitucional.Text;
+ /******************/
+
txtPrioridad.Text = dsProyecto.Tables[0].Rows[0]["PRIORIDAD"].ToString();
+ txtComplejidad.Text = dsProyecto.Tables[0].Rows[0]["NOMBRECOMPLEJIDAD"].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();
@@ -1021,52 +1068,21 @@ public partial class webforms_FOR_wfrAprobacion : General
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();
+ txtPatrocinador.Text = dsProyecto.Tables[0].Rows[0]["PATROCINADORPROYECTO"].ToString();
+ txtTotalEstimado.Text = dsProyecto.Tables[0].Rows[0]["COSTOESTIMADOPROYECTO"].ToString();
+ txtLider.Text = dsProyecto.Tables[0].Rows[0]["LIDERPROYECTO"].ToString();
- if (bool.Parse(dsProyecto.Tables[0].Rows[0]["VISTOBUENOOFICINAPROYECTO"].ToString()) == true)
- {
- imgNivel1Aprobado.Visible = true;
- imgNivel1NoAprobado.Visible = false;
- }
- else
- {
- imgNivel1Aprobado.Visible = false;
- imgNivel1NoAprobado.Visible = true;
- }
- if (bool.Parse(dsProyecto.Tables[0].Rows[0]["VISTOBUENOSUBGERENCIAPROYECTO"].ToString()) == true)
- {
- imgNivel2Aprobado.Visible = true;
- imgNivel2NoAprobado.Visible = false;
- }
- else
- {
- imgNivel2Aprobado.Visible = false;
- imgNivel2NoAprobado.Visible = true;
- }
- if (bool.Parse(dsProyecto.Tables[0].Rows[0]["VISTOBUENOPLANIFICACIONPROYECTO"].ToString()) == true)
- {
- imgNivel3Aprobado.Visible = true;
- imgNivel3NoAprobado.Visible = false;
- }
- else
- {
- imgNivel3Aprobado.Visible = false;
- imgNivel3NoAprobado.Visible = true;
- }
-
+ if (!string.IsNullOrWhiteSpace(txtNumeroBPIP.Text))
+ txtProyecto.ReadOnly = true;
//MOSTRAR OBJETIVOS Y RESULTADOS
llenarGridObjetivos();
-
llenarGridResultados();
+ llenarGridUbicaciones();
}
-
-
}
catch (Exception ex)
{
@@ -1113,6 +1129,22 @@ public partial class webforms_FOR_wfrAprobacion : General
}
}
+ private void llenarGridUbicaciones() //M29
+ {
+ try
+ {
+ objUbicacionBL = new UbicacionBL();
+ DataSet dsUbicaciones = objUbicacionBL.getUbicacion(Int32.Parse(ViewState["PkProyecto"].ToString()));
+ detalleGRVDatos(dsUbicaciones, grvUbicacionesTemp);
+
+ }
+ catch (Exception ex)
+ {
+ MensajeError("Error en R6M29", ex);
+ }
+
+ }
+
//***************************************************** CVP ********************************************
private int mostrarCVP() //M5
@@ -1390,15 +1422,32 @@ public partial class webforms_FOR_wfrAprobacion : General
detalleGRVDatos(null, grvTotalFinanciamiento);
objFinanciamientoBL = new FinanciamientoBL();
+ objDistribucionPartidaBL = new DistribucionPartidaBL();
+
objFinanciamientoBL.objFinanciamientoEL.Proyecto = Int32.Parse(ViewState["PkProyecto"].ToString());
+ objDistribucionPartidaBL.objDistribucionPartidaEL.Proyecto = Int32.Parse(ViewState["PkProyecto"].ToString());
DataSet dsRecursos = objFinanciamientoBL.getTotalFinanciamiento();
+ DataSet dsPartidas = objDistribucionPartidaBL.getTotalPartida();
if (dsRecursos.Tables.Count == 0)
dsRecursos.Tables.Add();
detalleGRVDatos(dsRecursos, grvTotalFinanciamiento);
+ decimal vMontoTotalFinanciamiento = 0M;
+ decimal vMontoTotalPartidas = 0M;
+
+ #region VERIFICAR MONTO PARTIDAS
+ if (dsPartidas != null || dsPartidas.Tables.Count > 0 || dsPartidas.Tables[0].Rows.Count > 0)
+ {
+ for (int i = 1; i <= dsPartidas.Tables[0].Columns.Count - 1; ++i)
+ {
+ vMontoTotalPartidas += Convert.ToDecimal(dsPartidas.Tables[0].Rows[0][i].ToString());
+ }
+ }
+ #endregion
+
if (grvTotalFinanciamiento.HeaderRow != null)
{
grvTotalFinanciamiento.HeaderRow.Cells[0].Text = "";
@@ -1407,13 +1456,43 @@ public partial class webforms_FOR_wfrAprobacion : General
{
for (int j = 1; j <= grvTotalFinanciamiento.Rows[i].Cells.Count - 1; ++j)
{
+
+ vMontoTotalFinanciamiento += Convert.ToDecimal(grvTotalFinanciamiento.Rows[i].Cells[j].Text);
+
if (grvTotalFinanciamiento.Rows[i].Cells[j].Text != "0.00")
grvTotalFinanciamiento.Rows[i].Cells[j].Text = Decimal.Parse(grvTotalFinanciamiento.Rows[i].Cells[j].Text).ToString("###,###,###,###.#0");
+
grvTotalFinanciamiento.Rows[i].Cells[j].HorizontalAlign = HorizontalAlign.Right;
+ grvTotalFinanciamiento.FooterRow.Cells[j].BorderStyle = BorderStyle.None;
+
}
grvTotalFinanciamiento.Rows[i].Font.Bold = true;
}
}
+
+ #region Mostrar Total
+ if (grvTotalFinanciamiento.Rows.Count > 0)
+ {
+ grvTotalFinanciamiento.Rows[0].Cells[0].Text = "TOTAL ANUAL";
+ }
+
+ var vMontosCoinciden = vMontoTotalPartidas == vMontoTotalFinanciamiento;
+
+ grvTotalFinanciamiento.FooterRow.Cells[0].Text = "TOTAL GENERAL";
+ grvTotalFinanciamiento.FooterRow.Cells[0].Font.Bold = true;
+ grvTotalFinanciamiento.FooterRow.Cells[0].HorizontalAlign = HorizontalAlign.Left;
+
+ grvTotalFinanciamiento.FooterRow.Cells[1].Text = vMontoTotalFinanciamiento.ToString("###,###,###,###.#0");
+ grvTotalFinanciamiento.FooterRow.Cells[1].Font.Bold = true;
+ grvTotalFinanciamiento.FooterRow.Cells[1].HorizontalAlign = HorizontalAlign.Right;
+ grvTotalFinanciamiento.FooterRow.Cells[1].BackColor = vMontosCoinciden ? System.Drawing.Color.Green : System.Drawing.Color.IndianRed;
+ grvTotalFinanciamiento.FooterRow.Cells[1].ForeColor = System.Drawing.Color.White;
+
+
+ grvTotalFinanciamiento.FooterRow.Cells[0].BorderStyle = BorderStyle.Solid;
+ grvTotalFinanciamiento.FooterRow.Cells[1].BorderStyle = BorderStyle.Solid;
+ #endregion
+
}
catch (Exception ex)
{
@@ -1483,16 +1562,30 @@ public partial class webforms_FOR_wfrAprobacion : General
try
{
- objDistribucionPartidaBL = new DistribucionPartidaBL();
objDistribucionPartidaBL.objDistribucionPartidaEL.Proyecto = Int32.Parse(ViewState["PkProyecto"].ToString());
+ objFinanciamientoBL.objFinanciamientoEL.Proyecto = Int32.Parse(ViewState["PkProyecto"].ToString());
DataSet dsPartidas = objDistribucionPartidaBL.getTotalPartida();
+ DataSet dsRecursos = objFinanciamientoBL.getTotalFinanciamiento();
if (dsPartidas.Tables.Count == 0)
dsPartidas.Tables.Add();
detalleGRVDatos(dsPartidas, grvTotalPartidas);
+ decimal vMontoTotalPartidas = 0M;
+ decimal vMontoTotalFinanciamiento = 0M;
+
+ #region VERIFICAR MONTO FINANCIAMIENTO
+ if (dsRecursos != null || dsRecursos.Tables.Count > 0 || dsRecursos.Tables[0].Rows.Count > 0)
+ {
+ for (int i = 1; i <= dsRecursos.Tables[0].Columns.Count - 1; ++i)
+ {
+ vMontoTotalFinanciamiento += Convert.ToDecimal(dsRecursos.Tables[0].Rows[0][i].ToString());
+ }
+ }
+ #endregion
+
if (grvTotalPartidas.HeaderRow != null)
{
grvTotalPartidas.HeaderRow.Cells[0].Text = "";
@@ -1501,12 +1594,41 @@ public partial class webforms_FOR_wfrAprobacion : General
{
for (int j = 1; j <= grvTotalPartidas.Rows[i].Cells.Count - 1; ++j)
{
+ vMontoTotalPartidas += Convert.ToDecimal(grvTotalPartidas.Rows[i].Cells[j].Text);
+
if (grvTotalPartidas.Rows[i].Cells[j].Text != "0.00")
grvTotalPartidas.Rows[i].Cells[j].Text = Decimal.Parse(grvTotalPartidas.Rows[i].Cells[j].Text).ToString("###,###,###,###.#0");
+
grvTotalPartidas.Rows[i].Cells[j].HorizontalAlign = HorizontalAlign.Right;
+ grvTotalPartidas.FooterRow.Cells[j].BorderStyle = BorderStyle.None;
}
+
grvTotalPartidas.Rows[i].Font.Bold = true;
}
+
+ #region Mostrar Total
+ if (grvTotalPartidas.Rows.Count > 0)
+ {
+ grvTotalPartidas.Rows[0].Cells[0].Text = "TOTAL ANUAL";
+ }
+
+ var vMontosCoinciden = vMontoTotalPartidas == vMontoTotalFinanciamiento;
+
+ grvTotalPartidas.FooterRow.Cells[0].Text = "TOTAL GENERAL";
+ grvTotalPartidas.FooterRow.Cells[0].Font.Bold = true;
+ grvTotalPartidas.FooterRow.Cells[0].HorizontalAlign = HorizontalAlign.Left;
+
+ grvTotalPartidas.FooterRow.Cells[1].Text = vMontoTotalPartidas.ToString("###,###,###,###.#0");
+ grvTotalPartidas.FooterRow.Cells[1].Font.Bold = true;
+ grvTotalPartidas.FooterRow.Cells[1].HorizontalAlign = HorizontalAlign.Right;
+
+ grvTotalPartidas.FooterRow.Cells[1].BackColor = vMontosCoinciden ? System.Drawing.Color.Green : System.Drawing.Color.IndianRed;
+ grvTotalPartidas.FooterRow.Cells[1].ForeColor = System.Drawing.Color.White;
+
+ grvTotalPartidas.FooterRow.Cells[0].BorderStyle = BorderStyle.Solid;
+ grvTotalPartidas.FooterRow.Cells[1].BorderStyle = BorderStyle.Solid;
+ #endregion
+
}
}
catch (Exception ex)
@@ -1515,7 +1637,6 @@ public partial class webforms_FOR_wfrAprobacion : General
General.ReportarError(ex, Session["LOGIN"].ToString());
}
}
-
//***************************************************** RHP ********************************************
private void mostrarRecurso() //M15
@@ -1691,8 +1812,8 @@ public partial class webforms_FOR_wfrAprobacion : General
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();
+ txtRegionGeneral.Text = dsInformacion.Tables[0].Rows[0]["NOMBREREGION"].ToString();
}
}
catch (Exception ex)
diff --git a/AYA.FROPI/FOPI/webforms/FOR/wfrAspectosGenerales.aspx b/AYA.FROPI/FOPI/webforms/FOR/wfrAspectosGenerales.aspx
index 1670622c6..3e6b78320 100644
--- a/AYA.FROPI/FOPI/webforms/FOR/wfrAspectosGenerales.aspx
+++ b/AYA.FROPI/FOPI/webforms/FOR/wfrAspectosGenerales.aspx
@@ -174,6 +174,15 @@