コード例 #1
0
        protected void GetDetails(int codigoProyecto, int codigoConvocatoria)
        {
            ProyectoResumenEjecutivoV2 entResumen = Negocio.PlanDeNegocioV2.Formulacion.ResumenEjecutivo.Resumen.Get(codigoProyecto);

            if (entResumen != null)
            {
                lblPeriodoImproductivo.Text = entResumen.PeriodoImproductivo.ToString();
                lblRecursosAportados.Text   = entResumen.RecursosAportadosEmprendedor.ToString().Trim();
            }

            IndicadorGestionEvaluacion entidadIndicador = Negocio.PlanDeNegocioV2.Utilidad.IndicadorEvaluacion.GetIndicadores(codigoProyecto, codigoConvocatoria);

            if (entidadIndicador != null)
            {
                txtVentasProductosEvaluador.Text = entidadIndicador.Ventas.ToString("N0");

                txtPeriodoImproductivoEvaluador.Text = entidadIndicador.PeriodoImproductivo.ToString();
                txtRecursosAportadosEvaluador.Text   = entidadIndicador.RecursosAportadosEmprendedor;
            }

            var contrapartidas        = Negocio.PlanDeNegocioV2.Utilidad.IndicadorFormulacion.GetContrapartidas(codigoProyecto);
            var ejecucionPresupuestal = Negocio.PlanDeNegocioV2.Utilidad.IndicadorFormulacion.GetPresupuesto(codigoProyecto);
            var ventasTotales         = FieldValidate.moneyFormat(Negocio.PlanDeNegocioV2.Utilidad.IndicadorFormulacion.GetVentas(codigoProyecto), true);
            var idh           = Negocio.PlanDeNegocioV2.Utilidad.IndicadorFormulacion.GetIDH(codigoProyecto);
            var salarioMinimo = Negocio.PlanDeNegocioV2.Utilidad.Convocatoria.GetSalarioMinimoConvocatoria(codigoConvocatoria);
            var valorRecomendadoEvaluacion = Negocio.PlanDeNegocioV2.Utilidad.Convocatoria.GetRecursosAprobados(codigoProyecto, codigoConvocatoria);

            lblContrapartidas.Text                 = lblContrapartidasEvaluador.Text = contrapartidas.ToString();
            lblEjecucionPresupuestal.Text          = ejecucionPresupuestal + " (SMLV) " + "- " + FieldValidate.moneyFormat((ejecucionPresupuestal * salarioMinimo), true);
            lblEjecucionPresupuestalEvaluador.Text = valorRecomendadoEvaluacion + " (SMLV) " + "- " + FieldValidate.moneyFormat((valorRecomendadoEvaluacion * (double)salarioMinimo), true);
            lblVentasProductos.Text                = ventasTotales;
            lblIdh.Text          = idh.ToString();
            lblIdhEvaluador.Text = idh.ToString();
        }
コード例 #2
0
        protected void gvMain_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                if (e.CommandName.Equals("Ver"))
                {
                    if (e.CommandArgument != null)
                    {
                        var data = e.CommandArgument.ToString();
                        var codigoConvocatoria = Negocio.PlanDeNegocioV2.Utilidad.Convocatoria.GetConvocatoriaByProyecto(Convert.ToInt32(data), 0).GetValueOrDefault(0);
                        IndicadorGestionEvaluacion entidadIndicador = Negocio.PlanDeNegocioV2.Utilidad.IndicadorEvaluacion.GetIndicadores(Convert.ToInt32(data), codigoConvocatoria);

                        if (entidadIndicador == null)
                        {
                            throw new ApplicationException("El Proyecto ID: " + data + " no tiene información de indicadores, por favor actualicela.");
                        }

                        var datosInterventor = datosActaDTOController.GetContactosInterventor(Convert.ToInt32(data));
                        if (datosInterventor == null)
                        {
                            throw new ApplicationException("El Proyecto ID: " + data + " no tiene interventor asociado.");
                        }

                        var entidadInterv = datosActaDTOController.getInfoEntidadInteventora(Convert.ToInt32(data), Usuario.IdContacto);
                        if (entidadInterv == null)
                        {
                            throw new ApplicationException("El Proyecto ID: " + data + " no tiene contrato de interventoria asignado a este usuario.");
                        }

                        Response.Redirect("~/PlanDeNegocioV2/Administracion/Interventoria/ActasDeSeguimiento/GestionarActas.aspx?codigo=" + data);
                    }
                }
            }
            catch (Exception ex)
            {
                lblError.Visible = true;
                lblError.Text    = "Sucedio un error detalle: " + ex.Message;
            }
        }
