Ejemplo n.º 1
0
 private void FormEventLogView_Load(object sender, EventArgs e)
 {
     if (dataSource == null)
     {
         DateTime dt = DateTime.Now;
         DataSource = EventLogVwServices.List(new Db(DbServices.ConnectionString));
         slblEllapsedTimeValue.Text = (DateTime.Now.Subtract(dt).TotalMilliseconds / 1000).ToString();
     }
 }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
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));
        }