// Populate the page with entity data private void PopulatePage() { int userId = 0; try { userId = Security.GetCurrentUserId(); } catch { Security.RedirectToHomePage(); } List <BatchDto> batches = BatchService.GetBatches(userId); BatchGridView.DataSource = null; BatchGridView.DataBind(); hiddenDiv.Visible = false; if (batches.Count > 0) { BatchGridView.DataSource = batches; BatchGridView.DataBind(); } else { hiddenDiv.Visible = true; } }
// Populate the page for a specific User with entity data private void PopulatePage(int userId) { List <BatchDto> batches = BatchService.GetBatches(userId); BatchGridView.DataSource = null; BatchGridView.DataBind(); hiddenDiv.Visible = false; if (batches.Count > 0) { BatchGridView.DataSource = batches; BatchGridView.DataBind(); } else { hiddenDiv.Visible = true; } }
public ActionResult Index() { return(View(batchservice.GetBatches())); }
public IQueryable <Batch> Get() { BatchService batchService = new BatchService(); return(batchService.GetBatches()); }
// GET: Batch public ActionResult Index() { BatchService batchService = new BatchService(); return(View(batchService.GetBatches())); }