Пример #1
0
        // GET: DefMetricas/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DefMetricas defMetricas = db.DefMetricas.Find(id);

            if (defMetricas == null)
            {
                return(HttpNotFound());
            }

            var defMetricasViewModel = ModelMappingProfile.Mapper.Map <DefMetricas, DefMetricasViewModel>(defMetricas);

            var metricasViewModel = ModelMappingProfile.Mapper.Map <List <Metricas>, List <MetricasViewModel> >(db.Metricas.ToList());

            defMetricasViewModel.MetricasList = new SelectList(metricasViewModel, "IdMetrica", "Descripcion", defMetricasViewModel.IdMetrica);

            var proveedoresViewModel = ModelMappingProfile.Mapper.Map <List <Proveedores>, List <ProveedorViewModel> >(db.Proveedores.ToList());

            defMetricasViewModel.ProveedoresList = new SelectList(proveedoresViewModel, "Id", "NombreProveedor", defMetricasViewModel.IdProveedor);

            var tiposProyectosViewModel = ModelMappingProfile.Mapper.Map <List <TiposProyectos>, List <TiposProyectosViewModel> >(db.TiposProyectos.ToList());

            defMetricasViewModel.TiposProyectosList = new SelectList(tiposProyectosViewModel, "IdTipoProyecto", "Descripcion", defMetricasViewModel.IdTipoProyecto);

            var visionViewModel = ModelMappingProfile.Mapper.Map <List <Vision>, List <VisionViewModel> >(db.Vision.ToList());

            defMetricasViewModel.VisionList = new SelectList(visionViewModel, "IdVision", "Descripcion", defMetricasViewModel.IdVision);

            return(PartialView("Details", defMetricasViewModel));
        }
Пример #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            DefMetricas defMetricas = db.DefMetricas.Find(id);

            db.DefMetricas.Remove(defMetricas);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #3
0
        // GET: DefMetricas/Edit/5
        public ActionResult Cargar(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DefMetricas defMetricas = db.DefMetricas.Find(id);

            if (defMetricas == null)
            {
                return(HttpNotFound());
            }

            return(RedirectToAction("Index", "MedicionesMetricas", new { @idDefMetricas = defMetricas.id_DefMetricas
                                                                         , @proveedorId = defMetricas.id_Proveedor
                                                                         , @metricaId = defMetricas.id_Metricas }));
        }