Ejemplo n.º 1
0
        public static bool InsertarAvance(EvaluacionSeguimientoV2 entity, out string msg)
        {
            try
            {
                using (Datos.FonadeDBDataContext db = new Datos.FonadeDBDataContext(System.Configuration.ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString))
                {
                    var entitydb = (from row in db.EvaluacionSeguimientoV2s
                                    where row.IdProyecto == entity.IdProyecto &&
                                    row.IdConvocatoria == entity.IdConvocatoria
                                    select row).FirstOrDefault();

                    //insert-update
                    if (entitydb == null)
                    {
                        db.EvaluacionSeguimientoV2s.InsertOnSubmit(entity);
                    }
                    else
                    {
                        entitydb.Antecedentes = entity.Antecedentes;
                        entitydb.Competencia  = entity.Competencia;
                        entitydb.CondicionesComercializacion = entity.CondicionesComercializacion;
                        entitydb.EquipoTrabajo = entity.EquipoTrabajo;
                        entitydb.EstrategiasComercializacion = entity.EstrategiasComercializacion;
                        entitydb.FechaActualizacion          = entity.FechaActualizacion;
                        entitydb.FuerzaMercado          = entity.FuerzaMercado;
                        entitydb.IdContacto             = entity.IdContacto;
                        entitydb.IdentificacionMercado  = entity.IdentificacionMercado;
                        entitydb.IndicadoresGestion     = entity.IndicadoresGestion;
                        entitydb.IndicadoresSeguimiento = entity.IndicadoresSeguimiento;
                        entitydb.IndiceRentabilidad     = entity.IndiceRentabilidad;
                        entitydb.LecturaPlan            = entity.LecturaPlan;
                        entitydb.Modelo               = entity.Modelo;
                        entitydb.NecesidadClientes    = entity.NecesidadClientes;
                        entitydb.Normatividad         = entity.Normatividad;
                        entitydb.OperacionNegocio     = entity.OperacionNegocio;
                        entitydb.PeriodoImproductivo  = entity.PeriodoImproductivo;
                        entitydb.PlanOperativo        = entity.PlanOperativo;
                        entitydb.PlanOperativo2       = entity.PlanOperativo2;
                        entitydb.PropuestaValor       = entity.PropuestaValor;
                        entitydb.Riesgos              = entity.Riesgos;
                        entitydb.SolicitudInformacion = entity.SolicitudInformacion;
                        entitydb.Sostenibilidad       = entity.Sostenibilidad;
                        entitydb.TendenciasMercado    = entity.TendenciasMercado;
                        entitydb.ValidacionMercado    = entity.ValidacionMercado;
                        entitydb.Viabilidad           = entity.Viabilidad;
                        entitydb.InformeEvaluacion    = entity.InformeEvaluacion;
                    }
                    db.SubmitChanges();

                    msg = Mensajes.Mensajes.GetMensaje(8);
                    return(true);
                }
            }
            catch (Exception ex)
            {
                //todo guardar log
                msg = Mensajes.Mensajes.GetMensaje(7);
                return(false);
            }
        }
Ejemplo n.º 2
0
        protected void btnEnviar_Click(object sender, EventArgs e)
        {
            EvaluacionSeguimientoV2 entity = new EvaluacionSeguimientoV2()
            {
                Antecedentes = CheckAntecedente.Checked,
                Competencia  = CheckCompetencia.Checked,
                CondicionesComercializacion = CheckCondicion.Checked,
                EquipoTrabajo = CheckEquipo.Checked,
                EstrategiasComercializacion = CheckEstrategia.Checked,
                FechaActualizacion          = DateTime.Now,
                FuerzaMercado          = CheckFuerza.Checked,
                IdContacto             = usuario.IdContacto,
                IdConvocatoria         = (int)Negocio.PlanDeNegocioV2.Utilidad.Convocatoria.GetConvocatoriaByProyecto(IdProyecto, HttpContext.Current.Session["HistorialEvaluacion"] != null ? Convert.ToInt32(HttpContext.Current.Session["HistorialEvaluacion"]) : 0),
                IdentificacionMercado  = CheckIdentificacion.Checked,
                IdProyecto             = IdProyecto,
                IndicadoresGestion     = CheckIndiGestion.Checked,
                IndicadoresSeguimiento = CheckIndiSegui.Checked,
                IndiceRentabilidad     = CheckIndiRenta.Checked,
                LecturaPlan            = CheckLectura.Checked,
                Modelo               = CheckModelo.Checked,
                NecesidadClientes    = CheckNecesidad.Checked,
                Normatividad         = CheckNormatividad.Checked,
                OperacionNegocio     = CheckOperacion.Checked,
                PeriodoImproductivo  = CheckPeriodo.Checked,
                PlanOperativo        = CheckPlan.Checked,
                PlanOperativo2       = CheckPlanOperativo.Checked,
                PropuestaValor       = CheckPropuesta.Checked,
                Riesgos              = CheckRiesgos.Checked,
                SolicitudInformacion = CheckSolicitud.Checked,
                Sostenibilidad       = CheckSostenibilidad.Checked,
                TendenciasMercado    = CheckTendencias.Checked,
                ValidacionMercado    = CheckValidacion.Checked,
                Viabilidad           = CheckViabilidad.Checked,
                InformeEvaluacion    = CheckInforme.Checked
            };

            string msg;
            bool   resul = Negocio.PlanDeNegocioV2.Evaluacion.TablaDeEvaluacion.HojaAvance.InsertarAvance(entity, out msg);

            if (!resul)
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "msg", "alert('" + msg + "');", true);
            }

            CargarAvance();
        }
