示例#1
0
        public ActionResult Details(int?id)
        {
            ServiceDepartamento _serviceDepartamento = new ServiceDepartamento();
            DEPARTAMENTO        oDepartamento        = null;

            try
            {
                // Si va null
                if (id == null)
                {
                    return(RedirectToAction("Index"));
                }

                oDepartamento = _serviceDepartamento.GetDepartamentoActivoByID(id.Value);
                if (oDepartamento == null)
                {
                    TempData["Message"]         = "No existe el Departamento solicitado";
                    TempData["Redirect"]        = "Home";
                    TempData["Redirect-Action"] = "Index";

                    return(RedirectToAction("Default", "Error"));
                }
                return(View(oDepartamento));
            }
            catch (Exception ex)
            {
                Log.Error(ex, MethodBase.GetCurrentMethod());
                TempData["Message"]         = "Error al procesar los datos" + ex.Message;
                TempData["Redirect"]        = "Departamento";
                TempData["Redirect-Action"] = "Departamentos";

                return(RedirectToAction("Default", "Error"));
            }
        }
示例#2
0
        public viewModelReservaDetalle(int IdDepartamento)
        {
            ServiceDepartamento _ServiceDepartamento = new ServiceDepartamento();

            this.IdDepartamento = IdDepartamento;
            this.Departamento   = _ServiceDepartamento.GetDepartamentoActivoByID(IdDepartamento);
        }