Exemple #1
0
        /// <summary>
        /// Returns a list of EventLogVw objects
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(EventLogVwViewModel Model)
        {
            Db db = new Db(DbServices.ConnectionString);

            ViewBag.EventCategoryList = new SelectList(EventCategoryServices.List(db), "Id", "Name");
            ViewBag.EventStatusList   = new SelectList(EventStatusServices.List(db), "Id", "Name");

            if (Model.Filter.HasCriteria)
            {
                Model.List = EventLogVwServices.Get(Model.Filter, db);
            }
            else
            {
                Model.List = new List <EventLogVw>();
            }
            return(View(Model));
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(Nullable <long> id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EventLogVwViewModel eventLogVwViewModel = new EventLogVwViewModel();

            Db db = new Db(DbServices.ConnectionString);

            // eventLogVwViewModel.Instance = EventLogVwServices.Get(id.Value, db);
            eventLogVwViewModel.Instance = EventLogVwServices.GetChildren(id.Value, db);
            if (eventLogVwViewModel.Instance == null)
            {
                return(HttpNotFound());
            }


            return(View(eventLogVwViewModel));
        }