Ejemplo n.º 3
0
        public static EvaluacionSeguimientoV2 GetAvance(EvaluacionSeguimientoV2 entity)
        {
            try
            {
                using (Datos.FonadeDBDataContext db = new Datos.FonadeDBDataContext(System.Configuration.ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString))
                {
                    var entitydb = (from row in db.EvaluacionSeguimientoV2s
                                    where row.IdProyecto == entity.IdProyecto &&
                                    row.IdConvocatoria == entity.IdConvocatoria
                                    select row).FirstOrDefault();

                    db.SubmitChanges();

                    return(entitydb);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Ejemplo n.º 4
0
        void CargarAvance()
        {
            EvaluacionSeguimientoV2 entity = new EvaluacionSeguimientoV2()
            {
                IdConvocatoria = (int)Negocio.PlanDeNegocioV2.Utilidad.Convocatoria.GetConvocatoriaByProyecto(IdProyecto, HttpContext.Current.Session["HistorialEvaluacion"] != null ? Convert.ToInt32(HttpContext.Current.Session["HistorialEvaluacion"]) : 0),
                IdProyecto     = IdProyecto
            };

            entity = Negocio.PlanDeNegocioV2.Evaluacion.TablaDeEvaluacion.HojaAvance.GetAvance(entity);
            if (entity != null)
            {
                CheckAntecedente.Checked    = entity.Antecedentes; CheckAntecedente.Enabled = !entity.Antecedentes;
                CheckCompetencia.Checked    = entity.Competencia; CheckCompetencia.Enabled = !entity.Competencia;
                CheckCondicion.Checked      = entity.CondicionesComercializacion; CheckCondicion.Enabled = !entity.CondicionesComercializacion;
                CheckEquipo.Checked         = entity.EquipoTrabajo; CheckEquipo.Enabled = !entity.EquipoTrabajo;
                CheckEstrategia.Checked     = entity.EstrategiasComercializacion; CheckEstrategia.Enabled = !entity.EstrategiasComercializacion;
                CheckFuerza.Checked         = entity.FuerzaMercado; CheckFuerza.Enabled = !entity.FuerzaMercado;
                CheckIdentificacion.Checked = entity.IdentificacionMercado; CheckIdentificacion.Enabled = !entity.IdentificacionMercado;
                CheckIndiSegui.Checked      = entity.IndicadoresSeguimiento; CheckIndiSegui.Enabled = !entity.IndicadoresSeguimiento;
                CheckIndiRenta.Checked      = entity.IndiceRentabilidad; CheckIndiRenta.Enabled = !entity.IndiceRentabilidad;
                CheckInforme.Checked        = entity.InformeEvaluacion; CheckInforme.Enabled = !entity.InformeEvaluacion;
                CheckLectura.Checked        = entity.LecturaPlan; CheckLectura.Enabled = !entity.LecturaPlan;
                CheckModelo.Checked         = entity.Modelo; CheckModelo.Enabled = !entity.Modelo;
                CheckNecesidad.Checked      = entity.NecesidadClientes; CheckNecesidad.Enabled = !entity.NecesidadClientes;
                CheckNormatividad.Checked   = entity.Normatividad; CheckNormatividad.Enabled = !entity.Normatividad;
                CheckOperacion.Checked      = entity.OperacionNegocio; CheckOperacion.Enabled = !entity.OperacionNegocio;
                CheckPeriodo.Checked        = entity.PeriodoImproductivo; CheckPeriodo.Enabled = !entity.PeriodoImproductivo;
                CheckPlan.Checked           = entity.PlanOperativo; CheckPlan.Enabled = !entity.PlanOperativo;
                CheckPlanOperativo.Checked  = entity.PlanOperativo2; CheckPlanOperativo.Enabled = !entity.PlanOperativo2;
                CheckPropuesta.Checked      = entity.PropuestaValor; CheckPropuesta.Enabled = !entity.PropuestaValor;
                CheckRiesgos.Checked        = entity.Riesgos; CheckRiesgos.Enabled = !entity.Riesgos;
                CheckSolicitud.Checked      = entity.SolicitudInformacion; CheckSolicitud.Enabled = !entity.SolicitudInformacion;
                CheckSostenibilidad.Checked = entity.Sostenibilidad; CheckSostenibilidad.Enabled = !entity.Sostenibilidad;
                CheckTendencias.Checked     = entity.TendenciasMercado; CheckTendencias.Enabled = !entity.TendenciasMercado;
                CheckValidacion.Checked     = entity.ValidacionMercado; CheckValidacion.Enabled = !entity.ValidacionMercado;
                CheckViabilidad.Checked     = entity.Viabilidad; CheckViabilidad.Enabled = !entity.Viabilidad;
                CheckIndiGestion.Checked    = entity.IndicadoresGestion; CheckIndiGestion.Enabled = !entity.IndicadoresGestion;
            }
        }