694 lines
No EOL
24 KiB
C#
694 lines
No EOL
24 KiB
C#
/*===========================================================================================================================
|
||
* Instituto Costarricense de Acueductos y Alcantarillados. - 2015
|
||
* Formularios para Proyectos de Inversión
|
||
* Nombre de la Pantalla: frwDistribucionPartidas.aspx
|
||
*
|
||
* Explicación de los contenidos del archivo
|
||
*===========================================================================================================================
|
||
* HISTORIAL
|
||
*
|
||
* PERSONA DIA – MES - AÑO DESCRIPCIÓN
|
||
* Esteban Gutierrez Rapso 05 – 12 - 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.PPP;
|
||
using AyABL.AGP;
|
||
using AyABL.ADM;
|
||
|
||
public partial class webforms_PPP_wfrDistribucionPartidas : 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);
|
||
|
||
construirgrvPartidas();
|
||
construirgrvDetalle();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R0M1", ex);
|
||
}
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Variables (R1)
|
||
|
||
GridView grvPartidasTemp, grvDetalleTemp;
|
||
|
||
ProyectoBL objProyectoBL;
|
||
DistribucionPartidaBL objDistribucionPartidaBL;
|
||
PartidaPresupuestariaBL objPartidaPresupuestariaBL;
|
||
|
||
|
||
|
||
#endregion
|
||
|
||
#region Eventos Formulario (R2)
|
||
|
||
protected void Page_Load(object sender, EventArgs e) //M0
|
||
{
|
||
try
|
||
{
|
||
if ((!IsPostBack) && (Session.Count > 0))
|
||
{
|
||
llenarDDLProyecto();
|
||
llenarDDLPartida();
|
||
llenarDDLAnio();
|
||
ComandosxMenu();
|
||
|
||
if (Session["PKPROYECTO"] != null)
|
||
{
|
||
ddlProyecto.SelectedValue = Session["PKPROYECTO"].ToString();
|
||
|
||
ddlProyecto_SelectedIndexChanged(null, null);
|
||
}
|
||
|
||
mostrarDetalle(1);
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R2M0", ex);
|
||
}
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Eventos Controles Web (R3)
|
||
|
||
/// <summary>
|
||
/// Activa el evento del boton Nuevo
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
|
||
protected void btnNuevo_Click(object sender, EventArgs e) //M0
|
||
{
|
||
try
|
||
{
|
||
|
||
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M0", ex);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Activa el evento del boton guardar.1
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
|
||
protected void btnGuardar_Click(object sender, EventArgs e) //M1
|
||
{
|
||
try
|
||
{
|
||
if (GuardarDatos())
|
||
{
|
||
MensajeInformativo("El registro fue almacenado exitosamente");
|
||
|
||
llenarGRVDetalle();
|
||
llenarGRVPartida();
|
||
mostrarDetalle(1);
|
||
}
|
||
else
|
||
{
|
||
MensajeError("El registro no fue almacenado, verifique", null);
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M1", ex);
|
||
}
|
||
}
|
||
|
||
protected void ddlProyecto_SelectedIndexChanged(object sender, EventArgs e) //M3
|
||
{
|
||
try
|
||
{
|
||
Session["PKPROYECTO"] = ddlProyecto.SelectedValue;
|
||
|
||
llenarGRVPartida();
|
||
llenarGRVDetalle();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M3", ex);
|
||
}
|
||
}
|
||
|
||
|
||
protected void grvDetalle_RowCommand(object sender, GridViewCommandEventArgs e) //M4
|
||
{
|
||
try
|
||
{
|
||
if (e.CommandName == "editar")
|
||
{
|
||
int i = Convert.ToInt32(e.CommandArgument);
|
||
GridViewRow selectedRow = grvDetalle.Rows[i];
|
||
ViewState["PkPartida"] = Convert.ToInt32(selectedRow.Cells[2].Text);
|
||
|
||
mostrarDetalle();
|
||
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M4", ex);
|
||
}
|
||
}
|
||
|
||
protected void btnDetalle_Click(object sender, EventArgs e) //M5
|
||
{
|
||
try
|
||
{
|
||
mostrarDetalle(2);
|
||
|
||
llenarGRVDetalle();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M5", ex);
|
||
}
|
||
}
|
||
|
||
protected void btnEliminar_Click(object sender, EventArgs e) //M6
|
||
{
|
||
try
|
||
{
|
||
// recorro el grid
|
||
foreach (GridViewRow row in grvDetalle.Rows)
|
||
{
|
||
HtmlInputCheckBox chkTemp = (HtmlInputCheckBox)row.Controls[0].Controls[1];
|
||
if (chkTemp != null)
|
||
{
|
||
// si el registro esta marcado
|
||
if (chkTemp.Checked)
|
||
{
|
||
int intPkIndice = Convert.ToInt32(row.Cells[2].Text);
|
||
eliminarPartida(intPkIndice);
|
||
}
|
||
}
|
||
}
|
||
|
||
llenarGRVDetalle();
|
||
llenarGRVPartida();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M11", ex);
|
||
}
|
||
}
|
||
|
||
protected void btnModificar_Click(object sender, EventArgs e) //M7
|
||
{
|
||
try
|
||
{
|
||
if (ModificarDatos())
|
||
{
|
||
mostrarDetalle(1);
|
||
MensajeInformativo("El registro fue modificado exitosamente");
|
||
}
|
||
else
|
||
{
|
||
MensajeError("El registro no fue modificado, verifique", null);
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R3M7", ex);
|
||
}
|
||
}
|
||
|
||
protected void btnVolver_Click(object sender, EventArgs e) //M8
|
||
{
|
||
mostrarDetalle(1);
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Metodos Personalizados (R4)
|
||
|
||
private void ComandosxMenu() //M0
|
||
{
|
||
try
|
||
{
|
||
DataSet dsComandos = getComandos();
|
||
|
||
if (dsComandos != null)
|
||
{
|
||
foreach (DataRow drTemp in dsComandos.Tables[0].Rows)
|
||
{
|
||
switch (drTemp["NOMBRECOMANDO"].ToString().ToUpper())
|
||
{
|
||
case "NUEVO":
|
||
break;
|
||
case "ELIMINAR":
|
||
btnEliminar.Visible = true;
|
||
break;
|
||
case "MODIFICA":
|
||
//Inicio de variable tipo VIEWSTATE
|
||
ViewState["PUEDEMODIFICAR"] = true;
|
||
btnGuardar.Visible = true;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M0", ex);
|
||
}
|
||
}
|
||
|
||
|
||
private void construirgrvPartidas() //M1
|
||
{
|
||
try
|
||
{
|
||
grvPartidasTemp = (GridView)divDatosInferiores.FindControl("grvPartidas");
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M1", ex);
|
||
}
|
||
}
|
||
|
||
public static void detalleGRVDatos(DataSet p_dsDatos, GridView p_grvGridView) //M2
|
||
{
|
||
try
|
||
{
|
||
p_grvGridView.ShowHeader = true;
|
||
p_grvGridView.DataSource = p_dsDatos;
|
||
p_grvGridView.DataBind();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
|
||
}
|
||
}
|
||
|
||
private void construirgrvDetalle() //M3
|
||
{
|
||
try
|
||
{
|
||
grvDetalleTemp = (GridView)divDatosInferiores.FindControl("grvDetalle");
|
||
|
||
GridViewBoundField bdfPkDistribucionPartida = new GridViewBoundField("PKDISTRIBUCIONPARTIDA", "PK", false, false, false);
|
||
GridViewBoundField bdfPkPartida = new GridViewBoundField("PKPARTIDAPRESUPUESTARIA", "PK", false, false, false);
|
||
GridViewBoundField bdfIndice = new GridViewBoundField("INDICEPARTIDAPRESUPUESTARIA", "INDICE", true, false, true);
|
||
GridViewBoundField bdfNombrePartida = new GridViewBoundField("NOMBREPARTIDAPRESUPUESTARIA", "PARTIDA", true, false, true);
|
||
GridViewBoundField bdfAnio = new GridViewBoundField("ANIODISTRIBUCIONPARTIDA", "AÑO", true, false, true);
|
||
GridViewBoundField bdfMonto = new GridViewBoundField("MONTODISTRIBUCIONPARTIDA", "MONTO", true, false, true);
|
||
GridViewBoundField bdfFkProyecto = new GridViewBoundField("FKPROYECTO", "PROYECTO", true, false, false);
|
||
|
||
grvDetalleTemp.Columns.Add(bdfPkDistribucionPartida);
|
||
grvDetalleTemp.Columns.Add(bdfPkPartida);
|
||
grvDetalleTemp.Columns.Add(bdfIndice);
|
||
grvDetalleTemp.Columns.Add(bdfNombrePartida);
|
||
grvDetalleTemp.Columns.Add(bdfAnio);
|
||
grvDetalleTemp.Columns.Add(bdfMonto);
|
||
grvDetalleTemp.Columns.Add(bdfFkProyecto);
|
||
|
||
grvDetalleTemp.Columns[0].ItemStyle.Width = 25;
|
||
grvDetalleTemp.Columns[1].ItemStyle.Width = 25;
|
||
grvDetalleTemp.Columns[4].ItemStyle.HorizontalAlign = HorizontalAlign.Center;
|
||
grvDetalleTemp.Columns[6].ItemStyle.HorizontalAlign = HorizontalAlign.Center;
|
||
grvDetalleTemp.Columns[7].ItemStyle.HorizontalAlign = HorizontalAlign.Right;
|
||
|
||
bdfMonto.DataFormatString = "{0:N2}";
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M3", ex);
|
||
}
|
||
}
|
||
|
||
private void mostrarDetalle(int p_intFila) //M4
|
||
{
|
||
try
|
||
{
|
||
divTabulado.Visible = false;
|
||
divDetalle.Visible = false;
|
||
|
||
switch (p_intFila)
|
||
{
|
||
case 1:
|
||
divTabulado.Visible = true;
|
||
btnModificar.Visible = false;
|
||
btnGuardar.Visible = true;
|
||
break;
|
||
case 2:
|
||
divDetalle.Visible = true;
|
||
btnModificar.Visible = true;
|
||
btnGuardar.Visible = false;
|
||
break;
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R4M4", ex);
|
||
}
|
||
}
|
||
|
||
private void limpiarCampos() //M5
|
||
{
|
||
llenarDDLPartida();
|
||
llenarDDLAnio();
|
||
txtMonto.Text = string.Empty;
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Metodos Controles a Datos (R5)
|
||
|
||
/// <summary>
|
||
/// guarda y modifica registros en la tabla.
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
private bool GuardarDatos() //M0
|
||
{
|
||
bool blnEjecutado = false;
|
||
|
||
try
|
||
{
|
||
string strModo = string.Empty;
|
||
|
||
objDistribucionPartidaBL = new DistribucionPartidaBL();
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.Anio = Int32.Parse(ddlAnio.SelectedItem.Text);
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.Monto = Decimal.Parse(txtMonto.Text);
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.PartidaPresupuestaria = Int32.Parse(ddlPartida.SelectedValue);
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
|
||
if (objDistribucionPartidaBL.insertarDistribucionPartida())
|
||
{
|
||
blnEjecutado = true;
|
||
|
||
GuardarEventoBitacora(
|
||
Session["LOGIN"].ToString(),
|
||
AccionBitacora.INSERT.ToString(),
|
||
MensajesBitacora.IngresarRegistro + ": " + " Año: " + ddlAnio.SelectedItem.Text + " Monto: " + Decimal.Parse(txtMonto.Text).ToString("###,###,###.#0") + " Partida: " +
|
||
ddlPartida.SelectedItem.Text,
|
||
"frwDistribucionPartida.aspx");
|
||
|
||
llenarGRVPartida();
|
||
}
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
blnEjecutado = false;
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
return blnEjecutado;
|
||
}
|
||
|
||
private bool ModificarDatos() //M1
|
||
{
|
||
bool blnEjecutado = false;
|
||
|
||
try
|
||
{
|
||
|
||
|
||
objDistribucionPartidaBL = new DistribucionPartidaBL();
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.Anio = Int32.Parse(ddlAnio.SelectedItem.Text);
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.Monto = Decimal.Parse(txtMonto.Text);
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.PartidaPresupuestaria = Int32.Parse(ddlPartida.SelectedValue);
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
|
||
|
||
if (bool.Parse(ViewState["PUEDEMODIFICAR"].ToString()) == true)
|
||
{
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.PK = Int32.Parse(ViewState["PkPartida"].ToString());
|
||
|
||
if (objDistribucionPartidaBL.actualizarDistribucionPartida())
|
||
{
|
||
blnEjecutado = true;
|
||
|
||
GuardarEventoBitacora(Session["LOGIN"].ToString(),
|
||
AccionBitacora.UPDATE.ToString(),
|
||
MensajesBitacora.ModificarRegistro + ": " + " Año: " + ddlAnio.SelectedItem.Text + " Monto: " + Decimal.Parse(txtMonto.Text).ToString("###,###,###.#0") + " Partida: " + ddlPartida.SelectedItem.Text,
|
||
"frwDistribucionPartidas.aspx");
|
||
}
|
||
|
||
llenarGRVPartida();
|
||
}
|
||
else
|
||
MensajeAdvertencia("Su rol no le permite actualizar el registro");
|
||
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
throw ex;
|
||
blnEjecutado = false;
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
return blnEjecutado;
|
||
}
|
||
|
||
private void eliminarPartida(int p_intPKPartida) //M2
|
||
{
|
||
try
|
||
{
|
||
objDistribucionPartidaBL = new DistribucionPartidaBL();
|
||
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.PK = p_intPKPartida;
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.ASTATE = false;
|
||
objDistribucionPartidaBL.actualizaEstadoDistribucionPartida();
|
||
|
||
foreach (GridViewRow row in grvDetalle.Rows)
|
||
{
|
||
HtmlInputCheckBox chkTemp = (HtmlInputCheckBox)row.Controls[0].Controls[1];
|
||
if (chkTemp != null)
|
||
{
|
||
// si el registro esta marcado
|
||
if (chkTemp.Checked)
|
||
{
|
||
GuardarEventoBitacora(Session["LOGIN"].ToString(),
|
||
AccionBitacora.DELETE.ToString(),
|
||
MensajesBitacora.EliminarRegistro + ": PK: " + row.Cells[2].Text + " Indice: " + row.Cells[4].Text + " Partida: " + row.Cells[5].Text + " Año: " + row.Cells[6].Text + " Monto: " + row.Cells[7].Text,
|
||
"frwDistribucionPartidas.aspx");
|
||
}
|
||
}
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R5M2", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Metodos Datos a Controles (R6)
|
||
|
||
private void llenarGRVPartida() //M0
|
||
{
|
||
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 R6M0", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarDDLProyecto() //M1
|
||
{
|
||
try
|
||
{
|
||
//Instancia el objeto
|
||
objProyectoBL = new ProyectoBL();
|
||
|
||
objProyectoBL.objProyectoEL.PK = 0;
|
||
objProyectoBL.objProyectoEL.ASTATE = true;
|
||
objProyectoBL.objProyectoEL.CodigoAcceso = Session["CODIGOACCESO"].ToString();
|
||
|
||
//Carga la información en un dataset
|
||
DataSet dsProyecto = objProyectoBL.getProyectos();
|
||
|
||
ddlListaProyectos(dsProyecto, ddlProyecto);
|
||
ddlProyecto.Attributes["style"] = "width: 90%; max-width: 90%";
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M1", ex);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// LLena del dropdownlist con las prioridades del proyecto
|
||
/// </summary>
|
||
|
||
private void llenarDDLPartida() //M2
|
||
{
|
||
try
|
||
{
|
||
//Limpia el control
|
||
ddlPartida.Items.Clear();
|
||
//Instancia el objeto
|
||
objPartidaPresupuestariaBL = new PartidaPresupuestariaBL();
|
||
|
||
objPartidaPresupuestariaBL.objPartidaPresupuestariaEL.PK = 0;
|
||
objPartidaPresupuestariaBL.objPartidaPresupuestariaEL.ASTATE = true;
|
||
//Carga la información en un dataset
|
||
DataSet dsPartida = objPartidaPresupuestariaBL.getPartidaPresupuestaria();
|
||
if (dsPartida.Tables[0].Rows.Count != 0)
|
||
{
|
||
ddlPartida.DataSource = dsPartida;
|
||
ddlPartida.DataTextField = dsPartida.Tables[0].Columns["NOMBREPARTIDAPRESUPUESTARIA"].ColumnName;
|
||
ddlPartida.DataValueField = dsPartida.Tables[0].Columns["PKPARTIDAPRESUPUESTARIA"].ColumnName;
|
||
ddlPartida.DataBind();
|
||
|
||
ddlPartida.Items.Insert(0, new ListItem("Seleccione una Partida Presupuestatia", "-1"));
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M2", ex);
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// Llena el dropdownlist con las dependencias del proyecto
|
||
/// </summary>
|
||
private void llenarDDLAnio() //M3
|
||
{
|
||
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 R6M3", ex);
|
||
}
|
||
}
|
||
|
||
private void mostrarDetalle() //M4
|
||
{
|
||
try
|
||
{
|
||
objDistribucionPartidaBL = new DistribucionPartidaBL();
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.PK = Int32.Parse(ViewState["PkPartida"].ToString());
|
||
DataSet dsPartida = objDistribucionPartidaBL.getDetalle();
|
||
if (dsPartida.Tables[0].Rows.Count > 0)
|
||
{
|
||
ddlPartida.SelectedValue = dsPartida.Tables[0].Rows[0]["PKPARTIDAPRESUPUESTARIA"].ToString();
|
||
ddlAnio.SelectedItem.Text = dsPartida.Tables[0].Rows[0]["ANIODISTRIBUCIONPARTIDA"].ToString();
|
||
txtMonto.Text = dsPartida.Tables[0].Rows[0]["MONTODISTRIBUCIONPARTIDA"].ToString();
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M4", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
private void llenarGRVDetalle() //M5
|
||
{
|
||
try
|
||
{
|
||
objDistribucionPartidaBL = new DistribucionPartidaBL();
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.PK = 0;
|
||
objDistribucionPartidaBL.objDistribucionPartidaEL.Proyecto = Int32.Parse(ddlProyecto.SelectedValue);
|
||
DataSet dsDetalle = objDistribucionPartidaBL.getDetalle();
|
||
|
||
detalleGRVDatos(dsDetalle, grvDetalle);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
MensajeError("Error en R6M5", ex);
|
||
General.ReportarError(ex, Session["LOGIN"].ToString());
|
||
}
|
||
}
|
||
|
||
#endregion
|
||
|
||
} |