private void FormResourceView_Load(object sender, EventArgs e) { if (dataSource == null) { DateTime dt = DateTime.Now; DataSource = ResourceVwServices.List(new Db(DbServices.ConnectionString)); slblEllapsedTimeValue.Text = (DateTime.Now.Subtract(dt).TotalMilliseconds / 1000).ToString(); } }
/// <summary> /// Returns a list of ResourceVw objects /// </summary> /// <returns></returns> public ActionResult Index(ResourceVwViewModel Model) { if (Model.Filter.HasCriteria) { Db db = new Db(DbServices.ConnectionString); Model.List = ResourceVwServices.Get(Model.Filter, db); } else { Model.List = new List <ResourceVw>(); } return(View(Model)); }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Details(Nullable <int> id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ResourceVwViewModel resourceVwViewModel = new ResourceVwViewModel(); Db db = new Db(DbServices.ConnectionString); // resourceVwViewModel.Instance = ResourceVwServices.Get(id.Value, db); resourceVwViewModel.Instance = ResourceVwServices.GetChildren(id.Value, db); if (resourceVwViewModel.Instance == null) { return(HttpNotFound()); } return(View(resourceVwViewModel)); }