예제 #1
0
        // 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;
            }
        }
예제 #2
0
        // 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;
            }
        }
예제 #3
0
 public ActionResult Index()
 {
     return(View(batchservice.GetBatches()));
 }
예제 #4
0
        public IQueryable <Batch> Get()
        {
            BatchService batchService = new BatchService();

            return(batchService.GetBatches());
        }
예제 #5
0
        // GET: Batch
        public ActionResult Index()
        {
            BatchService batchService = new BatchService();

            return(View(batchService.GetBatches()));
        }