2019-05-27 14:46:35 +00:00
/ * = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Instituto Costarricense de Acueductos y Alcantarillados . - 2019
* Formularios para Proyectos de Inversión
* Nombre de la Pantalla : wfrInfoGeneral . aspx
*
* Explicación de los contenidos del archivo
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* HISTORIAL
*
* PERSONA DIA – MES - AÑO DESCRIPCIÓN
* Esteban Gutierrez Rapso 19 – 02 - 2019 Se inicia con el diseño de la pagina
* … … … … … … … … … … … … … … … … … … … … … …
* … … … … … … … … … … … … … … … … … … … … … …
* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
* Derechos Reservados ( C ) 2019 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.IGP ;
using AyABL.AGP ;
using AyABL.PLE ;
using AyABL.ADM ;
public partial class webforms_FOR_wfrInfoGeneral : 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 ) ;
construirGrvPlanEstrategico ( ) ;
construirgrvCentroGestor ( ) ;
construirGrvTipoCambio ( ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R0M1" , ex ) ;
}
}
#endregion
#region Variables ( R1 )
GridView grvPlanEstrategicoTemp , grvCentroGestorTemp , grvTipoCambioTemp ;
ProyectoBL objProyectoBL ;
InformacionGeneralBL objInformacionGeneralBL ;
CentroGestorBL objCentroGestorBL ;
TipoCambioBL objTipoCambioBL ;
RelacionPlanEstrategicoBL objRelacionPlanEstrategicoBL ;
TemaEstrategicoBL objTemaEstrategicoBL ;
PerspectivaBL objPerspectivaBL ;
ObjetivoBL objObjetivoBL ;
ProcedenciaCentrogestorBL objProcedenciaCentrogestorBL ;
RegionBL objRegionBL ;
CatalogoBL objCatalogoBL ;
#endregion
#region Eventos Formulario ( R2 )
protected void Page_Load ( object sender , EventArgs e ) //M0
{
try
{
if ( ( ! IsPostBack ) & & ( Session . Count > 0 ) )
{
objProyectoBL = new ProyectoBL ( ) ;
objProyectoBL . objProyectoEL . PK = Int32 . Parse ( Session [ "PKPROYECTO" ] . ToString ( ) ) ;
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 ( ) ;
txtEstadoProyecto . Text = string . IsNullOrEmpty ( dsProyecto . Tables [ 0 ] . Rows [ 0 ] [ "NOMBREESTADO" ] . ToString ( ) ) ? "Sin Asignar" : dsProyecto . Tables [ 0 ] . Rows [ 0 ] [ "NOMBREESTADO" ] . ToString ( ) ;
2019-06-24 04:03:12 +00:00
if ( ! string . IsNullOrWhiteSpace ( txtNumeroBPIP . Text ) )
txtProyecto . ReadOnly = true ;
2019-05-27 14:46:35 +00:00
}
mostrarDatosInfoGeneral ( ) ;
//llenarDDLRegion();
llenarDDLTemaEstrategico ( ) ;
llenarDDLPerspectiva ( ) ;
llenarDDLObjetivo ( ) ;
llenarDDLContribucion ( ) ;
llenarGrvPlanEstrategico ( ) ;
llenarddlProcedencia ( ) ;
llenarGrvCentrosGestor ( ) ;
llenarDDLAnio ( ) ;
llenarGrvTipoCambio ( ) ;
}
2019-06-02 05:36:32 +00:00
ScriptManager . RegisterStartupScript ( Page , typeof ( Page ) , "Check" , "validarEstado()" , true ) ;
2019-05-27 14:46:35 +00:00
}
catch ( Exception ex )
{
MensajeError ( "Error en R2M0" , ex ) ;
}
}
#endregion
#region Eventos Controles Web ( R3 )
protected void btnAnterior_Click ( object sender , EventArgs e ) //M0
{
try
{
Response . Redirect ( "wfrProyectos.aspx" ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M0" , ex ) ;
}
}
//protected void btnGuardarIG_Click(object sender, EventArgs e) //M1
//{
// try
// {
// if (guardarDatosInfoGeneral())
// {
// 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 grvPlanEstrategico_RowCommand ( object sender , GridViewCommandEventArgs e ) //M2
{
try
{
if ( e . CommandName = = "editar" )
{
int i = Convert . ToInt32 ( e . CommandArgument ) ;
GridViewRow selectedRow = grvPlanEstrategico . Rows [ i ] ;
ViewState [ "PkPlanEstrategico" ] = Convert . ToInt32 ( selectedRow . Cells [ 2 ] . Text ) ;
ViewState [ "Modo_PlanEstrategico" ] = "Modifica" ;
mostrarFilasPlanEstrategico ( 2 ) ;
mostrarDatosPlanEstrategico ( ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M2" , ex ) ;
}
}
protected void grvPlanEstrategico_PageIndexChanging ( object sender , GridViewPageEventArgs e ) //M3
{
try
{
grvPlanEstrategico . PageIndex = e . NewPageIndex ;
llenarGrvPlanEstrategico ( ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error R3M3" , ex ) ;
}
}
protected void btnNuevoPE_Click ( object sender , EventArgs e ) //M4
{
try
{
ViewState [ "Modo_PlanEstrategico" ] = "Nuevo" ;
mostrarFilasPlanEstrategico ( 2 ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M4" , ex ) ;
}
}
protected void btnEliminarPE_Click ( object sender , EventArgs e ) //M5
{
try
{
// recorro el grid
foreach ( GridViewRow row in grvPlanEstrategicoTemp . Rows )
{
HtmlInputCheckBox chkTemp = ( HtmlInputCheckBox ) row . Controls [ 0 ] . Controls [ 1 ] ;
if ( chkTemp ! = null )
{
// si el registro esta marcado
if ( chkTemp . Checked )
{
int intPkEliminar = Convert . ToInt32 ( row . Cells [ 2 ] . Text ) ;
eliminarDatosPlanEstrategico ( intPkEliminar ) ;
}
}
llenarGrvPlanEstrategico ( ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M5" + "" , ex ) ;
}
}
protected void ddlPerspectiva_SelectedIndexChanged ( object sender , EventArgs e ) //M6
{
llenarDDLObjetivo ( ) ;
}
protected void btnGuardarPE_Click ( object sender , EventArgs e ) //M7
{
try
{
if ( guardarDatosPlanEstrategico ( ) )
{
MensajeInformativo ( "El registro fue almacenado exitosamente" ) ;
}
else
{
MensajeError ( "El registro no fue almacenado, verifique" , null ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M7" , ex ) ;
}
}
protected void btnAnteriorPE_Click ( object sender , EventArgs e ) //M8
{
try
{
mostrarFilasPlanEstrategico ( 1 ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M8" , ex ) ;
}
}
protected void grvCentroGestor_RowCommand ( object sender , GridViewCommandEventArgs e ) //M9
{
try
{
if ( e . CommandName = = "editar" )
{
int i = Convert . ToInt32 ( e . CommandArgument ) ;
GridViewRow selectedRow = grvCentroGestor . Rows [ i ] ;
ViewState [ "PkCentroGestor" ] = Convert . ToInt32 ( selectedRow . Cells [ 2 ] . Text ) ;
ViewState [ "Modo_CentroGestor" ] = "Modifica" ;
mostrarFilasCentroGestor ( 2 ) ;
mostrarDatosCentroGestor ( ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M9" , ex ) ;
}
}
protected void grvCentroGestor_PageIndexChanging ( object sender , GridViewPageEventArgs e ) //M10
{
try
{
grvCentroGestor . PageIndex = e . NewPageIndex ;
llenarGrvCentrosGestor ( ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error R3M10" , ex ) ;
}
}
protected void btnNuevoCG_Click ( object sender , EventArgs e ) //M11
{
try
{
ViewState [ "Modo_CentroGestor" ] = "Nuevo" ;
mostrarFilasCentroGestor ( 2 ) ;
limpiarCamposCG ( ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M11" , ex ) ;
}
}
protected void btnEliminarCG_Click ( object sender , EventArgs e ) //M12
{
try
{
// recorro el grid
foreach ( GridViewRow row in grvCentroGestorTemp . Rows )
{
HtmlInputCheckBox chkTemp = ( HtmlInputCheckBox ) row . Controls [ 0 ] . Controls [ 1 ] ;
if ( chkTemp ! = null )
{
// si el registro esta marcado
if ( chkTemp . Checked )
{
int intPkEliminar = Convert . ToInt32 ( row . Cells [ 2 ] . Text ) ;
eliminarDatosCentroGestor ( intPkEliminar ) ;
}
}
llenarGrvCentrosGestor ( ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M12" + "" , ex ) ;
}
}
protected void btnGuardarCG_Click ( object sender , EventArgs e ) //M13
{
try
{
if ( guardarDatosCentroGestor ( ) )
{
MensajeInformativo ( "El registro fue almacenado exitosamente" ) ;
}
else
{
MensajeError ( "El registro no fue almacenado, verifique" , null ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M13" , ex ) ;
}
}
protected void btnAnteriorCG_Click ( object sender , EventArgs e ) //M14
{
try
{
mostrarFilasCentroGestor ( 1 ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M14" , ex ) ;
}
}
protected void grvTipoCambio_RowCommand ( object sender , GridViewCommandEventArgs e ) //M15
{
try
{
if ( e . CommandName = = "editar" )
{
int i = Convert . ToInt32 ( e . CommandArgument ) ;
GridViewRow selectedRow = grvTipoCambio . Rows [ i ] ;
ViewState [ "PkTipoCambio" ] = Convert . ToInt32 ( selectedRow . Cells [ 2 ] . Text ) ;
ViewState [ "Modo_TipoCambio" ] = "Modifica" ;
mostrarFilasTipoCambio ( 2 ) ;
mostrarDatosTipoCambio ( ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M15" , ex ) ;
}
}
protected void grvTipoCambio_PageIndexChanging ( object sender , GridViewPageEventArgs e ) //M16
{
try
{
grvTipoCambio . PageIndex = e . NewPageIndex ;
llenarGrvTipoCambio ( ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error R3M16" , ex ) ;
}
}
protected void btnNuevoTC_Click ( object sender , EventArgs e ) //M17
{
try
{
ViewState [ "Modo_TipoCambio" ] = "Nuevo" ;
mostrarFilasTipoCambio ( 2 ) ;
limpiarCamposTC ( ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M17" , ex ) ;
}
}
protected void btnEliminarTC_Click ( object sender , EventArgs e ) //M18
{
try
{
// recorro el grid
foreach ( GridViewRow row in grvTipoCambioTemp . Rows )
{
HtmlInputCheckBox chkTemp = ( HtmlInputCheckBox ) row . Controls [ 0 ] . Controls [ 1 ] ;
if ( chkTemp ! = null )
{
// si el registro esta marcado
if ( chkTemp . Checked )
{
int intPkEliminar = Convert . ToInt32 ( row . Cells [ 2 ] . Text ) ;
eliminarDatosTipoCambio ( intPkEliminar ) ;
}
}
llenarGrvCentrosGestor ( ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M12" + "" , ex ) ;
}
}
protected void btnGuardarTC_Click ( object sender , EventArgs e ) //M19
{
try
{
if ( guardarDatosTipoCambio ( ) )
{
MensajeInformativo ( "El registro fue almacenado exitosamente" ) ;
}
else
{
MensajeError ( "El registro no fue almacenado, verifique" , null ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M19" , ex ) ;
}
}
protected void btnAnteriorTC_Click ( object sender , EventArgs e ) //M20
{
try
{
mostrarFilasTipoCambio ( 1 ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R3M14" , ex ) ;
}
}
#endregion
#region Metodos Personalizados ( R4 )
private void construirGrvPlanEstrategico ( ) //M0
{
try
{
grvPlanEstrategicoTemp = ( GridView ) divPlanEstrategico . FindControl ( "grvPlanEstrategico" ) ;
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 ) ;
grvPlanEstrategicoTemp . Columns . Add ( bdfPkRelacionPE ) ;
grvPlanEstrategicoTemp . Columns . Add ( bdfTemaEstrategico ) ;
grvPlanEstrategicoTemp . Columns . Add ( bdfPerspectiva ) ;
grvPlanEstrategicoTemp . Columns . Add ( bdfCodigo ) ;
grvPlanEstrategicoTemp . Columns . Add ( bdfObjetivo ) ;
grvPlanEstrategicoTemp . Columns . Add ( bdfMeta ) ;
grvPlanEstrategicoTemp . Columns . Add ( bdfContribucion ) ;
grvPlanEstrategicoTemp . Columns [ 0 ] . ItemStyle . Width = 25 ;
grvPlanEstrategicoTemp . Columns [ 3 ] . ItemStyle . Width = 200 ;
grvPlanEstrategicoTemp . Columns [ 4 ] . ItemStyle . Width = 230 ;
grvPlanEstrategicoTemp . Columns [ 5 ] . ItemStyle . Width = 150 ;
grvPlanEstrategicoTemp . Columns [ 6 ] . ItemStyle . Width = 350 ;
grvPlanEstrategicoTemp . Columns [ 7 ] . ItemStyle . Width = 150 ;
grvPlanEstrategicoTemp . Columns [ 5 ] . ItemStyle . HorizontalAlign = HorizontalAlign . Center ;
grvPlanEstrategicoTemp . Columns [ 7 ] . ItemStyle . HorizontalAlign = HorizontalAlign . Center ;
grvPlanEstrategicoTemp . Columns [ 8 ] . ItemStyle . HorizontalAlign = HorizontalAlign . Center ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R4M0" , ex ) ;
}
}
private void mostrarFilasPlanEstrategico ( int p_intFila ) //M1
{
try
{
divPlanEstrategico . Visible = false ;
divFormularioPlanEstrategico . Visible = false ;
switch ( p_intFila )
{
case 1 :
llenarGrvPlanEstrategico ( ) ;
divPlanEstrategico . Visible = true ;
break ;
case 2 :
llenarGrvPlanEstrategico ( ) ;
divFormularioPlanEstrategico . Visible = true ;
break ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R4M1" , ex ) ;
}
}
private void construirgrvCentroGestor ( ) //M2
{
try
{
grvCentroGestorTemp = ( GridView ) divListaCentrosGestores . FindControl ( "grvCentroGestor" ) ;
GridViewBoundField bdfPkCentroGestor = new GridViewBoundField ( "PKCENTROGESTOR" , "PK" , false , false , false ) ;
GridViewBoundField bdfProcedencia = new GridViewBoundField ( "NOMBREPROCEDENCIACENTROGESTOR" , "PROCEDENCIA" , 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 [ 3 ] . ItemStyle . HorizontalAlign = HorizontalAlign . Center ;
grvCentroGestorTemp . Columns [ 4 ] . ItemStyle . HorizontalAlign = HorizontalAlign . Center ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R4M2" , ex ) ;
}
}
private void mostrarFilasCentroGestor ( int p_intFila ) //M3
{
try
{
divListaCentrosGestores . Visible = false ;
divFormularioCentroGestor . Visible = false ;
switch ( p_intFila )
{
case 1 :
llenarGrvCentrosGestor ( ) ;
divListaCentrosGestores . Visible = true ;
break ;
case 2 :
llenarGrvCentrosGestor ( ) ;
divFormularioCentroGestor . Visible = true ;
break ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R4M3" , ex ) ;
}
}
private void limpiarCamposCG ( ) //M4
{
txtCEPreinversion . Text = string . Empty ;
txtCEEjecucion . Text = string . Empty ;
}
private void mostrarFilasTipoCambio ( int p_intFila ) //M5
{
try
{
divListadoTipoCambio . Visible = false ;
divFormularioTipoCambio . Visible = false ;
switch ( p_intFila )
{
case 1 :
llenarGrvTipoCambio ( ) ;
divListadoTipoCambio . Visible = true ;
break ;
case 2 :
llenarGrvTipoCambio ( ) ;
divFormularioTipoCambio . Visible = true ;
break ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R4M5" , ex ) ;
}
}
private void limpiarCamposTC ( ) //M6
{
txtMontoTipoCambio . Text = string . Empty ;
}
private void construirGrvTipoCambio ( ) //M7
{
try
{
grvTipoCambioTemp = ( GridView ) divListadoTipoCambio . 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 [ 3 ] . ItemStyle . HorizontalAlign = HorizontalAlign . Left ;
grvTipoCambioTemp . Columns [ 4 ] . ItemStyle . HorizontalAlign = HorizontalAlign . Center ;
grvTipoCambioTemp . Columns [ 5 ] . ItemStyle . HorizontalAlign = HorizontalAlign . Center ;
bdfMonto . DataFormatString = "{0:N2}" ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R4M7" , ex ) ;
}
}
#endregion
#region Metodos Controles a Datos ( R5 )
//private bool guardarDatosInfoGeneral() //M0
//{
// bool blnEjecutado = false;
// try
// {
// string strModo = ViewState["Modo_InfoGeneral"].ToString();
// objInformacionGeneralBL = new InformacionGeneralBL();
// objInformacionGeneralBL.objInformacionGeneralEL.Encargado = txtEncargado.Text;
// objInformacionGeneralBL.objInformacionGeneralEL.Region = Int32.Parse(ddlRegion.SelectedValue);
// objInformacionGeneralBL.objInformacionGeneralEL.Proyecto = Int32.Parse(Session["PKPROYECTO"].ToString());
// if (strModo == "Nuevo")
// {
// if (txtRegionAyA.Text = string.Empty)
// {
// ViewState["PkInformacionGeneral"] = objInformacionGeneralBL.insertarInformacionGeneral();
// blnEjecutado = true;
// GuardarEventoBitacora(
// Session["LOGIN"].ToString(),
// AccionBitacora.INSERT.ToString(),
// MensajesBitacora.IngresarRegistro + ": " + " Encargado: " + txtEncargado.Text + ", Región AyA: " + txtRegionAyA.Text + ", Provincia: " +
// ", Proyecto: " + txtProyecto.Text,
// "wfrInformacionGeneral.aspx");
// }
// else
// MensajeAdvertencia("Debe seleccionar una Región del AyA");
// }
// else if (strModo == "Modifica")
// {
// objInformacionGeneralBL.objInformacionGeneralEL.Proyecto = Int32.Parse(Session["PKPROYECTO"].ToString());
// if (objInformacionGeneralBL.actualizarInformacionGeneral())
// {
// blnEjecutado = true;
// GuardarEventoBitacora(
// Session["LOGIN"].ToString(),
// AccionBitacora.UPDATE.ToString(),
// MensajesBitacora.ModificarRegistro + ": " + " Encargado: " + txtEncargado.Text + ", Región AyA: " + txtRegionAyA.Text + ", Provincia: " +
// ", Proyecto: " + txtProyecto.Text,
// "wfrInformacionGenerals.aspx");
// }
// }
// }
// catch (Exception ex)
// {
// throw ex;
// blnEjecutado = false;
// General.ReportarError(ex, Session["LOGIN"].ToString());
// }
// return blnEjecutado;
//}
private bool guardarDatosPlanEstrategico ( ) //M1
{
bool blnEjecutado = false ;
try
{
string strModo = ViewState [ "Modo_PlanEstrategico" ] . ToString ( ) ;
objRelacionPlanEstrategicoBL = new RelacionPlanEstrategicoBL ( ) ;
objRelacionPlanEstrategicoBL . objRelacionPlanEstrategicoEL . TemaEstrategico = Int32 . Parse ( ddlTemaEstrategico . SelectedValue ) ;
objRelacionPlanEstrategicoBL . objRelacionPlanEstrategicoEL . Objetivo = Int32 . Parse ( ddlObjetivo . SelectedValue ) ;
objRelacionPlanEstrategicoBL . objRelacionPlanEstrategicoEL . Contribucion = Int32 . Parse ( ddlContribucion . SelectedValue ) ;
objRelacionPlanEstrategicoBL . objRelacionPlanEstrategicoEL . InformacionGeneral = Int32 . Parse ( ViewState [ "PkInformacionGeneral" ] . ToString ( ) ) ;
if ( strModo = = "Nuevo" )
{
if ( objRelacionPlanEstrategicoBL . insertarRelacionPlanEstrategico ( ) )
{
blnEjecutado = true ;
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . INSERT . ToString ( ) ,
MensajesBitacora . IngresarRegistro + ": Se ha ingresado el registro: " + " Tema Estratégico: " + ddlTemaEstrategico . SelectedItem . Text + ", Objetivo: " + ddlObjetivo . SelectedItem . Text + ", Contribución: " +
ddlContribucion . SelectedItem . Text + ", FKInformacionGeneral: " + ViewState [ "PkInformacionGeneral" ] . ToString ( ) ,
"wfrInformacionGeneral.aspx" ) ;
}
}
else if ( strModo = = "Modifica" )
{
objRelacionPlanEstrategicoBL . objRelacionPlanEstrategicoEL . PK = Int32 . Parse ( ViewState [ "PkPlanEstrategico" ] . ToString ( ) ) ;
if ( objRelacionPlanEstrategicoBL . actualizarRelacionPlanEstrategico ( ) )
{
blnEjecutado = true ;
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . INSERT . ToString ( ) ,
MensajesBitacora . ModificarRegistro + ": Se ha modificado el registro: " + " Tema Estratégico: " + ddlTemaEstrategico . SelectedItem . Text + ", Objetivo: " + ddlObjetivo . SelectedItem . Text + ", Contribución: " +
ddlContribucion . SelectedItem . Text + ", FKInformacionGeneral: " + ViewState [ "PkInformacionGeneral" ] . ToString ( ) ,
"wfrInformacionGeneral.aspx" ) ;
}
}
}
catch ( Exception ex )
{
throw ex ;
blnEjecutado = false ;
General . ReportarError ( ex , Session [ "LOGIN" ] . ToString ( ) ) ;
}
return blnEjecutado ;
}
private void eliminarDatosPlanEstrategico ( int p_intPKIndice ) //M2
{
try
{
objRelacionPlanEstrategicoBL = new RelacionPlanEstrategicoBL ( ) ;
objRelacionPlanEstrategicoBL . objRelacionPlanEstrategicoEL . PK = p_intPKIndice ;
objRelacionPlanEstrategicoBL . objRelacionPlanEstrategicoEL . ASTATE = false ;
objRelacionPlanEstrategicoBL . actualizaEstadoRelacionPlanEstrategico ( ) ;
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . DELETE . ToString ( ) ,
MensajesBitacora . EliminarRegistro + ": Se ha eliminado el registro: " + " Tema Estratégico: " + ddlTemaEstrategico . SelectedItem . Text + ", Objetivo: " + ddlObjetivo . SelectedItem . Text + ", Contribución: " +
ddlContribucion . SelectedItem . Text + ", FKInformacionGeneral: " + ViewState [ "PkInformacionGeneral" ] . ToString ( ) ,
"frwInformacionGeneral.aspx" ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R5M2" , ex ) ;
General . ReportarError ( ex , Session [ "LOGIN" ] . ToString ( ) ) ;
}
}
private bool guardarDatosCentroGestor ( ) //M3
{
bool blnEjecutado = false ;
try
{
string strModo = ViewState [ "Modo_CentroGestor" ] . ToString ( ) ;
objCentroGestorBL = new CentroGestorBL ( ) ;
objCentroGestorBL . objCentroGestorEL . Preinversion = txtCEPreinversion . Text ;
objCentroGestorBL . objCentroGestorEL . Ejecucion = txtCEEjecucion . Text ;
objCentroGestorBL . objCentroGestorEL . Procedencia = Int32 . Parse ( ddlProcedencia . SelectedValue ) ;
objCentroGestorBL . objCentroGestorEL . Proyecto = Int32 . Parse ( Session [ "PKPROYECTO" ] . ToString ( ) ) ;
if ( strModo = = "Nuevo" )
{
if ( objCentroGestorBL . insertarCentroGestor ( ) )
{
blnEjecutado = true ;
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . INSERT . ToString ( ) ,
MensajesBitacora . IngresarRegistro + ": Se ha ingresado el registro: " + " Centro Gestor PreInversion: " + txtCEPreinversion . Text + ", Centro Gestor Ejecución: " + txtCEEjecucion . Text + ", Procedencia: " +
ddlProcedencia . SelectedItem . Text + ", Proyecto: " + txtProyecto . Text ,
"wfrInformacionGeneral.aspx" ) ;
}
}
else if ( strModo = = "Modifica" )
{
objCentroGestorBL . objCentroGestorEL . PK = Int32 . Parse ( ViewState [ "PkCentroGestor" ] . ToString ( ) ) ;
if ( objCentroGestorBL . actualizarCentroGestor ( ) )
{
blnEjecutado = true ;
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . UPDATE . ToString ( ) ,
MensajesBitacora . ModificarRegistro + ": Se ha modificado el registro: " + " Centro Gestor PreInversion: " + txtCEPreinversion . Text + ", Centro Gestor Ejecución: " + txtCEEjecucion . Text + ", Procedencia: " +
ddlProcedencia . SelectedItem . Text + ", Proyecto: " + txtProyecto . Text ,
"wfrInformacionGeneral.aspx" ) ;
}
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R5M3" , ex ) ;
blnEjecutado = false ;
General . ReportarError ( ex , Session [ "LOGIN" ] . ToString ( ) ) ;
}
return blnEjecutado ;
}
private void eliminarDatosCentroGestor ( int p_intPKIndice ) //M4
{
try
{
objCentroGestorBL = new CentroGestorBL ( ) ;
objCentroGestorBL . objCentroGestorEL . PK = p_intPKIndice ;
objCentroGestorBL . objCentroGestorEL . ASTATE = false ;
objCentroGestorBL . actualizaEstadoCentroGestor ( ) ;
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . DELETE . ToString ( ) ,
MensajesBitacora . EliminarRegistro + ": Se ha eliminado el registro: " + " Centro Gestor PreInversion: " + txtCEPreinversion . Text + ", Centro Gestor Ejecución: " + txtCEEjecucion . Text + ", Procedencia: " +
ddlProcedencia . SelectedItem . Text + ", Proyecto: " + txtProyecto . Text ,
"frwInformacionGeneral.aspx" ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R5M4" , ex ) ;
General . ReportarError ( ex , Session [ "LOGIN" ] . ToString ( ) ) ;
}
}
private bool guardarDatosTipoCambio ( ) //M5
{
bool blnEjecutado = false ;
try
{
string strModo = ViewState [ "Modo_TipoCambio" ] . ToString ( ) ;
objTipoCambioBL = new TipoCambioBL ( ) ;
objTipoCambioBL . objTipoCambioEL . Moneda = ddlMoneda . SelectedItem . Text ;
objTipoCambioBL . objTipoCambioEL . Monto = Decimal . Parse ( txtMontoTipoCambio . Text ) ;
objTipoCambioBL . objTipoCambioEL . Anio = Int32 . Parse ( ddlAnio . SelectedItem . Text ) ;
objTipoCambioBL . objTipoCambioEL . Proyecto = Int32 . Parse ( Session [ "PKPROYECTO" ] . ToString ( ) ) ;
if ( strModo = = "Nuevo" )
{
if ( objTipoCambioBL . insertarTipoCambio ( ) )
{
blnEjecutado = true ;
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . INSERT . ToString ( ) ,
MensajesBitacora . IngresarRegistro + ": Se ha ingresado el registro: " + " Moneda: " + ddlMoneda . SelectedItem . Text + " Tipo Cambio: " +
Decimal . Parse ( txtMontoTipoCambio . Text ) . ToString ( "#,###.##" ) + ", Año: " + ddlAnio . SelectedItem . Text + ", Proyecto: " + txtProyecto . Text ,
"wfrInformacionGeneral.aspx" ) ;
}
}
else if ( strModo = = "Modifica" )
{
objTipoCambioBL . objTipoCambioEL . PK = Int32 . Parse ( ViewState [ "PkTipoCambio" ] . ToString ( ) ) ;
if ( objTipoCambioBL . actualizarTipoCambio ( ) )
{
blnEjecutado = true ;
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . UPDATE . ToString ( ) ,
MensajesBitacora . ModificarRegistro + ": Se ha ingresado el registro: " + " Moneda: " + ddlMoneda . SelectedItem . Text + " Tipo Cambio: " +
Decimal . Parse ( txtMontoTipoCambio . Text ) . ToString ( "#,###.##" ) + ", Año: " + ddlAnio . SelectedItem . Text + ", Proyecto: " + txtProyecto . Text ,
"wfrInformacionGeneral.aspx" ) ;
}
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R5M5" , ex ) ;
blnEjecutado = false ;
General . ReportarError ( ex , Session [ "LOGIN" ] . ToString ( ) ) ;
}
return blnEjecutado ;
}
private void eliminarDatosTipoCambio ( int p_intPKIndice ) //M6
{
try
{
objTipoCambioBL = new TipoCambioBL ( ) ;
objTipoCambioBL . objTipoCambioEL . PK = p_intPKIndice ;
objTipoCambioBL . objTipoCambioEL . ASTATE = false ;
objTipoCambioBL . actualizaEstadoTipoCambio ( ) ;
GuardarEventoBitacora (
Session [ "LOGIN" ] . ToString ( ) ,
AccionBitacora . DELETE . ToString ( ) ,
MensajesBitacora . EliminarRegistro + ": Se ha eliminado el registro: " + " Moneda: " + ddlMoneda . SelectedItem . Text + " Centro Gestor PreInversion: " +
txtCEPreinversion . Text + ", Centro Gestor Ejecución: " + txtCEEjecucion . Text + ", " +
"Procedencia: " + ddlProcedencia . SelectedItem . Text + ", Proyecto: " + txtProyecto . Text ,
"frwInformacionGeneral.aspx" ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R5M6" , ex ) ;
General . ReportarError ( ex , Session [ "LOGIN" ] . ToString ( ) ) ;
}
}
#endregion
#region Metodos Datos a Controles ( R6 )
private void mostrarDatosInfoGeneral ( ) //M0
{
try
{
objInformacionGeneralBL = new InformacionGeneralBL ( ) ;
objInformacionGeneralBL . objInformacionGeneralEL . Proyecto = Int32 . Parse ( Session [ "PKPROYECTO" ] . ToString ( ) ) ;
DataSet dsInformacion = objInformacionGeneralBL . getInformacionGeneral ( ) ;
if ( dsInformacion . Tables [ 0 ] . Rows . Count ! = 0 )
{
ViewState [ "PkInformacionGeneral" ] = dsInformacion . Tables [ 0 ] . Rows [ 0 ] [ "PKINFORMACIONGENERAL" ] . ToString ( ) ; ;
txtEncargado . Text = dsInformacion . Tables [ 0 ] . Rows [ 0 ] [ "ENCARGADOINFORMACIONGENERAL" ] . ToString ( ) ;
txtRegionAyA . Text = dsInformacion . Tables [ 0 ] . Rows [ 0 ] [ "NOMBREREGION" ] . ToString ( ) ;
//ddlRegion.SelectedValue = dsInformacion.Tables[0].Rows[0]["PKREGION"].ToString();
ViewState [ "Modo_InfoGeneral" ] = "Modifica" ;
}
else if ( dsInformacion . Tables [ 0 ] . Rows . Count = = 0 )
{
ViewState [ "Modo_InfoGeneral" ] = "Nuevo" ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R6M0" , ex ) ;
General . ReportarError ( ex , Session [ "LOGIN" ] . ToString ( ) ) ;
}
}
private void llenarGrvPlanEstrategico ( ) //M1
{
try
{
objRelacionPlanEstrategicoBL = new RelacionPlanEstrategicoBL ( ) ;
objRelacionPlanEstrategicoBL . objRelacionPlanEstrategicoEL . Proyecto = Int32 . Parse ( Session [ "PKPROYECTO" ] . ToString ( ) ) ;
objRelacionPlanEstrategicoBL . objRelacionPlanEstrategicoEL . PK = 0 ;
DataSet dsRelacionPE = objRelacionPlanEstrategicoBL . getRelacionPlanEstrategico ( ) ;
detalleGRVDatos ( dsRelacionPE , grvPlanEstrategico ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R6M1" , ex ) ;
}
}
private void mostrarDatosPlanEstrategico ( ) //M2
{
try
{
objRelacionPlanEstrategicoBL = new RelacionPlanEstrategicoBL ( ) ;
objRelacionPlanEstrategicoBL . objRelacionPlanEstrategicoEL . Proyecto = Int32 . Parse ( Session [ "PKPROYECTO" ] . ToString ( ) ) ;
objRelacionPlanEstrategicoBL . objRelacionPlanEstrategicoEL . PK = 0 ;
DataSet dsPlanEstrategico = objRelacionPlanEstrategicoBL . getRelacionPlanEstrategico ( ) ;
if ( dsPlanEstrategico . Tables [ 0 ] . Rows . Count ! = 0 )
{
ddlTemaEstrategico . SelectedValue = dsPlanEstrategico . Tables [ 0 ] . Rows [ 0 ] [ "PKTEMAESTRATEGICO" ] . ToString ( ) ;
ddlPerspectiva . SelectedValue = dsPlanEstrategico . Tables [ 0 ] . Rows [ 0 ] [ "PKPERSPECTIVA" ] . ToString ( ) ;
llenarDDLObjetivo ( ) ;
ddlObjetivo . SelectedValue = dsPlanEstrategico . Tables [ 0 ] . Rows [ 0 ] [ "PKOBJETIVO" ] . ToString ( ) ;
ddlContribucion . SelectedValue = dsPlanEstrategico . Tables [ 0 ] . Rows [ 0 ] [ "PKCATALOGO" ] . ToString ( ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R6M1" , ex ) ;
}
}
private void llenarDDLTemaEstrategico ( ) //M3
{
try
{
//Limpia el control
ddlTemaEstrategico . Items . Clear ( ) ;
//Instancia el objeto
objTemaEstrategicoBL = new TemaEstrategicoBL ( ) ;
objTemaEstrategicoBL . objTemaEstrategicoEL . PK = 0 ;
objTemaEstrategicoBL . objTemaEstrategicoEL . ASTATE = true ;
//Carga la información en un dataset
DataSet dsTemaEstrategico = objTemaEstrategicoBL . getTemaEstrategico ( ) ;
if ( dsTemaEstrategico . Tables [ 0 ] . Rows . Count ! = 0 )
{
ddlTemaEstrategico . DataSource = dsTemaEstrategico ;
ddlTemaEstrategico . DataTextField = dsTemaEstrategico . Tables [ 0 ] . Columns [ "NOMBRETEMAESTRATEGICO" ] . ColumnName ;
ddlTemaEstrategico . DataValueField = dsTemaEstrategico . Tables [ 0 ] . Columns [ "PKTEMAESTRATEGICO" ] . ColumnName ;
ddlTemaEstrategico . DataBind ( ) ;
ddlTemaEstrategico . Items . Insert ( 0 , new ListItem ( "Seleccione un Tema Estratégico" , "-1" ) ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R6M3" , ex ) ;
}
}
private void llenarDDLPerspectiva ( ) //M4
{
try
{
//Limpia el control
ddlPerspectiva . Items . Clear ( ) ;
//Instancia el objeto
objPerspectivaBL = new PerspectivaBL ( ) ;
objPerspectivaBL . objPerspectivaEL . PK = 0 ;
objPerspectivaBL . objPerspectivaEL . ASTATE = true ;
//Carga la información en un dataset
DataSet dsPerspectiva = objPerspectivaBL . getPerspectiva ( ) ;
if ( dsPerspectiva . Tables [ 0 ] . Rows . Count ! = 0 )
{
ddlPerspectiva . DataSource = dsPerspectiva ;
ddlPerspectiva . DataTextField = dsPerspectiva . Tables [ 0 ] . Columns [ "NOMBREPERSPECTIVA" ] . ColumnName ;
ddlPerspectiva . DataValueField = dsPerspectiva . Tables [ 0 ] . Columns [ "PKPERSPECTIVA" ] . ColumnName ;
ddlPerspectiva . DataBind ( ) ;
ddlPerspectiva . Items . Insert ( 0 , new ListItem ( "Seleccione una Perspectiva" , "-1" ) ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R6M4" , ex ) ;
}
}
private void llenarDDLObjetivo ( ) //M5
{
try
{
//Limpia el control
ddlObjetivo . Items . Clear ( ) ;
//Instancia el objeto
objObjetivoBL = new ObjetivoBL ( ) ;
objObjetivoBL . objObjetivoEL . PK = 0 ;
objObjetivoBL . objObjetivoEL . Perspectiva = Int32 . Parse ( ddlPerspectiva . SelectedValue ) ;
DataSet dsObjetivo = objObjetivoBL . getListaObjetivos ( ) ;
if ( dsObjetivo . Tables [ 0 ] . Rows . Count ! = 0 )
{
ddlObjetivo . DataSource = dsObjetivo ;
ddlObjetivo . DataTextField = dsObjetivo . Tables [ 0 ] . Columns [ "DESCRIPCIONOBJETIVO" ] . ColumnName ;
ddlObjetivo . DataValueField = dsObjetivo . Tables [ 0 ] . Columns [ "PKOBJETIVO" ] . ColumnName ;
ddlObjetivo . DataBind ( ) ;
}
ddlObjetivo . Items . Insert ( 0 , new ListItem ( "Seleccione un Objetivo" , "-1" ) ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R6M5" , ex ) ;
}
}
private void llenarDDLContribucion ( ) //M6
{
try
{
//Limpia el control
ddlContribucion . Items . Clear ( ) ;
//Instancia el objeto
objCatalogoBL = new CatalogoBL ( ) ;
objCatalogoBL . objCatalogoEL . PK = 0 ;
objCatalogoBL . objCatalogoEL . Padre = 33 ;
objCatalogoBL . objCatalogoEL . ASTATE = true ;
//Carga la información en un dataset
DataSet dsContribucion = objCatalogoBL . getCatalogo ( ) ;
if ( dsContribucion . Tables [ 0 ] . Rows . Count ! = 0 )
{
ddlContribucion . DataSource = dsContribucion ;
ddlContribucion . DataTextField = dsContribucion . Tables [ 0 ] . Columns [ "NOMBRECATALOGO" ] . ColumnName ;
ddlContribucion . DataValueField = dsContribucion . Tables [ 0 ] . Columns [ "PKCATALOGO" ] . ColumnName ;
ddlContribucion . DataBind ( ) ;
ddlContribucion . Items . Insert ( 0 , new ListItem ( "Seleccione la Contribucion" , "-1" ) ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R6M6" , ex ) ;
}
}
//private void llenarDDLRegion() //M7
//{
// try
// {
// //Limpia el control
// ddlRegion.Items.Clear();
// //Instancia el objeto
// objRegionBL = new RegionBL();
// objRegionBL.objRegionEL.PK = 0;
// objRegionBL.objRegionEL.Padre = 1;
// 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 un Región", "-1"));
// }
// }
// catch (Exception ex)
// {
// MensajeError("Error en R6M7", ex);
// }
//}
private void llenarGrvCentrosGestor ( ) //M8
{
try
{
objCentroGestorBL = new CentroGestorBL ( ) ;
objCentroGestorBL . objCentroGestorEL . Proyecto = Int32 . Parse ( Session [ "PKPROYECTO" ] . ToString ( ) ) ;
objCentroGestorBL . objCentroGestorEL . PK = 0 ;
DataSet dsCentroCostos = objCentroGestorBL . getCentroGestor ( ) ;
detalleGRVDatos ( dsCentroCostos , grvCentroGestor ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R6M8" , ex ) ;
}
}
private void mostrarDatosCentroGestor ( ) //M9
{
try
{
limpiarCamposCG ( ) ;
objCentroGestorBL = new CentroGestorBL ( ) ;
objCentroGestorBL . objCentroGestorEL . Proyecto = 0 ;
objCentroGestorBL . objCentroGestorEL . PK = Int32 . Parse ( ViewState [ "PkCentroGestor" ] . ToString ( ) ) ;
DataSet dsCentroGestor = objCentroGestorBL . getCentroGestor ( ) ;
if ( dsCentroGestor . Tables [ 0 ] . Rows . Count ! = 0 )
{
txtCEPreinversion . Text = dsCentroGestor . Tables [ 0 ] . Rows [ 0 ] [ "PREINVERSIONCENTROGESTOR" ] . ToString ( ) ;
txtCEEjecucion . Text = dsCentroGestor . Tables [ 0 ] . Rows [ 0 ] [ "EJECUCIONCENTROGESTOR" ] . ToString ( ) ;
ddlProcedencia . SelectedValue = dsCentroGestor . Tables [ 0 ] . Rows [ 0 ] [ "PKPROCEDENCIACENTROGESTOR" ] . ToString ( ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R6M9" , ex ) ;
}
}
private void llenarddlProcedencia ( ) //M10
{
try
{
//Limpia el control
ddlProcedencia . Items . Clear ( ) ;
//Instancia el objeto
objProcedenciaCentrogestorBL = new ProcedenciaCentrogestorBL ( ) ;
objProcedenciaCentrogestorBL . objProcedenciaCentrogestorEL . PK = 0 ;
objProcedenciaCentrogestorBL . objProcedenciaCentrogestorEL . ASTATE = true ;
DataSet dsProcedencia = objProcedenciaCentrogestorBL . GetProcedenciaCentrogestor ( ) ;
ddlProcedencia . DataSource = dsProcedencia ;
ddlProcedencia . DataTextField = dsProcedencia . Tables [ 0 ] . Columns [ "NOMBREPROCEDENCIACENTROGESTOR" ] . ColumnName ;
ddlProcedencia . DataValueField = dsProcedencia . Tables [ 0 ] . Columns [ "PKPROCEDENCIACENTROGESTOR" ] . ColumnName ;
ddlProcedencia . DataBind ( ) ;
ddlProcedencia . Items . Insert ( 0 , new ListItem ( "Seleccione la Procedencia" , "-1" ) ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R6M10" , ex ) ;
}
}
private void llenarGrvTipoCambio ( ) //M11
{
try
{
objTipoCambioBL = new TipoCambioBL ( ) ;
objTipoCambioBL . objTipoCambioEL . Proyecto = Int32 . Parse ( Session [ "PKPROYECTO" ] . ToString ( ) ) ;
objTipoCambioBL . objTipoCambioEL . PK = 0 ;
DataSet dsTipoCambio = objTipoCambioBL . getTipoCambio ( ) ;
detalleGRVDatos ( dsTipoCambio , grvTipoCambio ) ;
}
catch ( Exception ex )
{
MensajeError ( "Error en R6M11" , ex ) ;
}
}
private void mostrarDatosTipoCambio ( ) //M12
{
try
{
limpiarCamposTC ( ) ;
objTipoCambioBL = new TipoCambioBL ( ) ;
objTipoCambioBL . objTipoCambioEL . Proyecto = 0 ;
objTipoCambioBL . objTipoCambioEL . PK = Int32 . Parse ( ViewState [ "PkTipoCambio" ] . ToString ( ) ) ;
DataSet dsTipoCambio = objTipoCambioBL . getTipoCambio ( ) ;
if ( dsTipoCambio . Tables [ 0 ] . Rows . Count ! = 0 )
{
ddlMoneda . SelectedItem . Text = dsTipoCambio . Tables [ 0 ] . Rows [ 0 ] [ "MONEDATIPOCAMBIO" ] . ToString ( ) ;
txtMontoTipoCambio . Text = dsTipoCambio . Tables [ 0 ] . Rows [ 0 ] [ "MONTOTIPOCAMBIO" ] . ToString ( ) ;
ddlAnio . SelectedItem . Text = dsTipoCambio . Tables [ 0 ] . Rows [ 0 ] [ "ANIOTIPOCAMBIO" ] . ToString ( ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R6M12" , ex ) ;
}
}
private void llenarDDLAnio ( ) //M13
{
try
{
//Limpia el control
ddlAnio . Items . Clear ( ) ;
ListItem lstAnios = new ListItem ( "Seleccione un Año" ) ;
ddlAnio . Items . Add ( lstAnios ) ;
for ( int i = DateTime . Now . Year - 7 ; i < = DateTime . Now . Year + 7 ; i + + )
{
lstAnios = new ListItem ( i . ToString ( ) ) ;
ddlAnio . Items . Add ( lstAnios ) ;
}
}
catch ( Exception ex )
{
MensajeError ( "Error en R6M13" , ex ) ;
}
}
#endregion
}