コード例 #3
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                FieldValidate.ValidateString("Ventas", txtVentasProductosEvaluador.Text, true, 12);
                FieldValidate.ValidateNumeric("Ventas", txtVentasProductosEvaluador.Text, true);
                FieldValidate.ValidateString("Periodo improductivo", txtPeriodoImproductivoEvaluador.Text, true, 2);
                FieldValidate.ValidateNumeric("Periodo improductivo", txtPeriodoImproductivoEvaluador.Text, true);
                FieldValidate.ValidateString("Recursos aportados", txtRecursosAportadosEvaluador.Text.Trim(), true, 12);
                FieldValidate.ValidateNumeric("Recursos aportados", txtRecursosAportadosEvaluador.Text, true);

                int?idProductoRepresentativoEvaluacion = GetProductoRepresentativo();

                if (idProductoRepresentativoEvaluacion == null)
                {
                    throw new ApplicationException("Debe seleccionar el producto mas presentativo.");
                }

                IndicadorGestionEvaluacion entity = new IndicadorGestionEvaluacion()
                {
                    PeriodoImproductivo          = Convert.ToInt32(txtPeriodoImproductivoEvaluador.Text),
                    RecursosAportadosEmprendedor = txtRecursosAportadosEvaluador.Text,
                    Ventas                    = Convert.ToDecimal(txtVentasProductosEvaluador.Text),
                    IdProyecto                = CodigoProyecto,
                    IdConvocatoria            = CodigoConvocatoria,
                    ProductoMasRepresentativo = idProductoRepresentativoEvaluacion.GetValueOrDefault()
                };

                Negocio.PlanDeNegocioV2.Utilidad.IndicadorEvaluacion.InsertOrUpdate(entity);

                var produccionProducto = GetProduccionEvaluador();
                var mercadeo           = GetMercadeoEvaluador();
                var cargos             = GetCargosEvaluador();

                foreach (var producto in produccionProducto)
                {
                    Negocio.PlanDeNegocioV2.Utilidad.IndicadorEvaluacion.InsertOrUpdateProduccion(producto);
                }

                foreach (var actividad in mercadeo)
                {
                    Negocio.PlanDeNegocioV2.Utilidad.IndicadorEvaluacion.InsertOrUpdateMercadeo(actividad);
                }

                foreach (var cargo in cargos)
                {
                    Negocio.PlanDeNegocioV2.Utilidad.IndicadorEvaluacion.InsertOrUpdateCargo(cargo);
                }

                TabEvaluacionProyecto tabEvaluacion = new TabEvaluacionProyecto()
                {
                    CodProyecto       = CodigoProyecto,
                    CodConvocatoria   = CodigoConvocatoria,
                    CodTabEvaluacion  = (Int16)CodigoTab,
                    CodContacto       = Usuario.IdContacto,
                    FechaModificacion = DateTime.Now,
                    Realizado         = false
                };

                string messageResult;
                Negocio.PlanDeNegocioV2.Utilidad.TabEvaluacion.SetUltimaActualizacion(tabEvaluacion, out messageResult);
                EncabezadoEval.GetUltimaActualizacion();

                Formulacion.Utilidad.Utilidades.PresentarMsj(messageResult, this, "Alert");

                lblError.Visible = false;
            }
            catch (ApplicationException ex)
            {
                lblError.Visible = true;
                lblError.Text    = "Advertencia: " + ex.Message;
                Formulacion.Utilidad.Utilidades.PresentarMsj(ex.Message, this, "Alert");
            }
            catch (Exception ex)
            {
                lblError.Visible = true;
                lblError.Text    = "Error inesperado: " + ex.Message;
                Formulacion.Utilidad.Utilidades.PresentarMsj("Sucedio un error al guardar.", this, "Alert");
            }
        }