Ejemplo n.º 1
0
        public ActionResult Ver(int id, bool parcial = true)
        {
            try
            {
                _compromisoLogica = new CompromisoLogica();
                _estructuraLogica = new EstructuraLogica();

                Compromiso model = _compromisoLogica.Buscar(id);

                ViewBag.Tablero = string.Concat("/ALICORP", _estructuraLogica.Ruta(model.TableroId)?.ToUpper() ?? "");
                ViewBag.Ruta    = string.Concat("/ALICORP", _estructuraLogica.Ruta(model.EstructuraId)?.ToUpper() ?? "");

                if (parcial)
                {
                    return(PartialView("_Ver", model));
                }
                else
                {
                    return(View(model));
                }
            }
            catch (Exception ex)
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                ViewBag.Message     = ex.Message;
                return(PartialView("_Error"));
            }
        }
Ejemplo n.º 2
0
        public ActionResult Nuevo(string callBack = "SetCompromiso")
        {
            try
            {
                _estructuraLogica = new EstructuraLogica();

                Compromiso model = new Compromiso {
                    EstructuraId = _estructuraId
                };

                ViewBag.Tableros = _estructuraLogica.Listar(new EstructuraFiltro {
                    Tablero = true
                }) ?? new List <Estructura>();
                ViewBag.Ruta     = string.Concat("/ALICORP", _estructuraLogica.Ruta(_estructuraId)?.ToUpper() ?? "");
                ViewBag.CallBack = callBack;

                return(PartialView("_Nuevo", model));
            }
            catch (Exception ex)
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                ViewBag.Message     = ex.Message;
                return(PartialView("_Error"));
            }
        }
Ejemplo n.º 3
0
        public ActionResult Seguimiento(int id)
        {
            try
            {
                _compromisoLogica = new CompromisoLogica();
                _estructuraLogica = new EstructuraLogica();

                Compromiso model = _compromisoLogica.Buscar(id, true);
                ViewBag.Ruta = string.Concat("/ALICORP", _estructuraLogica.Ruta(model.EstructuraId)?.ToUpper() ?? "");

                return(PartialView("_Seguimiento", model));
            }
            catch (Exception ex)
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                ViewBag.Message     = ex.Message;
                return(PartialView("_Error"));
            }
        }
Ejemplo n.º 4
0
        public ActionResult Editar(int id, string callBack = "SetCompromiso")
        {
            try
            {
                _estructuraLogica = new EstructuraLogica();
                _compromisoLogica = new CompromisoLogica();

                Compromiso model = _compromisoLogica.Buscar(id);

                ViewBag.Tablero  = string.Concat("/ALICORP", _estructuraLogica.Ruta(model.TableroId)?.ToUpper() ?? "");
                ViewBag.CallBack = callBack;

                return(PartialView("_Editar", model));
            }
            catch (Exception ex)
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                ViewBag.Message     = ex.Message;
                return(PartialView("_Error"));
            }
        }