示例#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;
            }
        }